#cd e:/Interim Framework/
#sh new\ 3.bash
#删除快照
#vmrun-t ws deletesnapshot "f:/interim Architecture/templating Machine" VM11
#进入虚拟机安装位置 (where Vmrun.exe is located)
CD c:/' program Files (x86) '/vmware/' VMware VIX '
#关闭虚拟机
Vmrun-t ws Stop "f:/Interim Architecture/template machine/template machine. VMX"
Sleep 10
#给虚拟机创建快照, named Vm11
Vmrun-t ws Snapshot "f:/Interim architecture/template machine/template machine. VMX" VM11
#利用for循环, bulk cloning of virtual machines (connection clones)
For i in ' seq 5 ';
Do
Vmrun.exe-t ws clone "f:/Interim Architecture/template machine/template machine. VMX" f:/vms-2018/$i/$i. VMX linked-snapshot=vm11-clonename= $i;
Done
#利用for循环, batch turn on virtual machines
For i in ' seq 5 ';
Do
Vmrun.exe-t ws start f:/vms-2018/$i/$i. VMX
Ping-n 127.0.0.1 >nul;
Done
#利用for循环, bulk shutdown of virtual machines
#for i in ' seq 5 ';
#do
#vmrun. exe-t ws Stop f:/vms-2018/$i/$i. VMX
#ping-N-127.0.0.1 >nul;
#done
Create VMware virtual machines in batches with Git-bash