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.
 

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!