Deleting virtual machine or snapshot fails with error: vim.fault.GenericVmConfigFault
search cancel

Deleting virtual machine or snapshot fails with error: vim.fault.GenericVmConfigFault

book

Article ID: 374299

calendar_today

Updated On: 04-16-2025

Products

VMware vSphere ESXi

Issue/Introduction

  • Snapshot consolidation for a virtual machine with multiple snapshots might fail with a "vim.fault.GenericVmConfigFault"
  • Deleting a virtual machine from disk that has multiple snapshots may also fail with the same error mentioned above.
[root@hostname:~] vim-cmd vmsvc/snapshot.removeall 3
Remove All Snapshots:
Remove all snapshots failed: (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.

Environment

vSphere 7.0.x 

vSphere 8.0.x

Cause

This issue can occur if one of the snapshot chain files is defective or corrupted.

Resolution

To solve this issue, please apply the following steps:

    1. Using vSphere Client, shut down the guest operating system and power the virtual machine off.
    2. Next, find the virtual machine folder where the .vmx configuration file of the VM is located.
      • open an SSH session to the host where the VM is currently registered.
      • the file /etc/vmware/hostd/vmInventory.xml lists all VMs the host currently holds with their configuration file path.
      • alternatively use the command below to list all virtual machines on the host by using the esxcli command.

        # esxcli vm process list

      • or search for the specific .vmx file:

        # find /vmfs/volumes -iname <vm_name>.vmx
    3. Please take note of path to the .vmx file andunregister the VM from the vCenter inventory:
      • right-click the VM in vSphere Client
      • select "Unregister from Inventory" (be careful not to select "Delete from Disk"):
    4. Return back to the SSH session with the ESXi, and change into the VM folder noted in Step 2:

      # cd /vmfs/volumes/<datastore_name>/<folder_name>/<vm_name>.vmx

    5. Create a temp folder within this VM folder

      # mkdir vm_snapshot_temp
       
    6. Move all files with the extensions .vmsn (the snapshot state files) and .vmsd (the snapshot directory file) and from the VM folder into this new folder.

      # mv *.vmsn ./vm_snapshot_temp/
      # vm *.vmsd ./vm_snapshot_temp/

    7. Return to the vSphere Client and use the datastore browser to locate the .vmx file of the virtual machine.
    8. Select the file and click on "Register VM" to reregister the virtual machine with the vCenter Server.
    9. Acknowledge the ‘VM consolidation needed’ status and wait for the consolidation process to complete. 
    10. Once the consolidation process has finished, verify that there are no more snapshots in the virtual machine folder, then power the virtual machine back on


Note: After moving the VMSN and VMSD files, you can re-register the virtual machine and select "Remove All Snapshots" to delete all existing snapshots.
          If you intend to delete the virtual machine entirely, re-register the VM and then choose "Delete from Disk" to remove it completely.