Skip to content

Instantly share code, notes, and snippets.

@ccammilleri
Created January 25, 2018 01:23
Show Gist options
  • Save ccammilleri/6fd440727c3f815747ca7a9241777c25 to your computer and use it in GitHub Desktop.
Save ccammilleri/6fd440727c3f815747ca7a9241777c25 to your computer and use it in GitHub Desktop.
Take group snapshots for multiple xenserver VMs at once. Helpful for lab environments.
#! /bin/bash
#
# add vm uuid of machines you want to be added to the group snapshot
labvms=(
57f9803c-e350-d4fd-2091-215702341df9 #LAB-caldera
8165e1ee-ec65-36c8-c87a-ae94019df08b #LAB-exchange
58138ed5-feb9-46f6-33a7-11102c9a1a7f #LAB-dc01
)
for x in ${labvms[@]};do
LABEL="[groupsnap] $1"
xe vm-snapshot new-name-label="$LABEL" vm=$x
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment