How does one set up Proxmox to suspend on shutdown?

The Kaese

New Member
May 1, 2021
3
1
1
35
Like the title says. Basically I've got a script that will suspend all my VMs, but it looks like Proxmox will still tell them to shutdown if the server gets rebooted or shutdown.

Here's my scenario. I've got a UPS set up and tied to the Proxmox host such that it will execute the shutdown command if power is lost. I'd like to set it up such that instead of shutting down all my VMs, it suspends them to disk instead of shutting them down. Is this possible and if so, how does one accomplish this? Am I just missing this setting somewhere?
 
  • Like
Reactions: ams_tschoening
Like the title says. Basically I've got a script that will suspend all my VMs, but it looks like Proxmox will still tell them to shutdown if the server gets rebooted or shutdown.

Here's my scenario. I've got a UPS set up and tied to the Proxmox host such that it will execute the shutdown command if power is lost. I'd like to set it up such that instead of shutting down all my VMs, it suspends them to disk instead of shutting them down. Is this possible and if so, how does one accomplish this? Am I just missing this setting somewhere?
You have to hibernate the VM, in case of a script using the command line add "--todisk" to the suspend subcommand, e.g.
Code:
qm suspend 111 --todisk
 
@Richard,
I get that. My script works..the problem is that Proxmox still shuts down the VMs even though they are suspended, making the script a moot point. I'm looking for how to tell Proxmox to either a) use my script for shutdown commands, or b) suspend the VM on shutdown versus shutting it down.
 
Did you ever find a solution or workaround? There's another thread mentioning the systemd file "pve-manager.service", which contains the following lines:

Code:
[Service]
Environment="PVE_LOG_ID=pve-guests"
ExecStartPre=-/usr/share/pve-manager/helpers/pve-startall-delay
ExecStart=/usr/bin/pvesh --nooutput create /nodes/localhost/startall
ExecStop=-/usr/bin/vzdump -stop
ExecStop=/usr/bin/pvesh --nooutput create /nodes/localhost/stopall
Type=oneshot
RemainAfterExit=yes
TimeoutSec=infinity

So, if you don't take care of that service config, the configured events fire and stop/start VMs anyway. Depending on how you executed your own script, this might be executed in parallel or alike. Though, the referenced thread mentions that first executing custom hibernation and afterwards triggering a shutdown should work and leave VMs in an unlocked state.

I guess one needs to override that service with a custom "ExecStartPre" to hibernate all VMs? Or is there some setting to tell Proxmox what "stopall" actually is? In my case I would simply always prefer hibernation instead of shutdown, because the former always works, while the latter depends on the guest. VMware Workstation is taking that approach with shared VMs.
 
  • Like
Reactions: blackpaw
I've additionally found an official bug addressing this issue. the problem in my opinion: It only provides a workaround for custom hibernation like suggested in this thread already, but doesn't address making that available to Proxmox's own mechanisms when shutting down etc. At would be good to have at least documented somewhere what the correct approach is in the end.
 
Coming from a Hyper-V environment and being able to do this for well over a decade there, I was surprised to learn that this is not possible in Proxmox.

I know this is an old thread, but I am assuming that this still hasn't been implemented/fixed. Right?
 
Hello,

Bumping the thread as well.

Why is there no option "per vm" where one could choose "hibernate on shutdown" ? It sounds super simple to implement (all commands are available), and heavily requested, yet we keep on having to manually hibernate vms prior to shutting down.

I love Proxmox with passion and use it both personally and professionally, but seeing that Hyper-V and VMware allow this by design makes Proxmox a bit "behind" on this particular feature.

Maybe there is a catch that I do not see, but it just works when done manually, so I do not understand the lack of this feature.
 
Last edited:
  • Like
Reactions: Anchor
Hello,

Bumping the thread as well.

Also very surprised by the lack of this feature.

Hopefully it will be added as soon as possible.
 
use the windows funktion
hypernate on shutdown. get a GPO, force it to all servers, as you desire. the sky is the limit
type: powercfg /hibernate on and press enter to enable hibernation.
 
I think an option per VM, right under the "start at boot", with a "guest action on host shutdown" that defaults to "stop" but can be set to "hibernate/suspend", sounds more prudent than "all/none".
One could have some VMs that do not hibernate well, or that are not problematic to be stopped.
yes, there are several aspects
- generic "bulk suspend" and "bulk hibernate"
- adding hibernate as one of the maintenance options
- allowing a per-guest override for the global maintenance option
 
yes, there are several aspects
- generic "bulk suspend" and "bulk hibernate"
- adding hibernate as one of the maintenance options
- allowing a per-guest override for the global maintenance option
Any update about this feature?
 
bulk suspend exists nowadays, the others don't.
 
bulk suspend exists nowadays, the others don't.
I can't find instructions on how to do this. What is the procedure for suspending all instances? I need unplug my server and move it somewhere - I would like it to resume from its current state after I relocate it.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!