Updating the Configuration Following Avi Controller IP Address Change

The management IP addresses of each Avi Controller node should be static. This applies to single-node deployments and 3-node deployments.

The cluster configuration and runtime configuration each contain the IP information for the cluster. If the IP address of a leader or follower node changes (for example, due to DHCP), this script must be run to update the IP information. The cluster will not function properly until the cluster configuration is updated.

If the IP address of an Avi Controller node is changed for any reason (such as DHCP), the following script must be used to update the cluster configuration. This applies to single-node deployments as well as cluster deployments.

To repair the cluster configuration after an Avi Controller node’s IP address is changed, run the change_ip.py script.

The script is located in the following directory /opt/avi/python/bin/cluster_mgr/change_ip.py.

Note1: The change IP script only changes the Avi cluster configuration. It does not change the IP address of the host or the virtual machine on which Controller services are running. For example, it does not update the /etc/network/interfaces file in a VMware-hosted Controller. One must change the IP address for the VM in the vApp properties in VMware.

Note2: Special consideration is required when changing the IP addresses of Controllers in a bare-metal configuration. Refer to the How to change Controller IP addresses in a bare-metal environment article.

Script Options

Note: Before running the script, check to make sure new IPs are working on all nodes and are reachable across nodes. If one or more IPs are not accessible, the script makes a best-effort update, but upon restoring connectivity there is no guarantee the cluster will be back in sync.

The script can be run on the Avi Controller node whose management IP address changed, or on another Avi Controller node within the same cluster.

The script must be run on one of the nodes that is in the cluster. If the script is run on a node that is not in the cluster, the script will fail.

-i ipaddr Specifies the new IP address of the node on which the script is run.

-o ipaddr Specifies the IP address of another node in the cluster.

-m subnet-mask If the subnet also changed, use this option to specify the new subnet. Enter the mask in the following format: 255.255.255.0

-g gateway-ipaddr If the default gateway also changed, use this option to specify the new gateway.

Note: The -m and -g options apply to all IP addresses in the cluster.

Updating IP Information for a Single-node Deployment

To update Avi Controller IP information for a single-node deployment, use a command string such as the following:

*change_ip.py -i **ipaddr*

Example: This command is run on node 10.10.25.81. Since no other nodes are specified, this is assumed to be a single-node cluster (just this Avi Controller).

change_ip.py -i 10.10.25.81

In the following example, the node’s default gateway also has changed:

change_ip.py -i 10.10.25.81 -g 10.10.10.1

Updating IP Information for an Avi Controller Cluster

Note: Before executing change_ip.py, ensure all new IPs are reachable from one another over SSH ports (22 for regular, 5098 for containers).

To update Avi Controller IP information for a cluster, use a command string such as the following:

change_ip.py -i **ipaddr **-o ipaddr -o ipaddr

Example:

change_ip.py -i 10.10.25.81 -o 10.10.25.82 -o 10.10.25.83

This command is run on node 10.10.25.81, which is a member of a 3-node cluster that also contains nodes 10.10.25.82 and 10.10.25.83.

The script can be run on any of the nodes in the cluster. The following example is run on node 10.10.25.82:

change_ip.py -i 10.10.25.82 -o 10.10.25.81 -o 10.10.25.83

Note: After executing change_ip.py, in case of failure, use recover.py to convert nodes to single nodes and create the 3-node cluster again. This is documented in the Recover a Non-Operational Controller Cluster article.

To verify all is well, go to the Controller nodes page and ensure all nodes are CLUSTER_ACTIVE.

Additional Information

How to Change Controller IP addresses in a Bare-metal Environment