Skip to content

Instantly share code, notes, and snippets.

@littlegeek88
littlegeek88 / Libvirt-Start-VMs-In-Order-Instructions.md
Created January 26, 2023 15:26 — forked from cyberang3l/Libvirt-Start-VMs-In-Order-Instructions.md
Necessary scripts and procedure to start libvirt VMs in a provided order, with an given delay before starting each subsequent VM.
  1. Ensure that your VMs can shutdown gracefully when the power-button is pressed.

  2. Place the file vm-boot-order.py in /opt directory

  3. Make it executable: chmod +x /opt/vm-boot-order.py

  4. Check that the script starts and shuts down your VMs as expected. The script can be executed as follows:

     /opt/vm-boot-order.py start
     /opt/vm-boot-order.py stop
     /opt/vm-boot-order.py status
    
  5. Make a systemd service to execute the script when booting or shutting down the hypervisor: