Virtualization Pro

Feb 13 2009   7:47PM GMT

Monitoring VMware snapshot deletion progress



Posted by: Eric Siebert
Tags:
Eric Siebert
ESX
Snapshots
VMware

A recent KnowledgeBase article from VMware describes a method to monitor the snapshot deletion process which can take a long time if the snapshot has been active for a while.

When you delete snapshots using the VMware Infrastructure Client, the taskbar that displays the deletion progress immediately jumps to 95% and stays at 95%  the snapshot is entirely deleted. The taskbar does not show any progress while the delta files are being merged back into the original .vmdk file. Additionally, vCenter Server has a default 15 minute task timeout, so if the snapshot deletion task takes longer then 15 minutes it will timeout in vCenter Server even though it is still running on the host server.

The method in the KnowledgeBase article uses an ESX service console command to perform a directory listing on .vmdk files, so you can see their modified times changing and that the delta.vmdk files disappear after the snapshots are deleted. Here is the command from the knowledgebase article:

watch "ls -lhut --time-style=full-iso *.vmdk"

The way the syntax is currently published, however, is incorrect. Is it missing the double-dash before the time-style option; hopefully VMware will correct this soon.

Let’s go over what the command does. The watch command runs a command repeatedly and displays its output every 2 seconds. The command that watch is running in the previous sequence is the ls command, which lists file information in the directory. The options used with the ls command are –lhut, which are individual options that are all grouped together and are listed below:

• -l – use long listing format which displays more information
• -h – display file sizes in human-readable form (i.e. GB instead of bytes)
• -u – when used with –lt sorts and shows files by access time
• -t – sorts by modification time

Additionally the -–time-style option set to full-iso shows the modified time in longer form with seconds, and the final *.vmdk option tells the ls command to only display .vmdk virtual disk files.

While this command works I modified it a bit to drop the group/owner information (-og instead of –l) from being displayed, so the results fits better on the screen.  I also tweaked it to use the shorter –-fulltime parameter instead.

watch “ls –oghut –-full-time *.vmdk”

To use the command, log in to the VMware service console, go to your VM’s directory where the snapshot files are located, and run the command. A listing of the files will be displayed along with size and modification information as shown below:

watch output while snapshot is running

Once you see the –delta.vmdk files disappear you will know that the snapshot has been deleted, as shown below:

watch output after snapshot has been deleted

To stop the command from running just press ‘.’ While you will probably not use this method when deleting smaller snapshots, it is useful for larger ones that can take quite a while to delete.

2  Comments on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • DonNWH
    Eric, We don't use snapshots extensively in our environment, but I see them increasing in the future. Therefore, how do I execute this command on ESXi hosts? Is the watch command a part of the VIMA appliance? Thanks, Don Whittaker
    0 pointsBadges:
    report
  • Eric Siebert
    That command may work on an ESXi host using the hidden technical support console as the ls command works there but I'm not sure if the watch command does. Not sure on VIMA either, I'll dig around and see if I can find an ESXi equivalent.
    1,215 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: