start:setup_vm
description:set up vm environment
cmd:var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`;echo $var;if [ "__GETNODEATTR($$CN,arch)__" != "ppc64"  -a  "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p;if [[ "$var" = "phy" ]]; then mkvm $$CN;exit $? ; elif  [[ "$var" = "dir" ]];then mkvm $$CN ; rmvm $$CN -f -p ; mkvm $$CN -s 20G ;exit $? ;elif [ "$var" = "nfs" -o "$var" = "lvm" ];then echo  "Need to fix me. ";exit 2;else echo "Could not surpport vmstorage.";exit 3;fi;fi
check:rc==0
cmd:rpower $$CN on
check:rc==0
cmd:rpower $$CN stat
check:output=~on
cmd:var=`expr substr "__GETNODEATTR($$SN,vmstorage)__" 1 3`;echo $var;if [ "__GETNODEATTR($$SN,arch)__" != "ppc64"  -a  "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then rmvm $$SN -f -p;if [[ "$var" = "phy" ]]; then mkvm $$SN;exit $? ; elif  [[ "$var" = "dir" ]];then mkvm $$SN ; rmvm $$SN -f -p ; mkvm $$SN -s 20G ;exit $? ;elif [ "$var" = "nfs" -o "$var" = "lvm" ];then echo  "Need to fix me. ";exit 2;else echo "Could not surpport vmstorage.";exit 3;fi;fi
check:rc==0
cmd:rpower $$SN on
check:rc==0
cmd:rpower $$SN stat
check:output=~on
#Add for debug rmvm issue
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a  "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then tabdump -w node==$$CN kvm_nodedata; fi
check:rc==0
cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a  "__GETNODEATTR($$SN,mgt)__" != "ipmi" ]; then tabdump -w node==$$SN kvm_nodedata; fi
check:rc==0
end
