haswitch is a Linux high availability tool to manage VM synchronization in a RAID 10 environment (machine-to-machine). Its primary goal is to switch LXC virtual machines onto LVM + DRBD. Its secondary goal is to manage the network coming with virtual machines then it manages iptables and bridges. haswitch also supports OVH's failover API which allow to switch failover ip during the migration.
sudo npm install -g haswitch
Start all resources
Stop ha0 resource
haswitch start ha0
Start VM vm1ha0 on ha0 resource
haswitch start ha0 vm1ha0
Stop VM vm1ha0 on ha0 without execution
haswitch -e stop ha0 vm1ha0
sudo apt-get install lxc lxc-templates wget bridge-utils
Disable the default bridge “lxcbr0“, got created as part of LXC installation.
sudo nano /etc/default/lxc-net
Set “USE_LXC_BRIDGE” to “false“.
I suggest you to follow the guide from Zarafa:
The DRBD resource name must have the same name as a haswitch resource.
Edit your /etc/haswitch.json and add:
Customer Key will come after running the credential checker.
haswitch ovh auth
A validation URL will be given You will have to follow it in order to activate the application. Once you have done that you will have the customer key:
Now you have to activate OVH failover on the LXC container
Once you have configured you can check the OVH's failover status:
haswitch ovh check
To redirect all failover IP in every resources on Me (see ovh.me):
haswitch ovh failover
Or for a specific resource:
haswitch ovh failover ha0