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.
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:
Power off the VM
Open an SSH session to the host the VM is registered to
Navigate to the VM directory
Change the name of the file by running mv VM_Name-000006.vmdk VM_Name.vmdk
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.