migration behavior on post-stop-hooks on LXC vs KVM

hk@

Renowned Member
Feb 10, 2010
248
8
83
Vienna
kapper.net
We're currently relying on pre-start and post-stop hooks to basically configure the networking and routing for LXCs or KVMs.
During PVE7.3 tests for HA and migration automation we experience the quite unexpected thing:
The "loosing" PVE-node getting the LXC/KVM removed does execute the "post-stop" hook for LXCs.
Yet it is not being executed for KVMs.
I know there's been discussion around new-hooks at https://bugzilla.proxmox.com/show_bug.cgi?id=1996
my argument would be consistency to have to post-stop hook executed if indeed a virtual system has been stopped on this hardware (even if it vanished into thin air and incarnate live at another PVE-node at this moment)

thx
hk
 
Hi,
the difference is that containers are actually stopped before the migration happens, but VMs are live-migrated. For VMs, when the post-stop hook would need to be executed, the configuration file is already on the other node and I think that was the reason that it's not executed. Changing it now would be a breaking change, as users might already be relying on that behavior (of the hook not getting executed), so we could only do it for a major release. But I think the dedicated migration hook are the better approach.
 
Hi,
I take whatever hook we could get, I'd even take a start-stop-migration for KVM option in the HA management as with live we can not handle this issue in any way - and better to have a working networking-setup than a migrated KVM which is now offline for the world...
 
Also - and there I'd argue for consistency the pre-start is executed on migration, which if the argument would be "live migration" also probably shouldn't happen. Or - if the feature should not be changed by default which I'm all in favor of, give us an option to enable pre-start and post-stop for virtual systems so one can determine if or if not those hooks should be executed. The current system of executing hooks or not is in itself inconsistent imho.