Search the VMware Knowledge Base (KB)
View by Article ID

Unable to create snapshot: Operation failed because file already exists or Cannot complete the operation because the file or folder [DatastoreName] VMname/VMname.vmx already exists (1008058)

  • 37 Ratings

Symptoms

While creating a virtual machine snapshot from the VI or vSphere Client, or from the command line, you may receive any of these errors depending on your product version:

  • ESX/ESXi 3.5 or VirtualCenter 2.5 VI Client, shows an error similar to:

    Operation failed because file already exists

  • ESX/ESXi 3.5 Service Console, shows an error similar to:

    VMControl error -3: Invalid arguments

    For example:

    # vmware-cmd VMname.vmx createsnapshot name desc 0 0
    VMControl error -3: Invalid arguments


  • ESX/ESXi/vCenter Server 4.0 vSphere Client, shows an error similar to:

    Cannot complete the operation because the file or folder [DatastoreName] VMname/VMname.vmx already exists

  • ESX/ESXi/vCenter Server 4.1 vSphere Client, shows an error similar to:

    Cannot complete the operation because the file or folder <unspecified filename> already exists

  • ESX/ESXi 4.0 Service Console, shows an error similar to:

    # vmware-cmd /vmfs/volumes/47ecbe04-acfca740-564c-001a4be960e0/VMname/VMname.vmx createsnapshot name desc 0 0
    Task reported error: (vim.fault.FileAlreadyExists) {
    dynamicType = <unset>,
    dynamicProperty = (vmodl.DynamicProperty) [],
    msg = 'Cannot complete the operation because the file or folder [DatastoreName] VMname/VMname.vmx already exists',
    faultCause = <unset>,
    faultMessage = (vmodl.LocalizableMessage) [],
    file = '[DatastoreName] VMname/VMname.vmx'
    }
    createsnapshot(name, desc, 0, 0) = 0


  • ESX/ESXi 4.1 Service Console, shows an error similar to:

    # vmware-cmd /vmfs/volumes/47ecbe04-acfca740-564c-001a4be960e0/VMname/VMname.vmx createsnapshot name desc 0 0
    Task reported error: (vim.fault.FileAlreadyExists) {
    dynamicType = <unset>,
    dynamicProperty = (vmodl.DynamicProperty) [],
    msg = 'Cannot complete the operation because the file or folder <unspecified filename> already exists',
    faultCause = <unset>,
    faultMessage = (vmodl.LocalizableMessage) [],
    file = '[DatastoreName] VMname/VMname.vmx'
    }
    createsnapshot(name, desc, 0, 0) = 0


  • ESX/ESXi 3.5 hostd.log file contains these entries:

    'BaseLibs' 51723184 info] SNAPSHOT: SnapshotBranchDisk failed: The file already exists (39).
    'BaseLibs' 51723184 info] SNAPSHOT: SnapshotBranch failed: The file already exists (5).
    'BaseLibs' 51723184 info] DISKLIB-LINK : File '/vmfs/volumes/4c0f81ad-b85976a8-21d1-001cc493ce16/VMname/VMname-000002-delta.vmdk' already exists.
    'BaseLibs' 51723184 info] DISKLIB-LIB : Failed to create link: The file already exists (39)
    'BaseLibs' 51723184 info] SNAPSHOT: SnapshotBranchDisk failed: The file already exists (39).
    'BaseLibs' 51723184 info] SNAPSHOT: SnapshotBranch failed: The file already exists (5).


  • ESX/ESXi 4.x hostd.log file contains these entries, shows an error similar to:

    info 'Libs'] SNAPSHOT: SnapshotBranch failed: The file already exists (5).
    info 'Vmsvc'] Failed to do Snapshot op: Error: (12) The file already exists
    info 'DiskLib'] DISKLIB-LINK : File '/vmfs/volumes/47ecbe04-acfca740-564c-001a4be960e0/VMname/VMname-000004-delta.vmdk' already exists.
    info 'DiskLib'] DISKLIB-LIB : Failed to create link: The file already exists (39)
    info 'DiskLib'] DISKLIB-LIB : Failed to create link: The file already exists (39)
    info 'Libs'] SNAPSHOT: SnapshotBranch failed: The file already exists (5).
    info 'Vmsvc'] Failed to do Snapshot op: Error
    : (12) The file already exists

  • ESXi 5.x hostd.log file contains entries similar to, shows an error similar to:

    012-05-22T12:36:59.075Z [5ED40B90 info 'vm:/vmfs/volumes/4f66bf0c-9c44e66e-d073-984be10fb0db/a4/a4.vmx'] Failed to consolidate disks in Foundry: Error: (15) The file is already in use
    2012-05-22T12:36:59.075Z [5ED40B90 info 'Libs'] Vix: [5956 foundryHandleProperties.c:372]: Error VIX_E_UNRECOGNIZED_PROPERTY in FoundryGetStringProperty(): Unrecognized handle property identifier
    2012-05-22T12:36:59.075Z [5ED40B90 info 'Libs'] Vix: [5956 foundryHandleProperties.c:3354]: Error VIX_E_UNRECOGNIZED_PROPERTY in Vix_GetPropertiesImpl(): Unable to get string property 3045.
    2012-05-22T12:36:59.075Z [5ED40B90 info 'Libs'] Vix: [5956 foundryHandleProperties.c:3252]: Error VIX_E_UNRECOGNIZED_PROPERTY in Vix_GetPropertiesVargs(): Unrecognized handle property identifier
    2012-05-22T12:36:59.075Z [5ED40B90 info 'ha-eventmgr'] Event 2230 : Virtual machine a4 disks consolidation failed on esx01.abc.com in cluster vm01.abc.com in ha-datacenter.
    2012-05-22T12:36:59.101Z [5ED40B90 verbose 'vm:/vmfs/volumes/4f66bf0c-9c44e66e-d073-984be10fb0db/a4/a4.vmx'] Found helper snapshot 57, the VM needs consolidation.
    2012-05-22T12:36:59.101Z [5ED40B90 verbose 'vm:/vmfs/volumes/4f66bf0c-9c44e66e-d073-984be10fb0db/a4/a4.vmx'] Time to gather Snapshot information ( read from disk, build tree): 3 msecs. needConsolidate is true.
    2012-05-22T12:36:59.101Z [5ED40B90 verbose 'vm:/vmfs/volumes/4f66bf0c-9c44e66e-d073-984be10fb0db/a4/a4.vmx'] Snapshot property update: Configure will be invalidated for:

