[PVE-User] PVE - guest shutdown w/ node shutdown behavior ?
vom513
vom513 at gmail.com
Mon May 27 16:35:44 CEST 2024
Hello all,
I’m trying to confirm what this behavior is. That is, when a host node shuts down, how are the guests shutdown ? Specifically in relation to any guests that don’t have the agent installed.
My understanding is that PVE will do the following in this order:
Shutdown guest via agent … timeout
else
Shutdown guest via ACPI … timeout
else
Hard power-off
In systemd pve-guests.service this is ran upon stop:
ExecStop=/usr/bin/pvesh --nooutput create /nodes/localhost/stopall
I also think I found the code where the 3 possibilities mentioned above happens:
qemu-server/PVE/QemuServer.pm:
eval {
if ($shutdown) {
if (defined($conf) && get_qga_key($conf, 'enabled')) {
mon_cmd($vmid, "guest-shutdown", timeout => $timeout);
} else {
mon_cmd($vmid, "system_powerdown");
}
} else {
mon_cmd($vmid, "quit");
}
};
I could be off base here, please let me know.
If that is the guest shutdown logic, does the “get_qga_key” check mean it’s checking that this is enabled in options (i.e. checkbox) or that it’s actually running ?
Is “system_powerdown” the ACPI method ? It seems like that only gets called if the agent is enabled in config ?
Is “quit” the hard poweroff ?
So what about a guest that the agent option is checked but doesn’t have the agent installed ?
Sorry if any of this is unclear, I’m trying my best to articulate my questions here.
Thanks.
More information about the pve-user
mailing list