Azure Cluster VIP Configuration

Overview

This document explains cluster virtual IP (VIP) configuration and management when a controller is deployed inside an Azure cloud. This involves the following two steps:

  1. Initial Configuration
  2. Handling Failover

Initial Configuration

The initial configuration is to be done manually. After configuring the Avi Controller cluster VIP, follow the steps provided in the Azure document to configure a secondary IP for Azure virtual machine (VM).

Handling Failover

If the leader of the node changes, then the VIP should be moved to the appropriate node. This is implemented using specific scripts. Follow the steps given below to facilitate automatic movement of cluster VIP when the leader of the node changes:

  1. Setup an Azure user credential with contributor privileges for controller VM.
    On Avi UI, navigate to Infrastructure > User Credentials and click Create to create the user credential.

    Step_1

  2. Setup a control script.
    On Avi UI, navigate to Templates > Scripts > ControlScripts and click Create. Enter the following text in the dialog box.

    #!usr/bin/python
    import subprocess
    import os
    my_env = os.environ.copy()
    my_env[‘PYTHONPATH’] = ‘/opt/avi/python/bin/cloud_connector:’+my_env[‘PYTHONPATH’]
    subprocess.Popen([‘python’, ‘/opt/avi/scripts/azure_cluster_vip.py’, ‘subscription_id’, ‘azure_credential_name’], env=my_env)

    Replace the subscription_id with Azure subscription_id of the host controller VM, and azure_credential_name with the name of the credential object created in the above step.

    Step_2

  3. Create alert action and alert config.
    On Avi UI, navigate to Operations > Alerts > Alert Actions and choose the script created in the above step for alert action.
    Navigate to Alert Config tab and click Create to create a new alert config. Under Event Occurs tab choose the following events:

    • Controller Leader Failover
    • Controller Node Joined
    • Controller Node Left

    You can add a new event by clicking on + Add New Event.

    Step_3