KVM “live migration finished” detection

kvm-virtualizationlibvirtvirtualization

I'm using KVM (through libvirt actually) for a research project. We're live-migrating a virtual machine between different subnets, so after the migration the IP address and routing tables have to be updated, else the VM is unreachable in it's new subnet. The goal is to do this as fast as possible.

Currently I'm using ssh over a link-local IPv6 address to connect to the VM after the live migration. Then it runs a script that assigns the new IP address and gateway. But this adds a lot of unnecessary overhead.

What I'd like to have is a way for a daemon on the virtual machine to detect that a live migration just finished. Are there any hooks I can use?

Best Answer

If you were doing guest vlan tagging you'd see that change and could script it that way. Alternatively you could use a highly-port-assigned DHCP server on both/all VLANs, with the same MAC listed in multiple scopes, you could then just trigger the refresh on vlan change.