Inhibit All VM's from starting at boot for troubleshooting purposes... Possible???

Sounds like a different road to get to the same thing , which is not bad. The goal would be to not have guests start on reboot. I'm dealing with a drive error that I want to make sure is fixed before I restart any guests. I had just wanted to pass back to Darkhand thanks for the script. Masking the systemd unit is a good idea as well, as is disabling the storage.

Thanks!
 
I’ll give you one simpler solution. I don’t know where I‘ve got it from but I wrote it down:



Independent of the feature request I'd propose a ways simpler workaround for you:

Simply mask the service that is responsible for starting the on-boot marked guests. IOW, before the reboot for maintenance execute:

systemctl mask pve-guests.service

Then after all maintenance is done

systemctl unmask pve-guests.service

As that would be a simple and already available solution, I'd be inclined to avoid the small, but not negligible, additional complexity of implementing a special boolean setting for this, would that be acceptable for you?

That's a clean solution but there should be a "Maintainance Mode" button in the frontend to activate it.
 
Simply mask the service that is responsible for starting the on-boot marked guests. IOW, before the reboot for maintenance execute:

systemctl mask pve-guests.service

Be aware, that with the: pve-guests.service being masked, running guests will not get gracefully shut down anymore on host-reboot/-shutdown, but instead get hard stopped/killed: [1].
So, after masking the: pve-guests.service, one has to / should manually (bulk) shutdown all guests before the host-reboot/-shutdown.

[1] https://bugzilla.proxmox.com/show_bug.cgi?id=4492#c2
 
Last edited:
Would a disable --now not do the trick and stop and disable the service? Does it need to be masked? Apologies if this is obvious and I did not even try it.
 
All pve-guests.service does is call /usr/bin/pvesh with `--nooutput create /nodes/localhost/startall`

pvesh is a wrapper script that calls the proxmox api startall method

So basically all we need to do is add a "Maintainance Mode" button in the frontend, somehow save the state (for example a lock file under /etc/pve/maintainance-mode.lock, this way it's automatically synchronized with the cluster)

Then on api startall action if the flag is set do nothing

https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/startall
 

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!