How do i start all stopped CTs that have ONBOOT=1 set over ssh?

harvie

Well-Known Member
Apr 5, 2017
137
22
58
34
Hello,
i often run in situation, where i have proxmox with some CTs not running (because i've stopped them). And from all these stopped CTs i want to start only those who have onboot=1 configutation while leaving the rest stopped. Is there way to do this using pct commandline?
 
Hi,
Is there way to do this using pct commandline?
With pct you can give just one argument, but there is another way to do that with API or CLI [0][1], put your CTs you want to onboot[2] than in API or CLI you can call startall to beginning

Example:
* To start
pvesh create /nodes/{node}/startall
* To stop
pvesh create /nodes/{node}/stoptall

[0] Startall: https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/startall
[1] Stopall: https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/stopall
[2] https://pve.proxmox.com/pve-docs/pct-plain.html#pct_startup_and_shutdown
 
Cool! this did the trick:

pvesh create /nodes/mynode/startall

I've noticed i can even do this:

pvesh create /nodes/localhost/startall

Is there some wildcard to apply to all nodes in cluster? Something like pvesh create /nodes/ALL/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!