Azure Cluster VIP Configuration
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:
- Initial Configuration
- Handling Failover
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).
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:
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.
Setup a control script.
On Avi UI, navigate to Templates > Scripts > ControlScripts and click Create. Enter the following text in the dialog box.
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.
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.