VMware Cloud Community
saariko
Contributor
Contributor

Deleted snapshots - disk space not recovered

I have had a machine where all of the snapshots were deleted.

The Machine has 1 10GB hard disk, but as you can see, it has vmdk files that I think need not be there.

How do I recover that space?

Reply
0 Kudos
25 Replies
idle-jam
Immortal
Immortal

just ensure that the snapshot are full deleted, and if it's still there i would suggest doing a clone or storage vmotion which would combine everything into a single VMDK. this is one of the easiest way.

Reply
0 Kudos
saariko
Contributor
Contributor

Thanks for the quick response.

I don't have Vmotion, and not sure why I need to clone.

However, the reason I deleted these snapshots is due the fact that I only have 15GB left on the VM machine.

snap115.jpg

so I don't think I can clone.

Also, there are no snapshots available. *see

snap116.jpg

Can I just delete any of these VMDK files?

Reply
0 Kudos
pauljawood
Enthusiast
Enthusiast

Hi,

Can you please list the number of snaps that you have under the folder for the VM. If you clone or vMotion the machine it should consolidate the space back to one file.

If you found this helpful then please leave some points.
Reply
0 Kudos
saariko
Contributor
Contributor

@pauljawood thanks, but not sure what you are asking for.

I have listed both the datastore files under the machine, and also the list of snapshots (empty one).

I shutdown the machine, and booted it up, but it didn't free up the space.

I only have 1 VM machine, no sphere or other enterprise admin machine.

Reply
0 Kudos
a_p_
Leadership
Leadership

Sometimes the snapshot manager does not show all snapshots. There may be several reasons for this. However, assuming your base disk is thick provisioned and you have only 1 snapshot file in the datastore, create another snapshot and then use the "Delete All" button to consolidate the snapshots. This will remove/consolidate all snapshots to the base vmdk. In ESX 3.5 it may happen that you get a timeout in the GUI if the consolidation takes a long time. Don't worry about this, just let ESX finish its work.

André

Reply
0 Kudos
saariko
Contributor
Contributor

Hi ap

I tried that solution, I had a 3rd vmdk, I than deleted all snapshots (was only one there)

but still, the previous 10gigs are still there, uncounted for.

I will appreciate any help by any member.

thanks

Reply
0 Kudos
a_p_
Leadership
Leadership

That's strange. After you created a new snapshot, you should have seen 5 vmdk files, 2 for the first disk and 3 for the second disk.

Please attach the latest vmware.log as well as the vmsd file to your next post?

André

Reply
0 Kudos
saariko
Contributor
Contributor

Here is the log

Reply
0 Kudos
ankitnarchal
Enthusiast
Enthusiast

Hi Saariko,

Sometimes what happens if, even if yo try to delete the snapshot, you will still find all the snapshot vmdks in the VM folder. this happens due to the reason that the snapshot metadata gets corrupt or the chai mismatch happens.

you can try recreating the snapshot and then check the snaapshot manager but there is no gurantee that it will list p all the snapshots or would align the snapshot chain. Inorder to get the data back and consolidate all the snapshots to the base disk, the recommended tested and tried option would be to clone the VM either from the VC or you can run the clone commands from ES console itself.

Now, cloning from the VC wll not require VM to power off but if you will try to clone it via command line then you need to have VMpowered off as it needs a lock on the VMDK that you need to clone.

I would recommend to try cloning it using VC UI first and if it fails then you can try cloning it from command line.

Commands:

vmkfstools -v  3 -i <path to the snapshot vmdk file which you want to clone and it should be the path to the vmdk and not the snapshot delta> <path to the new location where you want to create the clone>

Eg: you have a VM with one disk name test.The snapshot file will have 0000##.vmdk/0000##-delta.vmdk as extension. If this VM is residing on datastore1 and you want to clone it to datastore2

Files: test.vmx, test.vmdk, test-00000#.vmdk, test-0000#-delta.vmdk

The the command would be:

vmkfstools -v 3 -i /vmfs/volumes/datastore1/test/test-00000#.vmdk /vmfs/volumes/datastore2/<new folder name or can be the same folder name>/test_clone.vmdk

this will clone the disk test with one snapshot and will consolidate the data of the snapshot to the base disk then yo can either attach the cloned disk from the same location or you can copy this disk to the original VM location and delete the old one and attach it to the VM.

Reply
0 Kudos
a_p_
Leadership
Leadership

Sorry, I had my head on another issue when writing the last post. You should have seen 3 vmdk files (not 5) since you only have one virtual disk.

