Migrating to GCP Cloud

Overview

This article shows how to clone all the virtual services, pools, health monitors, etc. that are currently operating on Linux Server Cloud (LSC) to a GCP cloud.

Prerequisites

  1. Set up a new GCP Controller of Avi Vantage version 18.2.6.
    Note: The updates in Avi Vantage version 18.2.6 can be patched to any 18.2.x release.
  2. Disable cloud_reconcile for the LSC cloud cluster. This is to avoid any interruption to the cloned virtual services due to the reconcile run by the Avi cloud connector.

Steps for Migrating to LSC Cloud

  1. Create a new 18.2.6 version of Avi Controller cluster in GCP with the Avi Controller image for GCP.
  2. Create all the 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).
  3. The traffic from the clients will 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.
  4. 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.
  5. After verification, delete the old cluster.

The workflow for migration is as illustrated below: create role

Initiating Migration from LSC

  1. Create a new 18.2.6 Controller from the Avi Controller image for GCP. The new GCP Cloud will be created on this controller. Refer to the GCP Full Access Deployment Guide to know more.

  2. Execute the following steps on the cluster where the LSC is running.

    i. Export the cluster configuration.
    a) Login to the Avi shell.
    b) 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
    

    ii. Disable reconciliation of VIPs in the old cluster with the LSC cloud. This is required to prevent the LSC cloud deleting the GCP routes that will be created by the new GCP Cloud.
    a) Login to the Avi shell.
    b) 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
     

    iii. Copy this exported configuration file (old-config.json) to the new Controller.

Configuring the GCP Cloud

Execute the following steps on the new cluster where the new GCP cloud will be created.

  1. Create the GCP cloud with the required configuration.
  2. 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 in the LSC.
  3. If the exported configuration is of a version less than 18.2.6, update the configuration to 18.2.6 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
    
  4. 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

Execute the following steps on a Linux machine:

  1. 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
    
  2. Clone the github.com/avinetworks/devops repository.
    
     git clone http://github.com/avinetworks/devops
     cd devops/gcp/scripts
     
  3. 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.