Score:2

Proxmox VM dependencies and startup order

by flag

I have a Proxmox node running multiple services.

Each service consists of multiple VM's, for example, reverse proxy, database and application server. Some VM's within a service depend on other VM's of this service: the application server depends on the database server.

The different services do not depend on each other and are unrelated.

Sometimes I need to restart all VM's for a single service. I can do this manually and then I need to know the correct order to shutdown and restart the VM's.

It would be nice if I could explicitly configure dependencies between VM's that belong to a single service. And restart all VM's in a service, in the correct order, automatically, without touching VM's for other services running on the same node.

Can I do this with Proxmox?

I know I can allocate VM's to a resource pool but I think this is more for permissions. I know I can set a start order but I think this for is for restarting the entire node.

Score:2
za flag

Proxmox doesn't support any dependency tracking between VMs. And honestly, it shouldn't. All it allows is a simple ordering and staggering, so all VMs won't try to start simultaneously, to protect a shared storage from overloading by huge burst of I/O which happens during VM startup.

Anyway, what you actually want to track is that service B running in the VM2 is started after service A running in the VM1, no matter what. Not VMs should be dependent, but services inside them. You need a proper cluster resource manager to do that. This way, even if some VM breaks or slow to initialize for any reason, you are still safe, because services will start/stop in a correct order. You can set up e.g. Pacemaker cluster inside those VMs and implement service dependencies and constraints whichever you want.

Update:

Quoting the Proxmox VE High Availability manual page:

In general, a HA managed resource should not depend on other resources.

HA managed resource in terms of Proxmox VE is the VM or container, so well, they seem to explicitly declare that inter-VM dependencies are not supported and won't be supported in foreseeable future.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.