VMs unable to power on/off due to unclean shutdown
search cancel

VMs unable to power on/off due to unclean shutdown

book

Article ID: 391910

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • VMs are not able to be powered on or off advising the operation can not be ran on the current status.
  • VMs Remote console is not accessible and power status reported as unknown (VCD)

Environment

vCenter 7.x

vCenter 8.x

VCD

Cause

VMs are in an inconsistent status due to improper shutdown of the VMs resulting in still existing worlds, temporary files and locks on a non-running VM.

Resolution

  • List all VMs on ESXi host to gather required details for any affected VM
    • On the host where the VMs are registered run:
      • esxcli vm process list
  • For each affected VM take note of their WORLD-ID and Full path.
  • On the ESX host web Unregister the VM by right clicking on the VM and selecting Unregister.
  • Select the Datastore where the VM files are located and browse to and select the VM folder so you have the VMs VMX file easily accessible to use after the next steps.
  • Back on the ESXi SSH session kill the VM world for each affected VM running:
    • esxcli vm process kill --type= force --world-id= WorldNumber
  • Move all of the VM temporary files to a temporary location (in case this has to be reverted)

    • cd '/vmfs/volumes/<datastore>/<VM_name>'
    • mkdir temp
    • mv *.lck ./temp
    • mv *.vmx~ ./temp
    • mv *.nvram ./temp
    • mv *.vswp ./temp
  • To re-register VM on host go back to the ESXi Web UI where the VM folder was left open on the datastore before we then right click on the VMX and select Register, the VM should now be able to be powered on and resume normal operation (will not work from the ESXi host directly when using resource groups, please test directly on VCD or vCenter).

Additional Information