#!/bin/bash if [ -z "$1" ]; then echo "You have to enter a VM counter to enable." echo "" echo "Example: counter_on runstate_full_contention" exit 1 fi OIFS=$IFS; IFS=","; declare -a vmlist=(`xe vm-list params=name-label,uuid is-a-snapshot=false is-a-template=false is-control-domain=false power-state=running --minimal`) echo "${#vmlist[@]} VMs to update..." for ((i=0; i<${#vmlist[@]}; i++)); do xe vm-data-source-record data-source=$1 uuid=${vmlist[i]}; echo "$((i+1)) on"; done IFS=$OIFS;