how to pause/suspends multiple VM for backup

Code:
for i in 101 {104..109} 117 121; do
qm suspend $i
done
for i in 101 {104..109} 117 121; do
qm snapshot $i
done
for i in 101 {104..109} 117 121; do
qm resume $i
done



Best regards,

G. Delanoy
 
Last edited:
  • Like
Reactions: UdoB
Code:
for i in 101 {104..109} 117 121; do
qm suspend $i
done
for i in 101 {104..109} 117 121; do
qm snapshot $i
done
for i in 101 {104..109} 117 121; do
qm resume $i
done



Best regards,

G. Delanoy
What if you want to stop all the multiple relevant VMs together in a specific order, back them up individually, then restart them in the reverse order?

ex. NAS storage OS drive, and a handful of other VMs that will fail catastrophically if they can't communicate with the NAS during that time that it's being backed up?

In that scenario, I would suspend all the VMs that require the NAS storage, then the NAS itself to perform the backup, and resume the NAS. Wait however many seconds, and bring the clients online after it's up and running

-- Edit --

I misread the code. It does look like it stops them all sequentially before moving on to backups sequentially, and then resumes sequentially. Looks like all I'd need is to add a wait time in between the first resume and the next
 
Last edited:
What if you want to stop all the multiple relevant VMs together in a specific order, back them up individually, then restart them in the reverse order?

ex. NAS storage OS drive, and a handful of other VMs that will fail catastrophically if they can't communicate with the NAS during that time that it's being backed up?

In that scenario, I would suspend all the VMs that require the NAS storage, then the NAS itself to perform the backup, and resume the NAS. Wait however many seconds, and bring the clients online after it's up and running

-- Edit --

I misread the code. It does look like it stops them all sequentially before moving on to backups sequentially, and then resumes sequentially. Looks like all I'd need is to add a wait time in between the first resume and the next
Hello,

You could also do it that way:

for i in 101 {104..109} 117 121; do # Your specific order here
qm suspend $i
vzdump $i --storage pbs-storage --mode snapshot --compress zstd && \
qm resume $i
done

... provided the storage 'pbs-storage' exists and points to your pbs, of course :)

Kind regards,


G. Delanoy