#!/bin/bash
# get list of VMs on the node
VMIDs=$(qm list| awk '/[0-9]/ {print $1}')
# ask them to shutdown
for VM in $VMIDs
do
qm shutdown $VM
done
#wait until they're done (and down)
for VM in $VMIDs
do
while [[ $(qm status $VM) =~ running ]] ; do
sleep 1
done
done
##...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.