Reboot the VM by shutting it down, and starting it again. Applies pending changes.
When I execute “qm reboot 100” and it doesn’t trigger a reboot, the vm displays “Shutting down” instead of "Restarting".Not sure what your question is, but this is expected behaviour for that command as per: https://pve.proxmox.com/pve-docs/qm.1.html
It's like "acpi shutdown" and then starting up again. Are you looking for a "hard reboot"?
When I execute “qm reboot 100” and it doesn’t trigger a reboot, the vm displays “Shutting down” instead of "Restarting".
Thank you for your response. “Shutting down” will cause the Spice connection to disconnect. I need the status to be “Restarting” to ensure that the Spice connection remains active.So I am no expert on Windows guests, but I would suspect you can only get the "restarting" when you restart from within the OS. The qm command tells it to shut down (gracefully) and then goes on to start it up (which the guest OS cannot know in advance).
What is your concern about any (?) difference in the resulting freshly started guest OS after such command?
Thank you for your response. “Shutting down” will cause the Spice connection to disconnect. I need the status to be “Restarting” to ensure that the Spice connection remains active.
I believe you will need to instead execute a command using the QEMU guess tools. First, make sure the QEMU guest agent is installed (following the instructions from the wiki) and then run something like this:Thank you for your response. “Shutting down” will cause the Spice connection to disconnect. I need the status to be “Restarting” to ensure that the Spice connection remains active.
qemu guest exec <VM_ID> -- shutdown \/r
. Note that it might not be necessary to escape the /r
flag. I don't have a Windows VM to test with unfortunately.qemu guest exec
command executes the given command via the guest agent, according to the manpages.qm guest exec <VM_ID> C:\WINDOWS\SYSTEM32\CMD.EXE /c "shutdown /r"
Thanks for your reply.This should be a great method.I believe you will need to instead execute a command using the QEMU guess tools. First, make sure the QEMU guest agent is installed (following the instructions from the wiki) and then run something like this:qemu guest exec <VM_ID> -- shutdown \/r
. Note that it might not be necessary to escape the/r
flag. I don't have a Windows VM to test with unfortunately.
Theqemu guest exec
command executes the given command via the guest agent, according to the manpages.
EDIT: OK, I found an old thread and they used a similar command:
qm guest exec <VM_ID> C:\WINDOWS\SYSTEM32\CMD.EXE /c "shutdown /r"