If the unlikely should occur and a disaster completely destroys the NSX Advanced Load Balancer Controller (or entire cluster), the device/VM hosting the NSX Advanced Load Balancer Controller(s) should first be restored to factory default usingflushdb.sh. Failure to do so can prevent the Controller from coming up. To restore the Controller to the factory default, run the script /opt/avi/scripts/flushdb.sh.

Note:

If it exists, the /var/lib/avi/etc/flushdb.done file should be removed before running the flushdb.sh script.

Thereafter, the following script can be used to automate the configuration recovery process:

/opt/avi/scripts/restore_config.py

Note:

If running an NSX Advanced Load Balancer version earlier than 16.2, please contact NSX Advanced Load Balancer Networks support for help restoring the configuration.

This script imports the backup configuration onto the NSX Advanced Load Balancer Controller. If restoring an NSX Advanced Load Balancer Controller cluster, this script restores the configuration and also re-adds the other two nodes to the cluster.

  1. Create three new NSX Advanced Load Balancer Controllers with the same IP address as the original cluster members. (NSX Advanced Load Balancer currently supports only static IP addresses.) At this point, other than having an IP address, each NSX Advanced Load Balancer Controller node should be in its factory default state.

  2. Log onto one of the NSX Advanced Load Balancer Controller nodes using SSH or SCP. Use the default administrator credentials.

  3. Run the restore command or script:

    • Copy backup file via SCP:

    scp /var/backup/avi_config.json admin@<controller-ip>://tmp/avi_config.jsonRun restore command locally via SSH:
  4. Run restore command locally via SSH:

/opt/avi/scripts/restore_config.py --config CONFIG --passphrase PASSPHRASE --do_not_form_cluster DO_NOT_FORM_CLUSTER --vip VIP --followers FOLLOWER_IP [FOLLOWER_IP ...] --flushdb --cluster_uuid CLUSTER_UUID

In the above command line:

  • CONFIG is the path of the configuration file.

  • PASSPHRASE is the export configuration passphrase.

  • DO_NOT_FORM_CLUSTER causes cluster formation to be skipped.

  • VIP is the virtual IP address of the Avi Controller.

  • FOLLOWER_IP [FOLLOWER_IP ...] is a list of the IP addresses of the followers.

  • The optional --flushdb argument causes the command to delete all configuration before restoring.

  • CLUSTER_UUID is the old cluster UUID to be restored.