This gist provides a way to automatically move an associated Elastic IP between nodes of a cluster in case of failover. This is because the standard VIP infrastructure provided by VRRP is not necessarily transparently compatible with Ravello's public IP/NAT routing, so the private VIP is not routable.
- As explained in Ravello's Blog, configure a couple of Highly Available Load Balancers using Keepalived (check this blog article if in doubt).
- Make sure to enable cloud-init on the VM and configure your VM to export the environment variables described below according to your setup.
- Make sure you have
python
installed and install theravello-take-elastic-ip.py
script in such a way the keepalived daemon can execute it. - Configure your
keepalived.conf
to invoke theravello-take-elastic-ip.py
when the node takes over asMASTER
.
Executing the following line in one of the nodes by hand should allow you to switch the Elastic IP between the nodes:
RAVELLO_CREDENTIALS="<[email protected]>:<password>" \
RAVELLO_EVIP="<ip-address>" \
RAVELLO_VM_JSON=/etc/ravello/vm.json \
./ravello-take-elastic-ip.py
You shoudl see output similar to the following:
VM FQDNS: <node-host-name>.srv.ravcloud.com
Querying application: 56131616 for current holder for EVIP: <ip-address>
- This VM: <this-vm-name>
- Master VM: <vm-that-currently-holds-the-elastic-ip>
*** Updating application to switch Elastic Virtual IP from "<original-vm-name>" to "<this-vm-name>" ***
- Done