How to change or keep UUID of the Virtual Machine

1

Hello Everyone,

Today we will look at how to change or keep UUID of the Virtual Machine in the VMware world.

I recently came across an issue when a user had lost access to an entire LUN and the datastore was unmounted in vSphere.

On further investigation, we found that the storage array was not supported by VMware and requested the user to check if there was a way that he could restore the  LUN data on a supported array.

Finally, after restoring the data the next step was present the LUN and create datastore out of it, which we did and we could see the Virtual Machine files.

First, we had to remove the old VMs from inventory as we had identical VMs now available on a new datastore and were ready to be added to the inventory.

Enough of the background, now let me get to the actual topic of changing or keeping the UUID of the Virtual Machine.

Each virtual machine is automatically assigned a universally unique identifier (UUID), which is stored in the SMBIOS system information descriptor.

The UUID is a 128-bit integer. The 16 bytes of this value are separated by spaces, except for a dash between the eighth and ninth hexadecimal pairs. A sample UUID looks like this:

56 4d ef 2d 3f d4 14 e2-2e 04 c5 34 3a ec ee 65

This UUID is generated when you power ON or reset the Virtual Machine. As long as the VM is not copied or moved to another location, this UUID does not change.

Now, in our case, we did not move the VM files to a new LUN and created a datastore on it, so the UUID would change.

The task was to keep the UUID the same as there was a backup application that was dependent on the UUIDs of the VMs.

Backup tools like Veeam and others make use of the UUID of the VM to uniquely identify the objects within inventory.

As mentioned before, when we tried to power ON the VM, we were presented with question as seen below:

Question (id = 0) : msg.uuid.altered:This virtual machine might have been moved or copied.
In order to configure certain management and networking features, VMware ESX needs to know if this virtual machine was moved or copied.
If you don't know, answer "I copied it".
  • Cancel
  • I moved it
  • I copied it

How to change or keep UUID of the Virtual Machine

If you choose to keep to the UUID of the Virtual machine, you need to select the second option (I moved it) to keep the UUID of the VM.

If you wish to change/create a new UUID for the VM, select the third option (I copied it) and power ON the VM.

We could also perform this step by editing the vmx file of the VM before powering on the VM and adding the line below to either change or keep UUID of the Virtual Machine.

Open the vmx file of the VM using the vi editor and add the below line to change the UUID.

uuid.action = "create"

To keep the UUID, add the below line.

uuid.action = "keep"

I hope this has been informative and thank you for reading!

Share.

About Author

I am Adil Arif, working as a Senior Technical Support Engineer at Rubrik as well as an independent blogger and founder of Enterprise Daddy. In my current role, I am supporting infrastructure related to Windows and VMware datacenters.

1 Comment

  1. Can the uuid.location be changed?

    I can only seem to change the bios uuid. When I change the location uuid it always reverts back.

    Any ideas?

Leave A Reply