Error: "msg.snapshot.error-DUPLICATEDISK" encountered while deleting/consolidating a Virtual Machine snapshot
search cancel

Error: "msg.snapshot.error-DUPLICATEDISK" encountered while deleting/consolidating a Virtual Machine snapshot

book

Article ID: 324324

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vCenter Server

Issue/Introduction

  • Snapshot consolidation fails with an error: 
    "An error occurred while consolidating disks: msg.snapshot.error-DUPLICATEDISK."
  • Alternate error: 
    "A general system error occurred: Fault cause: vim.fault.GenericVmConfigFault."
  • In the vCenter UI: Some of the virtual machine's disks failed to load, and the information for these disks in the virtual machine configuration may be incomplete.
  • Remove all snapshots: "
    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 vmware.log located at at /vmfs/volumes/Datastore/VMfolder: 
    YYYY-MM-DDTHH:MM:SS | vmx| I120: SNAPSHOT: SnapshotDiskTreeAddFromSnapshot: Trying to add snapshot VMmachine.vmsn to disk /vmfs/volumes/VMmachine-000002.vmdk which already has snapshot VMmachine-SnapshotNNN.vmsn
    YYYY-MM-DDTHH:MM:SS | vmx| I120: SNAPSHOT: SnapshotConsolidateWorkItemArrayGet failed: One of the disks in this virtual machine is already in use by a virtual machine or by a snapshot (21)
  • In the /var/log/hostd.log on the ESXi host, similar entries are reported: 
    YYYY-MM-DDTHH:MM:SS verbose hostd[2108658] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/vsan:####/#######/VM_NAME.vmx opID=#### user=vpxuser:DOMAIN\USERNAME] Remove snapshot request received: VM Snapshot DD%2fMM%2fYYYY, HH:MM:SS, 0
    
    YYYY-MM-DDTHH:MM:SS info hostd[2108658] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/vsan:#######/#######/VM_NAME.vmx opID=#### user=vpxuser:DOMAIN\USERNAME] State Transition (VM_STATE_OFF -> VM_STATE_REMOVE_SNAPSHOT)
    
    YYYY-MM-DDTHH:MM:SS info hostd[2108658] [Originator@6876 sub=Libs opID=#### user=vpxuser:DOMAIN\USERNAME] SNAPSHOT: SnapshotDeleteWork '/vmfs/volumes/vsan:######/a#####/VM_NAME.vmx' : 459
    
    YYYY-MM-DDTHH:MM:SS info hostd[2108658] [Originator@6876 sub=Libs opID=#### user=vpxuser:DOMAIN\USERNAME] SNAPSHOT: SnapshotDiskTreeAddFromSnapshot: Trying to add snapshot VM_NAME-Snapshot.vmsn to disk /vmfs/volumes/vsan:####/a#####/VM_NAME_4.vmdk which already has snapshot VM_NAME-Snapshot421.vmsn.
    
    YYYY-MM-DDTHH:MM:SS info hostd[2108658] [Originator@6876 sub=Libs opID=#### user=vpxuser:DOMAIN\USERNAME] 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)
    
    YYYY-MM-DDTHH:MM:SS info hostd[2108658] [Originator@6876 sub=Libs opID=#### user=vpxuser:DOMAIN\USERNAME] SNAPSHOT: SnapshotDeleteNode failed: One of the disks in this virtual machine is already in use by a virtual machine or by a snapshot (21)
    
    YYYY-MM-DDTHH:MM:SS verbose hostd[2108658] [Originator@6876 sub=Vigor.Vmsvc.vm:/vmfs/volumes/vsan:####/a####/VM_NAME.vmx opID=#### user=vpxuser:DOMAIN\USERNAME] Delete snapshot NNN message: An error occurred while deleting a snapshot: One of the disks in this virtual machine is already in use by a virtual machine or by a snapshot.
    
    YYYY-MM-DDTHH:MM:SS warning hostd[2108658] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/vsan:########/a########/VM_NAME.vmx opID=#### user=vpxuser:DOMAIN\USERNAME] Failed to remove snapshot(s): N3Vim5Fault20GenericVmConfigFault9E#ceptionE(Fault cause: vim.fault.GenericVmConfigFault
    
    YYYY-MM-DDTHH:MM:SS info hostd[2108658] [Originator@6876 sub=Vimsvc.TaskManager opID=#### user=vpxuser:DOMAIN\USERNAME] Task Completed : haTask-###-vim.vm.Snapshot.remove-nnnnn Status error

 

 

  • In the /var/log/vpxa.log on the ESXi host, following error is reported: 
    YYYY-MM-DDTHH:MM:SS info vpxa[2114725] [Originator@6876 sub=Default opID=lv43qwff-1812160-auto-12u9t-h5:70148401-60-ca] [vpxLRO] -- ERROR task-4005 -- vpxa -- vpxapi.vpxaService.removeSnapshot: vmodl.fault.SystemError:
    --> Result:
    --> (vmodl.fault.SystemError) {
    --> faultCause = (vmodl.MethodFault) null,
    --> faultMessage = <unset>,
    --> reason = "Fault cause: vim.fault.GenericVmConfigFault
    --> "
    --> msg = "A general system error occurred: Fault cause: vim.fault.GenericVmConfigFault
    --> "
    --> }
    --> Args:
    -->
    --> Arg vmid:
    --> NN
    --> Arg removeChildren:
    --> false
    --> Arg snapshot:
    --> 'vim.vm.Snapshot:NNN-snapshot-NNN'
    --> Arg disksToConsolidate:
    --> (string) [
    --> "ds:///vmfs/volumes/vsan:######/a######/VM_NAME-00000N.vmdk",
    --> "ds:///vmfs/volumes/vsan:######/a######0/VM_NAME-00000N.vmdk",
    --> "ds:///vmfs/volumes/vsan:######/a######/VM_NAME_N-00000N.vmdk",
    --> "ds:///vmfs/volumes/vsan::######/a######/VM_NAME_N.vmdk"
    --> ]
    --> Arg consolidate:
    --> true

 

 

Environment

  • VMware vCenter Server 8.X
  • VMware vCenter Server 7.X
  • VMware vSphere ESXi 8.X
  • VMware vSphere ESXi 7.X

Cause

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

Resolution

To resolve this issue, delete the .vmsn and .vmsd files from the virtual machine location using the steps below.

  1. Power off the affected virtual machine
  2. Go to the VM directory
    cd /vmfs/volumes/Datastore Name/VM_Name/
  3. Create a temporary directory and back up the snapshot state file and snapshot database file by moving them there.
    mkdir delete-later
    mv *.vmsn ./delete-later
    mv *.vmsd ./delete-later

    Note: If there is no .vmsn file (in step# 2),it would mean that no snapshot has been taken to include the active state of the Virtual machine.
    To clarify: If a snapshot taken with the option "Include virtual machine's memory" checked, .vmsn file would be created. 

  4. Obtain the virtual machine ID using the vim-cmd command.
    vim-cmd vmsvc/getallvms | grep -i VM_NAME
    
  5. Reload the virtual machine's vmx file using the VMID.
    vim-cmd vmsvc/reload VMID


  6. Create a new snapshot by right-clicking the VM -> Snapshot -> Take Snapshot.
  7. Use the Snapshot Manager to consolidate the disks by selecting the "Delete All" option.

Additional Information