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

harvie

Well-Known Member
Apr 5, 2017
138
24
58
35
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 ?