VMware Cloud Community
VirtualNewbie1
Enthusiast
Enthusiast

Multiple old snapshots

Hello,

We have a VMWare Vsphere environment 5.5V. Recently I have observed that for one of the Virtual Machines , there are multiple snapshots lying around in its directory.

This could be done from old admins. I am no expert in VMWare hence I would like to ask what can I do in order to remove those snapshots. I read some docs and it says its not a good

policy to retain snapshots for a longer time. But I also happen to read some posts where the process snapshot deletion got stuck and created problems. Which I certainly in any case avoid as this is the important server. And importantly we do not have any VM Backup policy in place so far.

Kindly give some hints/suggestions in this case.

Thanx.

Regards,

Admin

14 Replies
daphnissov
Immortal
Immortal

First of all, you must back up your VMs, especially VMs that have had very old snapshots. Second, try to delete the snapshots through the vSphere client (or web client). If it doesn't succeed, you may need to try other methods and determine why it's failing, but start there. Backup VM, then remove snapshots.

Reply
0 Kudos
VirtualNewbie1
Enthusiast
Enthusiast

I have another post open , in which I am trying to find backup option available if one does not have proper licenses.

Reply
0 Kudos
VirtualNewbie1
Enthusiast
Enthusiast

If I may start with Vsphere client to delete the snapshots. What is the correct procedure. Should I directly delete all the snapshots in place?

Reply
0 Kudos
daphnissov
Immortal
Immortal

Go to the VM in question and delete all snapshots from the client. Do not attempt to manually remove any snapshot files from the datastore browser view.

Reply
0 Kudos
VirtualNewbie1
Enthusiast
Enthusiast

Ok and it should take care of all the syncing between latest snapshot copy and original disk  I believe.

Reply
0 Kudos
daphnissov
Immortal
Immortal

If you delete all, yes, and not revert. Again, I recommend you have a full image backup of this VM before proceeding.

Reply
0 Kudos
dekoshal
Hot Shot
Hot Shot

I think you should start with identifying which vmdk (delta or flat) the virtual machine is mapped to.

If its delta file you can run the command (mentioned below)  where "vmdk name" is the disk file name identified mapped to the virtual machine

vmkfstools -q <vmdk name> -v10

and

vmkfstools -e <vmdk name>

This will help you narrow down if there are any left over snapshot which are not in snapshot chain and can safely be removed. if number of snapshot are not more then 32 you can remove it from

vSphere client or web client. Otherwise a more complex approach is required where batch or 30 snapshot are consolidated at a time.

If you found this or any other answer helpful, please consider the use of the Correct or Helpful to award points.

Best Regards,

Deepak Koshal

CNE|CLA|CWMA|VCP4|VCP5|CCAH

Reply
0 Kudos
VirtualNewbie1
Enthusiast
Enthusiast

Thanks for your reply. 

I think you should start with identifying which vmdk (delta or flat) the virtual machine is mapped to.

How do I do it ? How can one identify which VMDK , the VM is mapped to.

Reply
0 Kudos
dekoshal
Hot Shot
Hot Shot

Open Edit setting of the virtual machine and select the virtual disk on the left hand side and check the file name of the top right hand side.

vmdk of the delta file will have multiple 0's  included in the file name.

If you found this or any other answer helpful, please consider the use of the Correct or Helpful to award points.

Best Regards,

Deepak Koshal

CNE|CLA|CWMA|VCP4|VCP5|CCAH

a_p_
Leadership
Leadership

Whether it is safe to delete snapshots, mainly depends on the free disk space on the datastore, and whether the VM's virtual disks are thin, or thick provisioned.

In order to be able to help, please let me know how much free disk space you currently have on the datastore, and post a complete list of files in the VM's folder, i.e. the output of ls -lisa from the command line. If you are not familiar with using the command line, you may alternatively provide a screenshot of the Datastore Browser, which shows all files including sizes, time stamps, ...

André

Reply
0 Kudos
Nahida123
Contributor
Contributor

Yes you can delete all. Just that Your VM will remain in current state. Also you can check all list of snapshot and present state where it is. If you want to delete particular  snapshot you should be careful if you have nested snapshots.

Reply
0 Kudos
VirtualNewbie1
Enthusiast
Enthusiast

Thanks Andre for your response. As requested please find below the information,

1. The virtual disks (2) are thin provisioned each 100 GB.

apacheserver/apacheserver-000011.vmdk

apacheserver/apacheserver_1-000005.vmdk

2. Free space :  ( The VMs Datastore is created on a NFS Share and has enough free space.)

~ # df -k

Filesystem  1k-blocks      Used  Available Use% Mounted on

NFS        3486515200 451416684 3035098516  13% /vmfs/volumes/Remoteshare

3. Contents of VM :-

/vmfs/volumes/apacheserver # ls -lisa

total 117149308

19383      8 drwxr-xr-x    1 root     root          8192 Aug 29 06:54 .

     64      4 drwxr-xr-x    1 root     root          4096 Sep 20 06:39 ..

  31364      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-0025000000000000

  29150      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-0225000000000000

  31363      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-382c000000000000

  29149      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-3a2c000000000000

  29151      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-6117000000000000

  31360      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-7a7a000000000000

  31368      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-7b65000000000000

  31372      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-7c7a000000000000

  31365      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-8e50000000000000

  30096      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-8e75000000000000

  30098      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-9175000000000000

  30104      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-9775000000000000

  31362      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-b93b000000000000

  31371      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-ba4b000000000000

  29148      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-bb3b000000000000

  31370      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-bd4b000000000000

  31369      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-bf4b000000000000

  31367      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-c74b000000000000

  31366      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-cb4b000000000000

  31361      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-da6d000000000000

  31373      4 -rwxrwxr-x    1 root     root            84 Nov 22 09:08 .lck-dc6d000000000000

  19389 2773324 -rw-------    1 root     root     2835558400 Dec 22  2015 apacheserver-000001-delta.vmdk

  19390      4 -rw-------    1 root     root           318 Dec 17  2015 apacheserver-000001.vmdk

  19391 1305920 -rw-------    1 root     root     1342386176 Feb  8  2016 apacheserver-000002-delta.vmdk

  19393      4 -rw-------    1 root     root           325 Dec 22  2015 apacheserver-000002.vmdk

  25979 370196 -rw-------    1 root     root     386084864 Feb 12  2016 apacheserver-000003-delta.vmdk

  25980      4 -rw-------    1 root     root           325 Feb  8  2016 apacheserver-000003.vmdk

  19399 1878784 -rw-------    1 root     root     1929588736 Feb 19  2016 apacheserver-000004-delta.vmdk

  19400      4 -rw-------    1 root     root           325 Feb 12  2016 apacheserver-000004.vmdk

  19403 3274756 -rw-------    1 root     root     3355652096 Mar  2  2016 apacheserver-000005-delta.vmdk

  30093      4 -rw-------    1 root     root           325 Feb 19  2016 apacheserver-000005.vmdk

  20622 2928180 -rw-------    1 root     root     3003330560 Mar 15  2016 apacheserver-000006-delta.vmdk

  20623      4 -rw-------    1 root     root           325 Mar  2  2016 apacheserver-000006.vmdk

   9472 7434472 -rw-------    1 root     root     7583510528 Apr 22  2016 apacheserver-000007-delta.vmdk

   9473      4 -rw-------    1 root     root           325 Mar 15  2016 apacheserver-000007.vmdk

  11320 10961996 -rw-------    1 root     root     11190611968 Oct 27  2016 apacheserver-000008-delta.vmdk

  11321      4 -rw-------    1 root     root           325 Apr 22  2016 apacheserver-000008.vmdk

  15289 11025452 -rw-------    1 root     root     11257720832 Jun 12 07:04 apacheserver-000009-delta.vmdk

  15290      4 -rw-------    1 root     root           325 Oct 27  2016 apacheserver-000009.vmdk

  28122 9300208 -rw-------    1 root     root     9496113152 Aug 29 06:54 apacheserver-000010-delta.vmdk

  28123      4 -rw-------    1 root     root           325 Jun 12 07:04 apacheserver-000010.vmdk

  31354 9695524 -rw-------    1 root     root     9898766336 Nov 22 09:08 apacheserver-000011-delta.vmdk

  31355      4 -rw-------    1 root     root           325 Aug 29 06:54 apacheserver-000011.vmdk

  19388     36 -rw-------    1 root     root         32026 Dec 17  2015 apacheserver-Snapshot1.vmsn

  28120 8427524 -rw-------    1 root     root     8595954083 Jun 12 07:13 apacheserver-Snapshot10.vmsn

  31353 8427524 -rw-------    1 root     root     8595952786 Aug 29 07:04 apacheserver-Snapshot11.vmsn

  19385     36 -rw-------    1 root     root         32032 Dec 22  2015 apacheserver-Snapshot2.vmsn

  25977     36 -rw-------    1 root     root         32032 Feb  8  2016 apacheserver-Snapshot3.vmsn

  19398     36 -rw-------    1 root     root         32032 Feb 12  2016 apacheserver-Snapshot4.vmsn

  19392     36 -rw-------    1 root     root         32033 Feb 19  2016 apacheserver-Snapshot5.vmsn

  19395 8427524 -rw-------    1 root     root     8595954013 Mar  2  2016 apacheserver-Snapshot6.vmsn

   9471 8427128 -rw-------    1 root     root     8595549378 Mar 15  2016 apacheserver-Snapshot7.vmsn

  11319 8427128 -rw-------    1 root     root     8595549378 Apr 22  2016 apacheserver-Snapshot8.vmsn

  15288 8427524 -rw-------    1 root     root     8595954079 Oct 27  2016 apacheserver-Snapshot9.vmsn

  30103      0 -rw-------    1 root     root     8589934592 Feb 19  2016 apacheserver-fcb13ccc.vswp

  19386 5633504 -rw-------    1 root     root     107374182400 Dec 17  2015 apacheserver-flat.vmdk

  19396     12 -rw-------    1 root     root          8684 Nov 22 09:01 apacheserver.nvram

  19387      4 -rw-------    1 root     root           522 Dec 17  2015 apacheserver.vmdk

  31359      8 -rw-r--r--    1 root     root          4714 Aug 29 06:54 apacheserver.vmsd

  31358      4 -rwxr-xr-x    1 root     root          3504 Aug 29 06:54 apacheserver.vmx

  30097      0 -rw-------    1 root     root             0 Feb 19  2016 apacheserver.vmx.lck

  19384      4 -rw-r--r--    1 root     root          3433 Dec 17  2015 apacheserver.vmxf

   9474    208 -rw-------    1 root     root        208896 Mar 15  2016 apacheserver_1-000001-delta.vmdk

   9475      4 -rw-------    1 root     root           322 Mar 15  2016 apacheserver_1-000001.vmdk

  11322    208 -rw-------    1 root     root        208896 Apr 22  2016 apacheserver_1-000002-delta.vmdk

  11323      4 -rw-------    1 root     root           329 Apr 22  2016 apacheserver_1-000002.vmdk

  15291    208 -rw-------    1 root     root        208896 Oct 27  2016 apacheserver_1-000003-delta.vmdk

  15292      4 -rw-------    1 root     root           329 Oct 27  2016 apacheserver_1-000003.vmdk

  28124    208 -rw-------    1 root     root        208896 Jun 12 07:04 apacheserver_1-000004-delta.vmdk

  28125      4 -rw-------    1 root     root           329 Jun 12 07:04 apacheserver_1-000004.vmdk

  31356    208 -rw-------    1 root     root        208896 Aug 29 06:54 apacheserver_1-000005-delta.vmdk

  31357      4 -rw-------    1 root     root           329 Aug 29 06:54 apacheserver_1-000005.vmdk

   5985      0 -rw-------    1 root     root     107374182400 Mar  9  2016 apacheserver_1-flat.vmdk

   5986      4 -rw-------    1 root     root           498 Mar  9  2016 apacheserver_1.vmdk

  19397    152 -rw-r--r--    1 root     root        151364 Dec 17  2015 vmware-3.log

  19401    156 -rw-r--r--    1 root     root        153498 Dec 22  2015 vmware-4.log

  20224    156 -rw-r--r--    1 root     root        153824 Feb  8  2016 vmware-5.log

  25987    156 -rw-r--r--    1 root     root        153712 Feb 12  2016 vmware-6.log

  31066    156 -rw-r--r--    1 root     root        153550 Feb 19  2016 vmware-7.log

  30101    156 -rw-r--r--    1 root     root        154154 Feb 19  2016 vmware-8.log

  30102    292 -rw-r--r--    1 root     root        293156 Oct 17 09:25 vmware.log

  30094      0 -rw-------    1 root     root     117440512 Feb 19  2016 vmx-apacheserver-4239473868-1.vswp

The snapshots that one sees , have been taken randomly by admins.

Please let me know if you require anymore information.

Thanks.

Reply
0 Kudos
a_p_
Leadership
Leadership

From what I can see, the VM's secondary virtual disk dosn't contain much data, so it's actually only the first virtual disk which will require (temporary) additional disk space. Depending on the data in the delta files, space requirements could be up to the virtual disk's provisioned size minus the flat file's size (second column in kB), but I guess it'll be much less. Anyway, with ~3TB free disk space you're safe from this perspective. Depending on the storage performance, "Delete All" may take some time, so please be patient.

Although I don't expect issues, you may still consider daphnissov's recommendation regarding a current backup.

André

Reply
0 Kudos
dekoshal
Hot Shot
Hot Shot

In addition, You may also find this helpful to monitor snapshot removal progress if it takes really long time.

https://kb.vmware.com/kb/1007566

Snapshot removal task stops at 99% in ESXi/ESX (1007566)

Best Regards,

Deepak Koshal

CNE|CLA|CWMA|VCP4|VCP5|CCAH

Reply
0 Kudos