How to check and set the disk.EnableUUID parameter from VM in vSphere for OpenShift Container Platform

Solution Verified - Updated

Environment

  • VMware vSphere 5.X & 6.X & 7.x
  • OpenShift Container Platform OCP 3.X & 4.X

Issue

The parameter disk.enableUUID is necessary so that the VMDK always presents a consistent UUID to the VM, thus allowing the disk to be mounted properly. For each of the virtual machine nodes that will be participating in the cluster, follow the steps below from the vSphere nodes:

[root@ocphost ~]# ./govc_linux_amd64 vm.info -json -vm.ip='redacted' | jq -r '.VirtualMachines[].Config.ExtraConfig[] | select(.Key=="disk.enableUUID")'
{
  "Key": "disk.enableUUID",
  "Value": "TRUE"
}

Resolution

In order to apply a change, it is needed the node VM path and the VM being offline:

govc ls /datacenter/vm/<vm-folder-name>

Once the VM path is gathered, set disk.enableUUID to TRUE for all VMs:

govc vm.change -e="disk.enableUUID=1" -vm='VM Path'

Once it is set, it can be verified in vmx file after it is booted up again.

Diagnostic Steps

Check for GOVC releases in the official repository and adapt the version as per the desired one. It is possible to find prebuilt govc binaries on the Content from github.com is not included.Official repository.
In order to retrieve the release desired, follow the example below:

$ curl -LO https://github.com/vmware/govmomi/releases/download/v0.21.0/govc_linux_amd64.gz
$ gunzip govc_linux_amd64.gz
$ chmod +x govc_linux_amd64
$ cp govc_linux_amd64 /usr/bin/govc

It is needed to export the following values in order to retrieve information

$ export GOVC_URL='vCenter IP OR FQDN' (URL of ESXi or vCenter instance to connect to.)
$ export GOVC_USERNAME='vCenter User'
$ export GOVC_PASSWORD='vCenter Password'
$ export GOVC_INSECURE=1 (InsecureSkipVerify controls whether a client verifies the server's certificate chain and host name: this value is recommended for secured environments)

Once the vSphere CLI is downloaded, it is possible to check the parameter disk.EnableUUID as per below example:

$ govc vm.info -json /Energy/vm/<FOLDER_NAME>/<VM_NAME> | jq -r '.VirtualMachines[].Config.ExtraConfig[] | select(.Key=="disk.enableUUID")'
SBR
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.