Delete a dynamic S3 backup target on RHOSO
Please follow the below steps to remove a dynamic S3 backup target on RHOSO18.
1. Clean Workloads and Backups (Optional)
All data related to workloads and the cloud resides on the backup target. The administrator can clean this data from the backup target before deletion, but this step is optional and should not prevent the user from deleting the backup target.
Before cleaning up workloads or snapshots, log in to the correct OpenStack project, as each backup target and its workloads belong to that specific project. Select the right project you need before proceeding.
Delete all backups stored on the required dynamically added S3 backup target using the UI (Horizon) or Trilio CLI.
Delete Snapshots
Refer to this documentation for detailed steps.
Delete a Workload
Refer to this documentation for detailed steps.
Note: Repeat this procedure for each backup and workload that needs to be deleted from the S3 backup target created earlier.
2] Remove Target from WLM Records
To delete a backup target in TrilioVault, follow these steps carefully. Deleting a backup target removes it from the TrilioVault database. Make sure you don’t need this backup target anymore before you delete it.
Delete a Backup Target
Using Horizon Dashboard
Log in to the OpenStack Horizon Dashboard as an Admin user.
Navigate to Admin → Backups-Admin → Backup Targets.
On the page, you can see the list of Backup Targets.
Click the
button, and confirm the deletion once prompted.Deletion of multiple BTTs can be done by selecting the checkboxes of the desired BTTs and then clicking the
button at the top-right corner.
Using CLI
Steps to follow on Trilio CLI:
Identify the TrilioVault WLM API pod first, find the WLM API pod running in the
trilio-openstacknamespace.oc get pods -n trilio-openstack | grep wlm-apiAccess the WLM API pod and log in to the identified pod:
oc exec -n trilio-openstack -it <trilio-wlm-api-pod-name> bashThis gives you a shell inside the WLM API pod to run TrilioVault CLI commands.
Set up the environment variables and source the admin RC file to load the necessary OpenStack credentials and environment variables.
source <admin-rc-file>Without this, the CLI commands may fail due to missing authentication details.
List all the backup targets. Run the following command to view all the existing backup targets along with their Backup Target ID and Backend Endpoint:
workloadmgr backup-target-list -c ID -c "Backend Endpoint"Note: If you do not find the required backup target Backend Endpoint and Backup Target ID in the list, you can skip the delete backup target step and continue from Step 3. This situation can occur if a new backup target was created but has not yet been added to the database records.
Delete the Backup Target. Use the Backup Target ID in the following delete command:
workloadmgr backup-target-delete <backup_target_id>Replace
<backup_target_id>with the Backup Target ID you extracted in the previous command.Verify deletion. After deletion, confirm that the backup target is removed by listing all backup targets:
workloadmgr backup-target-list -c ID -c "Backend Endpoint"The deleted target should no longer appear in the list.
3] Unmount Backup Target from Data Plane
3.1] Delete Old Deployment Resource
List
OpenStackDataPlaneDeploymentresources and following command only list deployment names matching with the backup target nameoc -n openstack get osdpd | grep trilioDelete the deployment resource:
oc -n openstack delete osdpd <DEPLOYMENT_NAME>
3.2] Delete Old Service Resource
List
OpenStackDataPlaneServiceresources and Identify service name which was responsible to add this backup targetoc -n openstack get osdps | grep trilioDelete the selected
OpenStackDataPlaneService:oc -n openstack delete osdps <OpenStackDataPlaneService_NAME>
3.3] Prepare openshift yamls to delete backup target
Run the following script to prepare the YAMLs:
cd dataplane-scripts/ chmod +x create-templates-delete-backup-target.sh ./create-templates-delete-backup-target.sh <BACKUP_TARGET_NAME> <BACKUP_TARGET_TYPE> cd <BACKUP_TARGET_NAME>/ ls -llThe above script will create a directory with
<BACKUP_TARGET_NAME>in the current working directory. It creates two YAML files in this new directory. We will use those files in the next steps.
3.4] Create Custom Service Resource
Edit
trilio-delete-backup-target-service.yaml. Set parameter value foropenStackAnsibleEERunnerImage:vi trilio-delete-backup-target-service.yamlSave changes.
Verify ConfigMap and Secret resources referenced in the above service YAML file exist in the
openstacknamespace:oc get cm -n openstack | grep trilio | grep <BACKUP_TARGET_NAME> oc get secrets -n openstack | grep trilio | grep <BACKUP_TARGET_NAME>Apply this YAML to create
OpenStackDataPlaneService:oc -n openstack apply -f trilio-delete-backup-target-service.yamlVerify the changes:
oc -n openstack get osdps | grep trilio-delete-backup-target
3.5] Trigger Deployment to clean backup target
Edit the following file and add all compute node set names where this backup target was added, in list format under the
nodeSetssection.vi trilio-delete-backup-target-deployment.yamlSave changes.
Apply this YAML to create
OpenStackDataPlaneDeployment. This step will launch a new pod in theopenstacknamespace and will execute Ansible scripts. These Ansible scripts delete the container launched to mount this backup target and will clean related configuration files as well.oc -n openstack apply -f trilio-delete-backup-target-deployment.yamlList deployments:
oc -n openstack get osdpdCheck logs of the Ansible runner pod:
oc -n openstack get pods | grep trilio-delete-backup-targetCopy the pod name related to this deployment and check its logs.
oc logs -f <ANSIBLE_RUNNER_POD_NAME> -n openstackIf Ansible execution fails, debug it and fix the issue. You can re-run the Ansible scripts by recreating a new
OpenStackDataPlaneDeploymentresource using thetrilio-delete-backup-target-deployment.yamlfile. Make sure you set a unique deployment name inside this YAML, and also clean any older deployment with the same name.
4] Unmount Backup Target from Control Plane
4.1] Identify tvobackuptarget name that you want to remove
Run the following command from the bastion node. This will list the Trilio backup targets that were added dynamically. From the command output, select the backup target name that you want to delete.
oc -n trilio-openstack get tvobackuptargetSample command output:
oc -n trilio-openstack get tvobackuptarget NAME AGE tvobackuptarget-s3-bt2 47d tvobackuptarget-s3-bt6 43d tvobackuptarget-s3-bt9 43d
4.2] Delete tvobackuptarget
Run the following command to delete the selected backup target:
oc delete tvobackuptarget <TVO_BACKUP_TARGET_NAME>Sample command output:
oc delete tvobackuptarget tvobackuptarget-s3-bt2 tvobackuptarget.tvo.trilio.io "tvobackuptarget-s3-bt2" deleted
4.3] Verify that backup target got deleted
Run the following command to check whether the given backup target still appears in the list:
oc -n trilio-openstack get tvobackuptarget | grep <TVO_BACKUP_TARGET_NAME>Sample command output:
oc -n trilio-openstack get tvobackuptarget | grep tvobackuptarget-s3-bt2Also, verify that the object store pods have been cleaned. You should not see pods with names matching your backup target.
oc -n trilio-openstack get pods
Last updated
Was this helpful?
