Solved

Cleaning up VMDK files

Posted on 2009-07-08
6
1,821 Views
Last Modified: 2012-05-07
I'm running tight on space on a ESX box that has 2 virtual servers running, I had some snapshots but when I tried to clean them down the box frooze for a very long time and needed a reboot, now my snapshot manager only shows 1 snapshot on each server but one server still has 000001.vmdk, 000002.vmdk and 000004.vmdk as per screen shot attached.

Can I clear down these files without causing any issues?
vmdk-issue.JPG
0
Comment
Question by:ggntt
6 Comments
 
LVL 19

Expert Comment

by:deroode
Comment Utility
First, check your .vmx to see if these files don't belong to the VM.

After verifying that you can move them to a different directory. If they are still in use (e.g. they are still snapshot files of some sort) you will not be able to move them because they are in use.
If you can move them, and your VM's don't suffer then you can delete them.
0
 

Author Comment

by:ggntt
Comment Utility
Thanks deroode, I checked the VMX file and no mention of 2 of those files, I was able to move them without impacting the vm, but I can't delete them from teh new folder, when I try and delete I get General failure error.
0
 
LVL 42

Expert Comment

by:paulsolov
Comment Utility
Per VMware support if you have issues cleaning up snapshots the easiest workaround is to use vConverter to do a V2V which will consolidate the VM for you and you can delete the source VM once you're done.  

I've had this happen multiple times and this is an easy fix for it.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 10

Expert Comment

by:dnilson
Comment Utility
One way to prevent this from happening is to not reboot while removing snapshots.

Removing snapshopts from the GUI instead of the commandline is problematic.  If you keep the snapshot just long enough to test a change (a few hours)no big deal, but if you are removing days of snapshot the GUI simply will not wait for the OS to finish before it gives up and says "failed".

DONT BELIEVE IT.

The snapshot is still being incorported back into the base disk, and I've sen this take 8-9 hours on occasion, bu left alone, it finishes and does a proper cleanup.

Rebooting while this is happeneing, especially on some SANS can render the files undeletable, or worse.

The best way to remove snapshots is from a putty session using the Commandline tools from VMware.  That way you can simply watch for the command to end, long after VI/VC has given up and proclaimed a failure.

A good script to remove ALL snapshots o na host is:

time vmware-cmd -l | while read x; do printf "$x"; vmware-cmd "$x" removesnapshots; done

0
 
LVL 8

Expert Comment

by:JT92677
Comment Utility
How about cloning the machine to a new subdirectory. It moves only the needed files and leaves out all the unnecessary snapshots. Then use the cloned machine, and delete the original?

Or am I missing something?  I use clone a lot to clean up directories once a machine is stable and in a state I want to save.

Jeff
0
 
LVL 1

Accepted Solution

by:
ionut19 earned 500 total points
Comment Utility
i had the same issue in the past, what you can do to clean them is delete all the snapshots, if the operation times out you should created a new snapshot and then commit all snapshots to disk again. This is from vmware technical support

also take a look at this:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1014249
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Teach the user how to use configure the vCenter Server storage filters Open vSphere Web Client:  Navigate to vCenter Server Advanced Settings: Add the four vCenter Server storage filters: Review the advanced settings: Modify the values of the four v…
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now