quick deploy of VMs from – linked clones from 1 base disk

test_list.txt needs the names.

for i in `cat /tmp/test_list.txt`

do mkdir /vmfs/volumes/46a50aa4-65c3bb7e-d6d2-0014221878f9/$i; cp /tmp/sample.vmx $i/$i.vmx

echo “displayName = $i”>> /vmfs/volumes/46a50aa4-65c3bb7e-d6d2-0014221878f9/$i/$i.vmx

vmware-cmd -s register /vmfs/volumes/46a50aa4-65c3bb7e-d6d2-0014221878f9/$i/$i.vmx

vmware-cmd /vmfs/volumes/46a50aa4-65c3bb7e-d6d2-0014221878f9/$i/$i.vmx createsnapshot $i “linked clone to gold disk- DO NOT DELETE VM\!”;done

So in this case here, I have all of the names of the VMs I wanted in test_list.txt. I have a copy of /tmp/sample.vmx – it’s just a basic vmx file with the UUIDs, etc removed, so it would generate a new one. I then give the name of the vmx, the display name, register the VM, and create a snapshot, so that powering up and using the VM won’t mess up all of my other VMs that use the same underlying vmdk.