How to change Controller IP addresses in a bare-metal environment


Special care must be taken when changing the IP addresses of Controllers running in a bare-metal (Docker) environment. This article contains directions to be followed in lieu of those present in Updating the Configuration Following Avi Controller IP Address Change.

Steps to Change Controller IPs

  1. Change the IP address of each Controller node within the cluster to the new IP by manually editing the network scripts on the host and changing the interface configuration.
  2. Ensure that the new Controller IP addresses are reachable in the network from the other Controller nodes.
  3. Edit the /etc/systemd/system/avicontroller.service or /usr/sbin/avicontroller file on each host running the Controller Docker container and overwrite the old Controller IP with the new Controller IP wherever applicable.

    For example, the long command line below contains the Controller IP in a sample /etc/systemd/system/avicontroller.service file.

    code>ExecStartPre=/usr/bin/docker run --name=avicontroller -m 48g --cpu-period=100000 --cpu-quota=2400000 -p 5098:5098 -p 8443:8443 -p 5054:5054 -p 80:80 -p 443:443 -p 161:161/udp -d --privileged -e "CONTAINER_NAME=avicontroller" -e "MANAGEMENT_IP=" -e NUM_CPU=24 -e NUM_MEMG=48 -e DISK_GB=30 -e CNTRL_SSH_PORT=5098 -e SYSINT_PORT=8443 -e HTTP_PORT=80 -e HTTPS_PORT=443 -v /:/hostroot/ -v /dev:/dev -v /var/run/docker.sock:/var/run/docker.sock -v /run/xtables.lock:/run/xtables.lock -v /opt/avi/controller/data:/vol/ avinetworks/controller:18.2.5-5116-20190708.063533</code>
  4. On each Controller host the administrator would run this trio of commands:
    systemctl daemon-relaod
    systemctl stop avicontroller
    systemctl start avicontroller
  5. Corresponding to the sample in step 3, on any one of the Controller containers, the administrator would run these commands:
    cd /opt/avi/python/bin
    python -i -o -o

    The Controller cluster should come back up with the new IPs.