To back up the configuration, use the Avi Load Balancer UI, CLI commands, or API commands shown in this section. Backups can be scheduled or on-demand.

Note:

When backing up Avi Load Balance via the CLI method for system restore, it is required and recommended that you perform the backup with the full_system option enabled.

Scheduled Backup using the UI

To view or edit the configuration backup scheduler’s current settings, an admin-tenant user first must navigate to Administration > Controller > Configuration Backup.

Note:

The scheduled backups get stored in /var/lib/avi/backups/ on all Avi Load Balancer Controller in the cluster.

  1. To configure the backup, click EDIT to view the EDIT CONFIGURATION BACKUP screen.



  2. Select Enable Configuration Backup check box to schedule backups.

  3. Enter the Passphrase and confirm the passphrase to encrypt all sensitive fields contained within the backup. Choose a phrase that is not easy to guess and guard it carefully. Data cannot be restored without the passphrase.

  4. Enter a File Prefix to customize the backup archive filename.

  5. Select a remote transfer Protocol from the drop-down menu.

    1. Secure Copy Protocol (SCP)

    2. Secure File Transfer Protocol (SFTP)

  6. Under Scheduler, configure the following:

    1. Enter a value from 0 to 60 as the Frequency to determine how often backups are to be taken. 0 indicates the backup sequence has no end time.

    2. Enter the Frequency Unit for backups to occur. By default, the Frequency Unit is taken every day. Use this field to change the unit to minutes, hours, weeks, or months.

    3. Enter a number ranging from 0 to 20 as the Number of backups to store. 0 is equivalent to deselect the Local option. The oldest backup is deleted after the most recent backup successfully completes.



  7. You can choose to save local (on Controller) and remote backup locations independently. In the Backup Destination section, configure the following:

    1. Select Enable Local Backups (On Controller), to preserve the number of indicated backups on the Controller.

    2. Select Enable Remote Server Backup to save the backup on a remote server.

      Note:

      This option is deactivated by default, but it is recommended to specify a remote destination in case the Controller cluster fails in a non-recoverable fashion.

    3. In the Server Address field, enter an FQDN or IP address reachable from the Controller.

    4. In the Home Directory field, provide a remote destination address with write permissions.

    5. Use the drop-down menu to select User Credentials from a previously-defined SSH user. Alternatively, click the three dots at the end of the field to Create new user credentials.

    6. If you are creating a new SSH user, the following dialog is shown.

      Enter a username in the Name field. Avi Load Balancer will use this username to transfer the file. In the Authentication field, select either SSH Key or Password and provide the required information.

  8. Click Save to complete configuration backup settings.

Scheduled Backup using the CLI

Note:

When backing up Avi Load Balance via the CLI method for system restore, it is required and recommended that you perform the backup with the full_system option enabled.

[admin:10-102-64-234]: > show backupconfiguration Backup-Configuration
+-------------------------------+----------------------------------------------------------+
| Field                         | Value                                                    |
+-------------------------------+----------------------------------------------------------+
| uuid                          | backupconfiguration-0c5b26a0-a45d-47af-b230-42a8901aaf57 |
| name                          | Backup-Configuration                                     |
| save_local                    | True                                                     |
| maximum_backups_stored        | 4                                                        |
| upload_to_remote_host         | True                                                     |
| ssh_user_ref                  | aviuser                                                  |
| remote_directory              | /tmp                                                     |
| remote_hostname               | 10.102.64.235                                            |
| backup_passphrase             | <sensitive>                                              |
| backup_file_prefix            | sftp                                                     |
| remote_file_transfer_protocol | SFTP                                                     |
| tenant_ref                    | admin                                                    |
+-------------------------------+----------------------------------------------------------+
[admin:10-102-64-234]: >

You can specify the value of start_date_time from the CLI (not possible using the UI).

[admin:10-10-24-52]: > configure scheduler Default-Scheduler
[admin:10-10-24-52]: scheduler> no enabled
[admin:10-10-24-52]: scheduler> start_date_time 2017-05-11T00:00:00
Overwriting the previously entered value for start_date_time
[admin:10-10-24-52]: scheduler> save
[admin:10-10-24-52]: > configure scheduler Default-Scheduler
[admin:10-10-24-52]: scheduler> enabled
Overwriting the previously entered value for enabled
[admin:10-10-24-52]: scheduler> save

Scheduled Backup using the API

In this example, a PUT changes the scheduler frequency to one week.

PUT : api/scheduler/
{'_last_modified': u'1476209663670990',
'backup_config_ref': 'https://10.10.24.52/api/backupconfiguration/backupconfiguration-5d65f12e-5da1-49e0-b703-ec65ae9a39c6',
 'enabled': True,
 'frequency': 1,
 'frequency_unit': u'SCHEDULER_FREQUENCY_UNIT_WEEK',
 'name': u'Default-Scheduler',
 'run_mode': u'RUN_MODE_PERIODIC',
 'scheduler_action': u'SCHEDULER_ACTION_BACKUP',
 'start_date_time': u'2016-10-09T15:35:46.220623',
 'tenant_ref': u'https://10.10.24.52/api/tenant/admin',
 'url': 'https://10.10.24.52/api/scheduler/scheduler-b5f7e673-8818-44d1-8f74-45238cc08235',
 'uuid': u'scheduler-b5f7e673-8818-44d1-8f74-45238cc08235'}

On-demand Backup using the CLI

To back up the Avi Load Balancer configuration on-demand, at any arbitrary time, use the following CLI command.

: > export configuration file /tmp/avi_config.json full_system
Please enter the passphrase to encrypt configuration:
Retype passphrase:
Downloaded the attachment to /tmp/avi_config.json
Completed writing the export configuration to /tmp/avi_config.json

On-demand Backup using the REST API

To back up the Avi Load Balancer configuration on-demand, at any arbitrary time, use the following API request.

GET https://[CONTROLLER-IP]/api/configuration/export?full_system=true

To include a passphrase, use one of the following options.

GET https://[CONTROLLER-IP]/api/configuration/export?full_system=true&passphrase=[PASSPHRASE]

Use the following POST method and include passphrase in the JSON data.

POST https://[CONTROLLER-IP]/api/configuration/export?full_system=true JSON data: {"passphrase":"[PASSPHRASE]"}

Make sure to replace [CONTROLLER-IP] with the IP address of the Avi Load Balancer Controller (if using a single Controller node) or the IP address of the Controller cluster.

On-demand Backup Script Utilizing Python

For more information, see vmware/alb-sdk.

Configuring Backup using Amazon S3

A backup configuration can be stored on Amazon S3 bucket.

To enable backup configuration on Amazon S3, use the configure backupconfiguration command and set the value of the upload_to_s3 flag to true.

Provide the value of the following attributes to save the backup file on the Amazon S3 bucket for the required instance.

  • aws_access_key : Access Key ID

  • aws_secret_access : Secret Access Key

  • aws_bucket_id : Name of the S3 bucket

[admin:10-1-1-1]: configure backupconfiguration Backup-Configuration
Note:

For enabling backup of the Avi Load Balancer Controller, you must have write access permission to the S3 bucket.

For detailed information on the Access Key ID and Secret Access Key, see AWS User Cross-Account AssumeRole topic in the VMware Avi Load BalancerInstallation Guide.