For the log file, please attach the vmware31.log file since this is the one which I think should show the creation and the commit of the snapshot you created.

André

Reply
0 Kudos
saariko
Contributor
Contributor

Hi ap,

Here is the vmare31 log.

@ankitnarchal thanks, but I don't have VC, and I don't access my VM to the console. I do all from the GUI.

Reply
0 Kudos
ankitnarchal
Enthusiast
Enthusiast

Okie, so you can clone the disk via console and then define the destination same as source, just change the name of the converted file.

Reply
0 Kudos
a_p_
Leadership
Leadership

Now it becomes really strange.

From your logfiles, it appears that "BASE - XP Pro SP2-000001.vmdk" is no snapshot, but the base disk. It points to the "BASE - XP Pro SP2-000001-flat.vmdk" file!? The "BASE - XP Pro SP2.vmdk" as well as the "BASE - XP Pro SP2-flat.vmdk"are not mentioned at all in the logs.

It looks like that at some point someone has "worked" on this VM manually. Without access to the console (local or ssh) I don't see a chance to clean this up.

What I would need to see are the descriptor/header vmdk files of all the virtual disks. Each virtual disk consists of two files the header file (vmname.vmdk) as well as the data file (either vmname-flat.vmdk or vmname-00000x-delta.vmdk), however in the datastore browser they are displayed as one file.

André

Reply
0 Kudos
saariko
Contributor
Contributor

Thanks.

Can you tell me how to give you that information please?

Can I delete any of these files to make space than?

Saar

Reply
0 Kudos
a_p_
Leadership
Leadership

Can you tell me how to give you that information please?

logon to the console of the ESXi host (or through ssh session):

change to the VM's folder: cd /vmfs/volumes/4847ea89-ac84d779-1942-001d09674fdb/WebServices/XP Worker 2

list all vmdk files: ls -lais *.vmdk

What I need are all the vmdk header files (the ones only a few bytes in size)

Can I delete any of these files to make space than?

If it turns out that the "BASE - XP Pro SP2-000001.vmdk" file is the base file in use, then you may delete the "BASE - XP Pro SP2.vmdk" file. Maybe better, first move it to another folder (while the VM is powered off), then try to start the VM. If it runs without issues then the "BASE - XP Pro SP2.vmdk" isn't needed.

André

Reply
0 Kudos
DSTAVERT
Immortal
Immortal

André

The original post shows a worker1 worker2 worker3. Since this looks odd is it possible that someone set up a linked clone. It would perhaps explain the base disk.

-- David -- VMware Communities Moderator
Reply
0 Kudos
malaysiavm
Expert
Expert

http://malaysiavm.com/blog/manual-commit-snapshots-delta-file-to-vmdk-flat-file/

If you plan to rebuild the corrupted chain and manual commit the snapshot, try to read my previous post, this should able to help you.

Regards,

Craig

http://malaysiavm.com

vExpert 2009 & 2010

Netapp NCIE, NCDA

Craig vExpert 2009 & 2010 Netapp NCIE, NCDA 8.0.1 Malaysia VMware Communities - http://www.malaysiavm.com
Reply
0 Kudos
a_p_
Leadership
Leadership

David,

thanks for the hint. Maybe the OP can shed some light on the configuration of the Worker VMs.

However, I still do not know why the 000001 vmdk file points to a flat file rather than to a delta file!?

André

Reply
0 Kudos
ankitnarchal
Enthusiast
Enthusiast

I totaly agree with the previous post because the snapshot file wold always have two files.. test-00001.vmdk and test-000001-delta.vmdk but in the vmware log file that you have uploaded there is no delta file, rather the snapshot file looks like a bae disk.

"DSCPTR: Opened [0]: "BASE - XP Pro SP2-000001-flat.vmdk" (0xa)
Dec 15 12:10:21.811: vmx| DISKLIB-LINK  : Opened '/vmfs/volumes/4847ea89-ac84d779-1942-001d09674fdb/WebServices/XP Worker 2/BASE - XP Pro SP2-000001.vmdk' (0xa): vmfs, 20971520 sectors / 10240 Mb."

Every VM without any snapshot will have one descriptor file "test.vmdk" and actual data file "test-flat.vmdk". If you have snapshots then vmname-00000#.vmdk and vmname-00000#-delta.vmdk.

Can you upload the VM vmx file and screenshot of the vmfolder. please make sure that the screenshot should include all the files with complete name in that VM folder.

Reply
0 Kudos