Start VM after a specific LXC start

Vittorio

Well-Known Member
Jul 24, 2019
79
5
48
59
Hi all

Is it possible to start a VM after starting a specific LXC that has also a startup delay?

Actually I have set up the VM as start order 3 and a couple of container as start order 1 and 2 and a startup delay of 90 sec each

But the VM start as soon as the first container start.

Is there a way to do it?

Thanks
 
Actually I have set up the VM as start order 3 and a couple of container as start order 1 and 2 and a startup delay of 90 sec each
The VM then should only start after 180 seconds. Strange that this isn't the case for you.
Is it possible to start a VM after starting a specific LXC that has also a startup delay?
You could script something using hook scripts.
 
Where can I find info regarding hook scripts?

What can I assume is that startup delays works only between VMs or LXCs, not between both.
So if I have more than one VM, it respects the orders and delay, same in LXCs.

Thanks
 
Where can I find info regarding hook scripts?
Isn't well documented. Search this forum for "hook script" and have a look at the example script: https://git.proxmox.com/?p=pve-docs.git;a=blob;f=examples/guest-example-hookscript.pl;hb=HEAD

So you could edit the exampel script to something like...
Code:
elsif ($phase eq 'post-start') {

     # Second phase 'post-start' will be executed after the guest
     # successfully started.

     print "$vmid started successfully.\n";
     # wait 120 seconds and start VM with VMID 200 after LXC with VMID 100 has finished starting    
     if ($vmid eq '100') {
         sleep 120
         qm start 200
     }

 }
 
Last edited:
  • Like
Reactions: Vittorio

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!