Snapshot cannot be deleted with error "An error occurred while deleting a snapshot. One of the disks in this virtual machine is already in use by another virtual machine or snapshot."
search cancel

Snapshot cannot be deleted with error "An error occurred while deleting a snapshot. One of the disks in this virtual machine is already in use by another virtual machine or snapshot."

book

Article ID: 395359

calendar_today

Updated On:

Products

VMware vSAN

Issue/Introduction

  • VMs reside on a vSAN ESA cluster which uses native scalable snapshots
  • VM fails to delete/consolidate snapshots with error "An error occurred while deleting a snapshot. One of the disks in this virtual machine is already in use by another virtual machine or snapshot."
  • In the VM’s vmware.log file, you see the following messages:
    2025-03-28T18:29:49.749Z In(05) vmx <UUID>: DISKLIB-VMFS : "vsan://<datastore-uuid>/<object-uuid>::4" : closed.
    2025-03-28T18:29:49.749Z In(05) vmx <UUID>: SNAPSHOT: SnapshotDiskTreeAddFromSnapshot: Trying to add snapshot <VM_Name>-Snapshot5.vmsn to disk /vmfs/volumes/vsan:<datastore-uuid>/<object-uuid>/<VM_Name>-000001.vmdk which already has snapshot <VM_Name>-Snapshot4.vmsn.
    2025-03-28T18:29:49.749Z Er(02) vmx <UUID>: SNAPSHOT: SnapshotGenerateDeleteDisks Failed to fetch disk tree: One of the disks in this virtual machine is already in use by a virtual machine or by a snapshot (21)

Environment

VMware vSAN ESA

Cause

This issue occurs when the snapshot database file(vmsd) is corrupted.

Resolution

Follow the resolution section of KB 324324.

However as ESA native snapshots works slightly different, the previous snapshot descriptor files will be left behind and the new base descriptor file will now be the newest snapshot in the chain. This will require additional clean up.

Option 1:

 796 Feb 20 07:27 VM_Name-000001.vmdk' <----No longer valid
 790 Feb 21 19:01 VM_Name-000005.vmdk' <----No longer valid 
 611 Mar 31 15:41 VM_Name-000006.vmdk' <---New base disk
  14 Mar 31 15:41 VM_Name-aux.xml'
8.0K Mar 28 13:42 VM_Name.scoreboard'
  43 Mar 31 15:41 VM_Name.vmsd'
9.4K Mar 31 15:41 VM_Name.vmx'

Running cat VM_Name.vmx|grep vmdk you see the vmx points to VM_Name-000006.vmdk

scsi0:0.fileName = VM_Name-000006.vmdk

To cleanup the VM directory of the leftover descriptor files and rename the descriptor file to a base disk naming convention do the following:

  1. Power off the VM
  2. Open an SSH session to the host the VM is registered to
  3. Navigate to the VM directory 
  4. Change the name of the file by running mv VM_Name-000006.vmdk VM_Name.vmdk
  5. Edit the vmx file to reflect the new name
  6. Reload the vmx file by following KB Reloading a vmx file without removing the virtual machine from inventory
  7. Delete the leftover descriptor files by running rm VM_Name-000001.vmdk, repeat the rm command for all leftover descriptor files

Option 2:

Cloning the VM, then deleting the original and continuing to use the clone also resolves the issue, as the cloning process generates a clean descriptor chain.