→ Applies to: Hyperion 9.x and above
This KB explains how to automatically start virtual machines on Syneto Hyperion in a specific order.
Step 1. Connect to SynetoOS appliance via SSH as admin
ssh admin@<your_ip_address_or_hostname>
Step 2. Become Super User
sudo su
Step 3. Disable autostart for all VMs ("How to enable/disable VMs autostart in Hyperion")
Step 4. Create /usr/local/bin/start-hyperion-vms.sh file
vi /usr/local/bin/start-hyperion-vms.sh
IMPORTANT
Make sure to copy and paste the exact lines below (replace <vm-name1>, <vm-name2> and <vm-name3> with the correct information)#!/bin/bash logger "Ordered VM startup: begin" # Ordered startup virsh start <vm-name1> logger "Started <vm-name1>" sleep 20 virsh start <vm-name2> logger "Started <vm-name2>" sleep 30 virsh start <vm-name3> logger "Started <vm-name3>" sleep 40 logger "Ordered VM startup: completed"
Save and EXIT
:wq
To add more virtual machines to the startup sequence, copy the following three lines, modifying the VM name e increasing the sleep duration by 10 seconds.virsh start <vm-name> logger "Started <vm-name>" sleep 50 These 3 lines should be placed between before the line logger "Ordered VM startup: completed".
Step 5. Make the script executable
chmod +x /usr/local/bin/start-hyperion-vms.sh
Step 6. Create /etc/systemd/system/hyperion-vms-autostart.service file
vi /etc/systemd/system/hyperion-vms-autostart.service
IMPORTANT
Make sure to copy and paste the exact lines below[Unit] Description=Ordered KVM virtual machine startup After=network.target libvirtd.service Requires=libvirtd.service [Service] Type=oneshot ExecStart=/usr/local/bin/start-hyperion-vms.sh RemainAfterExit=true [Install] WantedBy=multi-user.target
Save and EXIT
:wq
Step 7. Reload systemd
systemctl daemon-reexec
systemctl daemon-reload
systemctl enable hyperion-vms-autostart.service
systemctl start hyperion-vms-autostart.service