Proxmox on dedibox (scaleway) : ip failover

pierremartins507

New Member
Mar 9, 2021
5
0
1
54
Hi All,

I have installed Proxmox on 3 servers Dedibox. THe 3 servers are RPNv2 configured.

I have created a VM Linux with IP Failover.

How I can switch dynamicaly the Ip failover when the VM switch on another server ?

Thank for your help

Pierre.
 
I've written some scripts for this. First, you have to download https://git.fws.fr/fws/ansible-roles/src/branch/master/roles/pve/files/pve-online in /usr/local/bin/pve-online with exec permissions
Then, put https://git.fws.fr/fws/ansible-roles/src/branch/master/roles/pve/files/online_hook.pl in the snippet dir of one of your storage. Either on a shared storage (like NFS) or just copy it on a non shared storage on every node, it doesn't matter (for example in /var/lib/vz/snippet on every node)
Then create /etc/pve-online.conf with
Code:
[general]
online_api = XXXXXXXX
wan_bridge = vmbr1
migrate_flush_arp = no

Note : vmbr1 is a bridge dedicated to WAN connectivity. You can configure it in /etc/network/interfaces like this :
Code:
auto eno1
iface eno1 inet static
  address 195.154.25.76
  netmask 255.255.255.0
  gateway 195.154.25.1
  post-up sysctl -w net.ipv4.conf.eno1.proxy_arp=1
  post-up sysctl -w net.ipv4.conf.eno1.forwarding=1

auto vmbr1
iface vmbr1 inet manual
  bridge-ports none
  bridge-stp off
  bridge-fd 0
  hwaddress b2:57:f3:69:70:7c
  post-up sysctl -w net.ipv4.conf.vmbr1.proxy_arp=1
  post-up sysctl -w net.ipv4.conf.vmbr1.forwarding=1

With this setup, you connect your VM to vmbr1 and do not have to worry about the MAC address, as your PVE will handle ARP proxying. OK now you're nearly done. You just have to add the hook to your VM. Edit /etc/pve/qemu-server/XXX.conf to add the hook, and to declarer the failover IP which should be migrated with the VM
Code:
# Just declare the failover IP this VM will use using the following syntaxe :
# ipfo1: 10.11.12.14
# ipfo2: 21.22.23.24
hookscript: local:snippets/online_hook.pl

With all this in place, you can migrate the VM from one node to another, and the hook script will handle IP failover migration through the Online.net API. The network outage during a migration should only last 10 or 20 sec.

Hope it helps
 
I no longuer work in this company and sadly, it looks like my former employer decided to close access to all the repos.
 
Last edited by a moderator:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!