#!/bin/bash
for i in {01..05}
do
vmname=`printf "LVW7%02d" $i`
#copy
#printf "xe vm-copy vm=L701 sr-uuid=53c4fd7f-d420-ee21-4ee3-18c01fd4ff19 new-name-label=$vmname \n" ;
#xe vm-copy vm=L701 sr-uuid=53c4fd7f-d420-ee21-4ee3-18c01fd4ff19 new-name-label=$vmname ;
#import
#printf "xe vm-import filename=template.xva \n" ;
#xe vm-import filename=template.xva ;
#clone
printf "xe vm-clone vm=L701_temp new-name-label=$vmname \n" ;
xe vm-clone vm=L701_temp new-name-label=$vmname ;
diskuuid=`xe vm-disk-list vm=$vmname | grep uuid | tail -1 | awk '{print $5}'` ;
printf "xe vdi-param-set uuid=$diskuuid name-label=$vmname\n";
xe vdi-param-set uuid=$diskuuid name-label=$vmname;
done
留言列表