This topic shows how to clone virtual services, pools, health monitors, and other systems currently operating on a Linux Server Cloud (LSC) to a GCP cloud.
Migration of NSX Advanced Load Balancer components or sub-systems to a GCP Cloud.
Prerequisites
Set up a new GCP Controller. (The updates can be patched to any future release).
Disable cloud_reconcile for the LSC cloud cluster to avoid interruption to the cloned virtual services due to the reconcile run by the NSX Advanced Load Balancer cloud connector.
Procedure
- Migrate to LSC Cloud.
- Create a new version of the Controller cluster in GCP with the NSX Advanced Load Balancer Controller image for GCP.
- Create virtual services, pools, and other objects that are currently in the old cluster. Both the clusters will be running the same virtual services with the same virtual IP (VIP).
The traffic from the clients go only to the Service Engines of the old cluster in LSC. This is because the priority of routes in LSC is higher than that of the cluster in LSC.
- Disable virtual services of the LSC and test the virtual service in the GCP cloud. Ensure that it continues to serve traffic from the GCP cloud service engines.
- After verification, delete the old cluster. The workflow for migration is illustrated below:
<Insert Image>
- Initiate Migration from LSC.
- Create a new Controller from the NSX Advanced Load Balancer Controller image for GCP. The new GCP Cloud is created on this controller. For more details, see GCP Full Access Deployment.
- Perform the following steps on the cluster where the LSC is running.
- Export the cluster configuration.
Login to the NSX Advanced Load Balancer shell.
Export the full system configuration using the following commands.
[admin:10-152-134-38]: > export configuration full_system recurse file old-config.json Please enter the passphrase to encrypt configuration: Retype passphrase: Downloaded the attachment to old-config.json Completed writing the export configuration to old-config.json
- Disable reconciliation of VIPs in the old cluster with the LSC cloud. This is required to prevent the LSC cloud from deleting the GCP routes that will be created by the new GCP Cloud.
Login to the NSX Advanced Load Balancer shell.
Disable reconcile in the Controller properties as shown below:
[admin:10-152-134-38]: > configure controller properties [admin:10-152-134-38]: controllerproperties> no cloud_reconcile [admin:10-152-134-38]: controllerproperties> save
Copy this exported configuration file (old-config.json) to the new Controller.
- Configure the GCP Cloud: Perform the following steps on the new cluster where the new GCP cloud will be created.
- Create the GCP cloud with the required configuration.
- Configure the SE groups for this cloud.
Configure the size of the SEs (flavor or CPU, memory configuration) and the HA mode.
Retain the count and the names of the SE groups as it is in the LSC.
- If the exported configuration is of a version less than the required version, update the configuration using the commands shown below:
$ export DJANGO_SETTINGS_MODULE=portal.settings_full $ export PYTHONPATH=/opt/avi/python/lib:/opt/avi/python/bin/portal $ python /opt/avi/python/bin/upgrade/config_migrator.py --config-file old-config.json --output-file new-config.json
- Copy the updated configuration file to the machine from where the script will be executed to clone the virtual services and the dependent object from the LSC on the old Controller to the GCP cloud on the new Controller. If there is any configuration that is not backward compatible, fix the errors and proceed.Some examples of issues where configuration changes are required, are as below:
Error
Resolution
{"error": "Virtual Service advertisement is not allowed on public clouds."}
Set enable_rhi to
False
for all the virtual services.{"error": "Disable port translation is set in pool. Health monitor System-TCP must specify a monitor port."}
Configure the monitor_port for all the health monitors that have the use_service_port field enabled.
{"error": "Cannot enable Request Queuing for L4 Service pool"}
Set request_queue_enabled to
False
for all the L4 Service Pools.
- Cloning the Virtual Service: Run the following steps on a Linux machine.
- Install the following pip requirements for the clone script to run.
$ sudo pip install networkx==2.2 avisdk==18.2.6 eventlet==0.25.1 ipaddress==1.0.22 urllib3==1.25.3
- Clone the github.com/avinetworks/devops repository.
git clone http://github.com/avinetworks/devops cd devops/gcp/scripts
- Run the script passing the new updated configuration file, the new Controller details, the LSC name and the GCP cloud name.
$ python lsc_to_gcp_cloud_migration.py --from-cloud old-lsc-cloud --to-cloud new-gcp-cloud --controller 10.152.134.15 \ --password avi123$% --config-file new-config.json
Note:Run the script for all the clouds.
- Install the following pip requirements for the clone script to run.
Results
The NSX Advanced Load Balancer objects are migrated to the GCP cloud.