[PVE-User] PVE - guest shutdown w/ node shutdown behavior ?

Jan Vlach janus at volny.cz
Mon May 27 16:42:41 CEST 2024


Hi,

from my experience, you need dbus and qemu-guest agent for debian VMs and Guest Agent Enabled in VM options

OR

Guest Agent Disabled and then ACPI event gets sent inside the VM.

JV

> On 27. 5. 2024, at 16:35, vom513 <vom513 at gmail.com> wrote:
> 
> 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.
> 
> 
> _______________________________________________
> pve-user mailing list
> pve-user at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-user




More information about the pve-user mailing list