Resolution

This issue occurs when VMware ESX or ESXi tried to create a new vDiskname-delta.vmdk redolog file, but the generated filename already exists. This can occur if the -delta.vmdk redolog file does not have an associated descriptor file.

Every virtual disk is composed of two files, a flat or delta file containing the actual data and a descriptor file containing geometry and topology information. For example, vDiskname.vmdk and vDiskname-flat.vmdk or vDiskname-delta.vmdk. For more information, see Understanding virtual machine snapshots in VMware ESX (1015180).

When creating a snapshot, the host uses the lowest file number that is not in use by the chain of snapshots and does not exist on the directory. The host calculates this by checking through the descriptor files.

When the host tries to create the snapshot, it first creates the new descriptor file, then creates the associated -delta.vmdk file. If the host detects that a -delta.vmdk file with that name already exists the snapshot operation fails and the virtual machine reverts to its previous state.

To resolve this issue, locate and manually rename or move the -delta.vmdk file that does not have an associated descriptor file.
 
To locate and manually rename or move the -delta.vmdk file that does not have an associated descriptor file:
  1. Connect to the ESX or ESXi host using the vSphere Client.
  2. Locate the affected virtual machine in the Inventory.
  3. Determine which datastore(s) the virtual machine is stored on.
  4. Open the Datastore Browser.
  5. Navigate to the working directory containing the virtual machine configuration files. For more information, see Creating snapshots in a different location than default virtual machine directory (1002929).
  6. Confirm that remnant redolog delta.vmdk files from previous snapshots exist. For example:

    • The virtual machine is currently pointed to vmname-000001.vmdk.
    • vmname-000001.vmdk's parent is the virtual machine base disk, vmname.vmdk.
    • A file named vmname-000002-delta.vmdk exists in the virtual machine directory.
    • A file named vmname-000002-delta.vmdk~ exists in the virtual machine directory.
    • The .vmx file does not reference the file named vmname-000002-delta.vmdk.
    • The .vmsd file does not reference the file named vmname-000002-delta.vmdk.

  7. Rename or move the remnant file aside. For example, move the file vmname-000002-delta.vmdk into a backup directory.
  8. Retry the Create Snapshot operation, it should complete successfully.
Notes:
  • If the memory state is captured for a snapshot, a .vmsn file is created before the new .vmdk files. If the snapshot operation fails unexpectedly, the process halts and the .vmsn file is left behind. The .vmsn files can be safely removed if the virtual machine has no snapshots. If there are any snapshots, look in the .vmsd file to identify which .vmsn files are referenced by the virtual machine and remove the rest.
  • You may encounter such issue when you delete the descriptor file by browsing the datastore (assuming those are snapshot disk files and delta files are not visible) of a Virtual machine whose Snapshot/s  is/are not visible through Snapshot Manager. 

Additional Information

For related information, see Working with snapshots (1009402).

To be alerted when this article is updated, click Subscribe to Document in the Actions box.

See Also

This Article Replaces

1002190
1007193


Update History

06/22/2010 - Added errors from GUI and hostd.log 10/31/2011 - Added ESXi 5.0 to Products

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 37 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)




Please enter the Captcha code before clicking Submit.
  • 37 Ratings
Actions
KB: