Well, all 3 VMs were deployed from the same vCD catalog VM. According to this VMware KB article, by default vCD keeps the same UUID value for cloned VM's. Since I did not have access to vCD to change the settings, the only choice was to actually modify the UUID of the VMs.
There are several ways of doing in it, from manual to programmatic (as can be seen in this KB article)
I've chosen PowerCLI variant. The steps are pretty straight forward:
- shutdown the VM
- get the current UUID
- change the UUID
- power on the VM
And the code to do it below. Do not forget to change the $newUuid (I used to modify the last digits from the current one).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | $vmName = "myClonedVm" $vm = Get-VM -Name $vmName $vm.extensiondata.config.uuid $newUuid = "00112233-4455-6677-8899-aabbccddeeff" $vm | Shutdown-VMGuest While ((Get-VM -Name $vmName).PowerState -ne "PoweredOff") { Write-Host -foreground yellow "... waiting for" $vmName "to power off" sleep 5 } $spec = New-Object VMware.Vim.VirtualMachineConfigSpec $spec.uuid = $newUuid $vm.Extensiondata.ReconfigVM_Task($spec) Start-VM -VM $vmName -RunAsync |
No comments:
Post a Comment