How to change the UUID of a VM via the PowerCLI

In vCloud director it may be necessary to deploy an identical vApp, when this happens everything is identical (including UUID’s), to help vSM differentiate the VMs changing the UUID may help.

$date = get-date -format “dd hh mm ss”

$newUuid = “56 4d 50 2e 9e df e5 e4-a7 f4 21 3b ” + $date

$spec = New-Object VMware.Vim.VirtualMachineConfigSpec

$spec.uuid = $newUuid

$vm = get-vm <VM Name>

echo “VM: ” $VM.name “New UUID: ” $newuuid

$vm.Extensiondata.ReconfigVM_Task($spec)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: