VMware Cloud Community
AndreyGorokhov
Contributor
Contributor

How to remove snapshot files?

Hello!

i have a problem:

i removed snapshot from vSphere client but snapshot files still in VM folder and i cannot create new snapshots... so how to remove this snapshot files???

thanks in advance

Reply
0 Kudos
10 Replies
Cooldude09
Commander
Commander

login to comment prompt

type vmware-cmd -l

locate the vmx file location of the vm for which u want to delete the snapshots

once you do that

type this

vmware-cmd -v /vfs/volumes/path of vmx of VM removesnapshots.

you can do the same through the GUI as well...

hope this helps

If U find my answer useful, feel free to give points by clicking Helpful or Correct.

Subscribe yourself at walkonblock.com

Reply
0 Kudos
AndreyGorokhov
Contributor
Contributor

yes, i think it's a goot direction... but i have ESXi... and i forgor how this tool calls... for ESXi. Smiley Happy

Reply
0 Kudos
Cooldude09
Commander
Commander

u can use vcli for the same..

i would recommend u to use GUI in this case....but make sure u pull out a backup of the VM (cloning etc) before u play with snapshots....

If U find my answer useful, feel free to give points by clicking Helpful or Correct.

Subscribe yourself at walkonblock.com

Reply
0 Kudos
AndreyGorokhov
Contributor
Contributor

i tryed to do this and its looks like all snapshots removed!

~ # vim-cmd vmsvc/getallvms
Vmid       Name                              File                                                      Guest OS                       Version   Annotation
144    r1002kncr          [Main Datastore] r1002kncr/r1002kncr.vmx                 winNetStandardGuest       vmx-07
16     rusbw002_test    [Main Datastore] rusbw002_test/rusbw002_test.vmx   slesGuest                        vmx-07
32     kl00pcws           [Main Datastore] kl00pcws/kl00pcws.vmx                   winXPProGuest                vmx-07
96     Winback            [Main Datastore] Winback/Winback.vmx                    slesGuest                        vmx-07    Winback
~ # vim-cmd vmsvc/snapshot.removeall 16
Remove All Snapshots:
~ #

but in VM folder still no changes... Smiley Sad

/vmfs/volumes/5d57c4f3-ca3cf76a/rusbw002_test # ls
rusbw002_test-000001-delta.vmdk    rusbw002_test-flat.vmdk            rusbw002_test.vmxf                 rusbw002_test_2-000001-delta.vmdk  vmware-2.log
rusbw002_test-000001.vmdk          rusbw002_test.nvram                rusbw002_test_1-000001-delta.vmdk  rusbw002_test_2-000001.vmdk        vmware-3.log
rusbw002_test-Snapshot73.vmsn      rusbw002_test.vmdk                 rusbw002_test_1-000001.vmdk        rusbw002_test_2-flat.vmdk          vmware-4.log
rusbw002_test-aux.xml              rusbw002_test.vmsd                 rusbw002_test_1-flat.vmdk          rusbw002_test_2.vmdk               vmware-5.log
rusbw002_test-aux.xml.tmp          rusbw002_test.vmx                  rusbw002_test_1.vmdk               vmware-1.log                       vmware.log

Reply
0 Kudos
AndreyGorokhov
Contributor
Contributor

From GUI... do you mean vSphere Client?

Reply
0 Kudos
Cooldude09
Commander
Commander

yes

If U find my answer useful, feel free to give points by clicking Helpful or Correct.

Subscribe yourself at walkonblock.com

Reply
0 Kudos
AndreyGorokhov
Contributor
Contributor

there are no snapshots in GUI... vSphere Client don't see this snapshot...

Reply
0 Kudos
Cooldude09
Commander
Commander

try this

vim-cmd vmsvc/snapshot.get [VMID]

You see an output similar to:

Get Snapshot:
|-ROOT
--Snapshot Name        : Test
--Snapshot Desciption  :
--Snapshot Created On  : 8/27/2009 13:49:55
--Snapshot State       : powered on

vim-cmd vmsvc/snapshot.create [VmId] [snapshotName]

Run this command and try to remove all snapshots again:

vim-cmd vmsvc/snapshot.removeall [VmId]

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

hope this works

If U find my answer useful, feel free to give points by clicking Helpful or Correct.

Subscribe yourself at walkonblock.com

Reply
0 Kudos
AndreyGorokhov
Contributor
Contributor

i have tryed it. no luck... files still not removed.

i using ghettoVCB script for backup and its not working now... something do not let this script to make new snapshots...

Reply
0 Kudos
opbz
Hot Shot
Hot Shot

are the snapshots still in use?

If you look at the vm settings and the disks does it mention one of the snapshot files?

If it does not then you should be able to manually delete them. but before you do this check to ensure that the parentCID of the vmdk file is all f's

if it shows that you are using a snapshot then you will need to run the vmkfstools -i to consolidate the snapshots.

you can use it directly from the ESXi server you need to login into server and get to console (you might need to enable it)

then run

vmkfstools -i /vmfs/volumes/datstore-name/vm-name/snapshot.vmdk newdisk.vmdk

this will consolidate the vmdks and create a new disk file called newdisk.vmdk you will need to remove remove disks and add new disks to the VM use customer mode and point it to the newdisk.vmdk you created.

power on vm if it works you can then manually delete the snapshot vmdks and other vmdks that are not being used from the vm folder

good luck

Reply
0 Kudos