"Detected an invalid snapshot configuration" error creating a snapshot
search cancel

"Detected an invalid snapshot configuration" error creating a snapshot

book

Article ID: 318905

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

  • Unable to take snapshot of the virtual machine.
  • Attempting to take a snapshot fails with:
    •  
    • From /var/run/log/hostd.log
    • YYYY-MM-DDTHH:MM:SSZ info hostd[2##1##6] [Originator@6876 sub=Vimsvc.TaskManager opID=esxui-8##a-6##f user=<username>] Task Created : haTask-22-vim.VirtualMachine.createSnapshot-3###4
      YYYY-MM-DDTHH:MM:SSZ verbose hostd[2##1##6] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/<datastore>/<vmname>/<vmname>.vmx opID=esxui-8##a-6##f user=<username>] Create Snapshot: Test, memory=false, quiescent=false state=5
      YYYY-MM-DDTHH:MM:SSZ info hostd[2##1##6] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/<datastore>/<vmname>/<vmname>.vmx opID=esxui-8##a-6##f user=<username>] State Transition (VM_STATE_ON -> VM_STATE_CREATE_SNAPSHOT)
      YYYY-MM-DDTHH:MM:SSZ verbose hostd[2##1##6] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/<datastore>/<vmname>/<vmname>.vmx opID=esxui-4##8-5##4] Handling vmx message 439443190: The snapshot operation is not allowed on this VM due to a missing or renamed configuration file.
      --> If the file or path has been renamed, shut down this VM and restart VMware ESX.
      -->
      YYYY-MM-DDTHH:MM:SSZ info hostd[2##1##6] [Originator@6876 sub=Vimsvc.ha-eventmgr opID=esxui-4##8-5##4] Event 37147 : Error message on <vmname> on <ESXi_host> in ha-datacenter: The snapshot operation is not allowed on this VM due to a missing or renamed configuration file. If the file or path has been renamed, shut down this VM and restart VMware ESX.
      YYYY-MM-DDTHH:MM:SSZ verbose hostd[2##1##6] [Originator@6876 sub=Vigor.Vmsvc.vm:/vmfs/volumes/<datastore>/<vmname>/<vmname>.vmx opID=esxui-4##8-5##4] Create Snapshot translated error to vim.fault.InvalidSnapshotFormat
      YYYY-MM-DDTHH:MM:SSZ verbose hostd[2##1##6] [Originator@6876 sub=Vigor.Vmsvc.vm:/vmfs/volumes/<datastore>/<vmname>/<vmname>.vmx opID=esxui-4##8-5##4] Create Snapshot message: An error occurred while saving the snapshot: A required file was not found.
      --> An error occurred while taking a snapshot: A required file was not found.
      -->

  • Scenario 1: vmname.vmkd files of the VM hard disk is missing.
    • From /var/run/log/hostd.log 
      • YYYY-MM-DDTHH:MM:SSZ verbose hostd[2100304] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/datastore/<vmfolder>/vmname.vmx opID=esxui-4###8-5###4] UpdateFileInfo: Failed to find file size for /vmfs/volumes/datastore/<vmfolder>/vmname.vmdk: No such file or directory

  • Scenario 2: Orphaned snapshot file
     
  • Scenario 3: vmname.vmx file is missing. 
    • From /var/run/log/hostd.log 
      • YYYY-MM-DDTHH:MM:SSZ verbose hostd[2100304] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/datastore/<vmname>/vmname.vmx opID=esxui-4###8-5###4] UpdateFileInfo: Failed to find file size for /vmfs/volumes/datastore/<vmname>/vmname.vmx: No such file or directory

  • Snapshot based backup will not complete successfully.

Environment

  • VMware vSphere ESXi
  • VMware vCenter Server

Cause

The root cause is a missing or inaccessible virtual machine file (typically the .vmx or .vmdk file) at the path specified in the VM configuration. This occurs when a file referenced in the inventory has been manually deleted, renamed, or moved on the datastore while the VM is registered, leading to a state where the management agent (hostd) cannot calculate file sizes or lock the required resources for a snapshot operation.

Specific scenarios identified in the logs include:

  • Scenario 1: The primary disk descriptor file (vmname.vmdk) is missing from the VM folder.
  • Scenario 2: There are orphaned snapshot references in the configuration that do not match the files present on the datastore.
  • Scenario 3: The virtual machine configuration file (vmname.vmx) is missing or the path has become invalid.

Resolution

To address the issue, please refer the below resolution. 

Scenario 1: vmname.vmkd files of the VM hard disk is missing.

Scenario 2: Orphaned snapshot file

  1. Verify the VM is running on the base disk by editing the VM settings.
  2. Select the VM that is having this issue and click the hard disk and verify the disk mounted:
    • Snapshot will look like vmname-00000x.vmdk (For example vmname-000001.vmdk)
    • Base disks will look like vmname.vmdk
  3. Remove any existing snapshots.
  4. Verify VM is now running on the base disks. If not, STOP IMMEDIATLY. DO NOT CONTINUE.
  5. Make a note of the datastore where the VM is stored.
  6. Connect to the ESXi host with an SSH session.
  7. Navigate to the datastore from step 4.
    • cd /vmfs/volumes/datastore/vmname/
    • Note: Alternatively, the vCenter or Host UI can be used to perform the following steps.
  8. List all the files in the folder:
    • ls -l
  9. Look for snapshot files similar to VMName-00000x.vmdk
  10. Create a temporary directory to store the snapshots:
    • mkdir delete_me
  11. Move the snapshot files to the temporary directory:
    • mv snapshot_file ./delete_me
  12. For example:
    • mv vmname-000001.vmdk ./delete_me
  13. Move vmname.vmsd to the temporary folder.
    • mv vmname.vmsd ./delete_me
  14. Create a snapshot.

Scenario 3: vmname.vmx file is missing.

  • Create a new VM with same configuration.
  • While adding the hard disk, attach the existing hard disk to the VM and save it. 
  • Power ON the VM and verify if you were able to access the VM. 
  • Then take snapshot of the VM.