Customize live migration to Unplug/Plug VM network interface?

epers

New Member
Dec 17, 2016
1
0
1
Hi,
Is it possible to somehow modify the qm migrate command to unplug/plug the vm's network interfaces when it cuts over to the other host?

I have a 3-node test cluster that I'm playing with routing to the vm on, and I currently have a handful of windows and linux vm's setup with a static /32 on a loopback interface and dhcp on eth0. Currently only using one linux switch on each node, but I plan to switch to openvswitch with vlans to further segment services when I move this into prod.
Using rip I announce routes to these /32's via the vm's dhcp lease to a vyos vm that runs on each node, and then the vyos summarizes those routes and sends them to the top of rack switches and out to the rest of the network using ospf.
This all works well and good, clients can access the vm's via the /32 address, everything plays nice together until I migrate a vm to another node. Because that node has a different subnet that's now attached to the vm's eth0, and because the eth0 stays connected when the vm cuts over to the other host, the vm doesn't know that it needs to acquire a new address on eth0 so it can advertise the loopback. If I can have qm migrate unplug/plug the vm's network device when it cuts over to the target node then I can configure the guest os to re-acquire dhcp and re-announce routes after that happens

Thanks!
 

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!