VMWARE: ESXI REMOVE ALL SNAPSHOTS HANGS AT 99%

      Comments Off on VMWARE: ESXI REMOVE ALL SNAPSHOTS HANGS AT 99%

ESXI REMOVE ALL SNAPSHOTS HANGS AT 99%

Posted on May 23, 2014 by Rennie

Check and make sure that the process is actually stuck and not just taking a very long time.
To do this, follow these steps:

1. Make sure SSH service is running on the ESXi host

Navigate to configuration -> security profile -> services -> Click on Properties
esxi-services

Choose the ‘SSH’ service, ‘Options’, and click ‘Start’
esxi-ssh

Once SSH is enabled, connect to the ESXi host using your favorite ssh client.

2. Run -> vim-cmd vmsvc/getallvms
getallvms

Find the vmid of the virtual machine, in this case its 20.

3. Now run -> vim-cmd vmsvc/get.tasklist 20<- this is the # of the vm from above
gettasklist

4. Find the removeallsnapshots task # then run:

vim-cmd vimsvc/task_info 185720854 <-this # will be different for you

If you see:  “The object has already been deleted or has not been completely created” or similar, your snapshot removal is probably frozen, but in order to be sure, let’s look at the file sizes and make sure nothing is changing.

5. cd into the datastore where the vm is located.

The path is /vmfs/volumes/datastore-name/vm-name
(NOTE: tab-complete is your friend)

vmfs

6. Now Run ->  watch -d ‘ls -lut | grep -E “delta|flat|sesparse”‘
before-vpxa
Take notice on the file sizes and make sure they stay the same. If they are changing, the snapshot removal process is still working and I would just wait it out. Don’t risk data loss!

7. If the data file sizes doesn’t change for a long time ( 1-2 hours, just to be safe)
Restart the vpxa service on the ESXi host.
Configuration -> security profile -> services -> properties -> vpxa ->options ->restart
Note: You will lose connectivity with the host from vCenter, just reconnect after a minute.

8. Go back to the SSH terminal and re-run the command:
watch -d ‘ls -lut | grep -E “delta|flat|sesparse”‘
after-vpxa

You will eventually see the delta files disappear, and will be able to power on your vm with no snapshots present ! <![if !vml]>🙂<![endif]>