Restoring a backup restores the state of the components at the time of the backup.
Note: During restore, if any data ingestion occurs and the index is getting used, then the restore can fail.
Procedure
- Connect to the deployer VM and execute the below command:
export KUBECONFIG=/root/.kube/<KubeConfig File>
- In a text editor, create the restoration configuration file in YAML format.
The example file is located in the tcx-deployer/examples/backup-and-restore/restore.yaml.example.
Use the following template for the component backup:apiVersion: tcx.vmware.com/v1alpha1 kind: Restore metadata: name: restore-name spec: restore: postgres: enabled: true timeout: 10m dbs: - "analyticsservice" - "alarmservice" - "collector" - "grafana" - "keycloak" elastic: enabled: true timeout: 10m removeAndAddRepository: false cleanUpIndices: "" collectors: enabled: true timeout: 10m configmaps: enabled: false timeout: 10m secrets: enabled: false timeout: 10m zookeeper: enabled: true timeout: 10m rootPaths: - "/vmware/vsa/gateway" - "/vmware/vsa/smarts" - "/omega/enrichment" - "/omega/kpi" #- "/vmware/vsa/ncm" backupName: "backup-name"
Uncomment
#- "/vmware/vsa/ncm"
to restore backup of NCM reports.Note: If you want to take a VMware Telco Cloud Service Assurance 2.1 backup and restore the data in VMware Telco Cloud Service Assurance 2.3, perform the following actions:- In the restore.yaml file, comment out the
grafana
under dbs > postgres. - In the restore.yaml file, comment out
cleanUpIndices: "ELASTICSEARCH_EVENTS,ELASTICSEARCH_CONFIG,ELASTICSEARCH_KAFKA_MAPPER,METRICS"
. - To view the NCM reports, enter the NCM database IP address and password in the Grafana NCM-Postgres datasource.
- Use the Grafana export and import options to export any customized Grafana dashboards from VMware Telco Cloud Service Assurance 2.1 and import them into VMware Telco Cloud Service Assurance 2.3.
- In the restore.yaml file, comment out the
- To restore the backup, run the following command:
kubectl apply -f <configuration YAML file>
The following command creates the restore CR, and the status of the restore are updated in the status field as follows:~> kubectl get restore.tcx.vmware.com --watch
NAME STATUS TIME STARTED TIME COMPLETED MESSAGE restore-name # <------ The restore got created restore-name IN_PROGRESS 2022-05-13T21:32:11.541Z # <------ The restore status is IN_PROGRESS restore-name SUCCESSFUL 2022-05-13T21:32:11.541Z 2022-05-13T21:32:14.741Z # <------ The restore was SUCCESSFUL, the MESSAGE field would be populated in case there is a failure with the details
Note: Once restore is triggered it can not be undo, a failure to restore might result to a partial restore of the system. If the restore is failed, the failure message displays in the Message field.Option Description removeAndAddRepository Remove and add repository will delete the existing repository. When you are performing backup and restore across clusters, you must set removeAndAddRepository: true.` cleanUpIndices when you perform backup and restore across clusters, you must update the indices. For example, cleanUPIndices:ELASTICSEARCH_EVENTS,ELASTICSEARCH_CONFIG,ELASTICSEARCH_KAFKA_MAPPER
Note:Disable Unnecessary Datastores
Before starting the restore process, it is important to disable any datastores that are not required. To do this, update the Restore CR. Also, if you have not taken a backup for a datastore, you must update the restore CRs by settingenabled: false
. For example:spec: restore: configmap: enabled: false
Comment Out Unbacked Components
If you have not backed up some components in a datastore, you must comment out the corresponding components in the Restore CRs. For example:spec: restore: postgres: enabled: true dbs: analyticservice: # comment out this component
For NCM Reports, if the subnets are added in the NCM server-side configuration, then no changes are required. Otherwise, add the modified Grafana and ncm-proxy Node IPs in the NCM server-side configuration. For more information, see the NCM Server-Side Configuration topic.