VMware ESXi 5 VM reset stuck at 95%

Hi folks,
Ivailo here to talk about a problem I had few days ago. While I was working on a customer’s server running a VM on ESXi 5.0, the VM froze so I had to forcibly reset it. When I did so, the reset task got stuck at 95%. I did some digging and found few threads talking about the same issue but they were all for ESXi 4. I had to do some additional research and modify the commands in order to make them work on ESXi 5. Bellow are the steps that resolved my problem:

  1. With vSphere Client, connect to the host or the VC server that controls the host.
  2. Click on the host and go to the Configuration tab.
  3. Click on Security Profile.
  4. Click on Properties in the Services table.
  5. Start ESXi Shell and SSH services.
  6. Open a SSH session to the host.
  7. Execute /sbin/services.sh restart. This will restart all agents. The vSphere Client or the vCenter server will lose connection to the host. Reconnect! The VM may show as (invalid).
  8. Find the PID of the process by typing ps|grep “<VMName>”. The second number before the name of the VM is the PID.
  9. Kill the process by typing kill -9 <PID>.
  10. Go to /vmfs/volumes/<DataStoreName>/<VMName>.
  11. Delete the swap file by typing rm –r <SwappFileName.vswp>
  12. In vSphere Client right click the VM and select Remove From Inventory.
  13. Browse the data store, open the VM folder, right click on the .vmx file and select Add to Inventory.
  14. Power On the VM.

Hope this helps.

Ivailo Mitkov