Virtual Machine might enter invalid state while performing install or update of VMware Tools post upgrading to ESXi 6.5 Patch 03
search cancel

Virtual Machine might enter invalid state while performing install or update of VMware Tools post upgrading to ESXi 6.5 Patch 03

book

Article ID: 318435

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
  • While upgrading the VMware tools, the VM enters into invalid state in the inventory
  • The hostd logs on the ESXi host where the VM is registered reports the below error:
hostd.log:
 
YYYY-MM-DDTHH:MM:SS info hostd [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/datastore/VM/VM.vmx opID=VmToolsActionResolver-applyOnMultiEntity-385841-ngc:70013658-e2-ff-e2e4 user=vpxuser:domain\user] State Transition (VM_STATE_ON -> VM_STATE_TOOLS_INSTALLING)
YYYY-MM-DDTHH:MM:SS info hostd [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/datastore/VM/VM.vmx opID=VmToolsActionResolver-applyOnMultiEntity-385841-ngc:70013658-e2-ff-e2e4 user=vpxuser:domain\user] State Transition (VM_STATE_TOOLS_INSTALLING -> VM_STATE_ON)
YYYY-MM-DDTHH:MM:SS info hostd [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/datastore/VM/VM.vmx] CacheDatastores: fileBacking [] /usr/lib/vmware/isoimages/windows.iso has null datastore reference
YYYY-MM-DDTHH:MM:SS info hostd [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/datastore/VM/VM.vmx] Marking VirtualMachine invalid
YYYY-MM-DDTHH:MM:SS info hostd [Originator@6876 sub=Vimsvc.ha-eventmgr] Event 1242 : Issue detected for VM on ESXi in ha-datacenter: Configuration file has unexpected changes. Virtual machine has been terminated. Unregister and re-register virtual machine if the configuration file is correct.
YYYY-MM-DDTHH:MM:SS info hostd [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/datastore/VM/VM.vmx] State Transition (VM_STATE_OFF -> VM_STATE_COMPROMISED)
YYYY-MM-DDTHH:MM:SS warning hostd [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/datastore/VM/VM.vmx] Failed to find activation record, event user unknown.


Environment

VMware vSphere ESXi 6.5
VMware vSphere ESXi 6.7

Cause

This is caused due to file paths for CDROM device being incorrectly marked as invalid when tools image is mounted.

Resolution

This issue is resolved in:

Workaround:
The workaround is only applicable for either of the below scenarios:
  • The current version is vSphere 6.5 Patch 03 and earlier than vSphere 6.5 Update 3.
  • The current version is earlier than vSphere 6.7 Update 2.

In order to modify the path for the CDROM on affected VMs, use either of the scripts attached to the article.
  • cdromV1.ps1 script will search for VMs potentially affected and reconfigure the CDROM with useAutoDetect to true
  • cdromV2.ps1 script will perform a similar operation but by setting the device name directly in the VMX file
Note: For further information on using PowerCLI, please refer to Install PowerCLI

Additional Information

Virtual machines appear as invalid or orphaned in vCenter Server

Attachments

cdromV2.ps1 get_app
cdromV1.ps1 get_app