reboot multiple lxc on multiple nodes via ansible at the same time

guestfish

Member
Feb 6, 2021
27
4
8
Hi there,

I am using ansible to control and configure proxmox cluster. When restarting multiple lxc on multiple nodes its doing one by one not at the same time. Is it possible for ansible to reboot multiple lxc at the same time? Not sure its right forum to ask ansible question but thanks in advance.
 
Technically from the Proxmox VE side this is possible. How ansible does it, is another thing.
 
Run pct start in multiple shells or use the API to start them one after another.

pct start will wait until the container started while an API call will give you the ID of the task that was created without waiting for it to finish. See https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/lxc/{vmid}/status/start for the API call.

It also shows you how you need to call pvesh (the internal API client for the CLI). You will need to fill in the node name and container VMID.