Cannot delete the existing backup snapshots for a Virtual machine due to vim.fault.GenericVmConfigFault
search cancel

Cannot delete the existing backup snapshots for a Virtual machine due to vim.fault.GenericVmConfigFault

book

Article ID: 374299

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Snapshot consolidation for a virtual machine with multiple snapshots might fail with a "GenericVmConfigFault

[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 when one of the snapshot state files in defect or corrupted

Resolution

To solve this issue, you can 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 you can list all virtual machines on the host using the esxcli command
        # esxcli vm process list
      • or you can search for the specific .vmx file:
        # find /vmfs/volumes -iname <vm_name>.vmx 
    3. Once you have taken note of the path to the .vmx file, unregister 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: Post moving the VMSN and the VMSD, we can also re register the VM and click on remove all snapshots to delete all the snapshots.