[SOLVED] -ish -- Shutdown all nodes via API

RickoT

Member
Jun 30, 2020
12
1
8
43
Greetings!

I am setting up NUT (Network UPS Tools) to shutdown my PVE servers in the event of a power outage. Right now I am using the API to shutdown each node individually, but I would prefer to tell the whole cluster to shut down all nodes all at once so VM's get shut down in the proper order regardless of which node they are on. is that possible? I did not see anything in the API document under cluster regarding this

here is the CURL command I am using for this :
curl -X POST -H 'Authorization: PVEAPIToken=<<TOKENDETAILS>> '\
"https://<<HOST>>/api2/json/nodes/$PVENode/status" --insecure --data "command=shutdown" &> /dev/null

Any help would be appreciated!

Thanks!
 
Hi,

AFAIK this is not possible. You're supposed to run the command for every node, exactly how you are doing it currently.

so VM's get shut down in the proper order regardless of which node they are on
This is unfortunaly not possible - the boot-order is only enforced locally, not cluster-wide. This is documented behavior.
So this wouldn't work anyway as you plan, if I understood you correctly.
 
Thanks for the reply, that's what I thought from reading the documentation, I just wanted to make sure I was understanding correctly and not missing something

Thanks for the confirmation!
 
  • Like
Reactions: cheiss

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!