VMware Cloud Community
RoastChicken
Contributor
Contributor
Jump to solution

vSphere Delete VM Snapshot

Hello everyone,

I have a client with VMware ESXi 4.1.0 and vSphere Client 4.1.0 and there is one virtual machine, which is the DC, that has one snapshot taken, as you can see from the following screenshot:

vmware2.PNG

In snapshot manager I cannot see the snapshot:

vmware3.PNG

I need to delete this snapshot, and I really dont know how, I have tried to open solely the vmx file of this virtual machine in VMware Workstation to see if the snapshot manager finds any snapshot but from what I could see it does not.

Any ideia on how to solve this problem?

Thanks everyone!

Reply
0 Kudos
1 Solution

Accepted Solutions
RoastChicken
Contributor
Contributor
Jump to solution

Hi,

This is what worked for me.

Open putty and connect to your ESXi server. Navigate to the VM datastore and execute the following commands.

grep -i filename "vmNamevmx" | grep -i vmdk //gives the name of the vmdk currently in use for the VM

less "vmName-000001.vmdk" | egrep -i "cid|parentcid|vmdk" //check the CID and parent CID for each snapshot the parentCID of the first snapshot has to match the CID of the base vmdk. If you have a second snapshot its parentCID has to match the CID of first snapshot and so on. It it does not match, Use vi snapshotName.vmdk and edit.

Create a recover directory with enough free space.

vmkfstools -i "vmName-000001.vmdk" /vmfs/volumes/4d395e37-36b73cfa-17f4-00199997b746/recover/vmName_new.vmdk //Refer to the snapshot in use that you got from above, this will clone the virtual machine vmdk and consolidate all snapshots into one.

Thanks!

View solution in original post

Reply
0 Kudos
4 Replies
RoastChicken
Contributor
Contributor
Jump to solution

I have found a cmd to consolidate the snapshots. I have checked the CID and parentCID of the base vmdk and the 0001-delta.vmdk and they are a match.

My question is, do I really need to poweroff the VM in order to do this command?

vmkfstools -i "Windows SBS 2008-000001.vmdk" /vmfs/volumes/4d395e37-36b73cfa-17f4-00199997b746/sbsTeste/WindowsSBS2008_new.vmdk

Cheers

Reply
0 Kudos
wila
Immortal
Immortal
Jump to solution

Hello,

I moved your post from Workstation Pro to VMware ESXi 4 there's more likely vSphere users in this forum. Smiley Happy

Can't exactly remember the feature set on vSphere client with ESXi 4, but there's a "Consolidate" option nowadays under the Snapshot menu that should do this.

Another way people resolved this in the past was by adding an extra snapshot and then choosing for "delete all"

Best not to mess with vmkfstools command line on live VMs unless you are familiar and comfortable with it and yes the command you are listing does require a power off (it's the wrong command for committing snapshots too, you're doing a clone)

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
Reply
0 Kudos
RoastChicken
Contributor
Contributor
Jump to solution

Hi wila,

Thanks for moving my post to the right forum.

I have been searching the VMware knowledge base and I found this VMware KB: Consolidating snapshots in ESX/ESXi 3.x and 4.x that refers to this youtube video How to consolidate a snapshot in VMware ESX when there are virtual machine errors - YouTube

Are you sure it does not clone and consolidate?

PS: The parentCID of the delta 0001 matches the CID of the original vmdk.

Cheers

Reply
0 Kudos
RoastChicken
Contributor
Contributor
Jump to solution

Hi,

This is what worked for me.

Open putty and connect to your ESXi server. Navigate to the VM datastore and execute the following commands.

grep -i filename "vmNamevmx" | grep -i vmdk //gives the name of the vmdk currently in use for the VM

less "vmName-000001.vmdk" | egrep -i "cid|parentcid|vmdk" //check the CID and parent CID for each snapshot the parentCID of the first snapshot has to match the CID of the base vmdk. If you have a second snapshot its parentCID has to match the CID of first snapshot and so on. It it does not match, Use vi snapshotName.vmdk and edit.

Create a recover directory with enough free space.

vmkfstools -i "vmName-000001.vmdk" /vmfs/volumes/4d395e37-36b73cfa-17f4-00199997b746/recover/vmName_new.vmdk //Refer to the snapshot in use that you got from above, this will clone the virtual machine vmdk and consolidate all snapshots into one.

Thanks!

Reply
0 Kudos