Back up OpenSDN data¶
MOSK enables you to perform the automatic OpenSDN
data backup using the tf-dbbackup-job cron job. Also, you can configure
a remote NFS storage for OpenSDN data backups. For configuration details,
refer to the OpenSDN database section in Reference Architecture.
This section provides instructions on how to back up the OpenSDN data manually if needed.
Manually back up OpenSDN data in JSON format¶
Disable the Neutron server that is used by OpenStack to communicate with the OpenSDN API:
Note
The database changes associated with northbound APIs must be stopped on all systems before performing any backup operations.
Scale the
neutron-serverdeployment to 0 replicas:kubectl -n openstack scale deploy neutron-server --replicas 0
Verify the number of replicas:
kubectl -n openstack get deploy neutron-server
Example of a positive system response:
NAME READY UP-TO-DATE AVAILABLE AGE neutron-server 0/0 0 0 6d22h
Join the OpenSDN API that is part of the
configDaemonSet:Obtain the
tf-configpod:kubectl -n tf get pod -l tungstenfabric=config
Example of a system response:
NAME READY STATUS RESTARTS AGE tf-config-6ppvc 5/5 Running 0 5d4h tf-config-rgqqq 5/5 Running 0 5d4h tf-config-sb4kk 5/5 Running 0 5d4h
Join the Bash shell of one of the
apicontainer from the previous step:kubectl -n tf exec -it tf-config-<hash> -c api -- bash
Example of a system response:
(config-api[hostname])[<USER>@<HOSTNAME> /]$
Inside the
apicontainer, change the directory to the Pythonconfig managementpackages:cd /usr/lib/python3.6/site-packages/cfgm_common
Back up data using
db_json_eximin JSON format:python db_json_exim.py --export-to /tmp/db-dump.json
Verify the created dump:
cat /tmp/db-dump.json | python -m json.tool | less
Copy the backup from the container:
kubectl -n tf cp tf-config-<hash>:/tmp/db-dump.json <DESTINATION-PATH-FOR-BACKUP>
On the same
confignode, copy thecontrail-api.conffile from the container to the host:kubectl -n tf cp tf-config-<hash>:/etc/contrail/contrail-api.conf <DESTINATION-PATH-FOR-CONF>
Enable the Neutron server:
Scale the
neutron-serverdeployment back to the desired number of replicas. Default is 3.kubectl -n openstack scale deploy neutron-server --replicas <DESIRED-NUM-REPLICAS>
Verify the number of replicas:
kubectl -n openstack get deploy neutron-server
Example of a system response:
NAME READY UP-TO-DATE AVAILABLE AGE neutron-server 3/3 3 3 6d23h
See also