Deleting virtual machine or snapshot fails with error: 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 "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 invalid or corrupted.
Resolution
To solve this issue, please apply the following steps:
Using vSphere Client, shut down the guest operating system and power the virtual machine off.
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
Please take note of path to the .vmx file and 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"):
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
Create a temp folder within this VM folder
# mkdir vm_snapshot_temp
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.
Return to the vSphere Client and use the datastore browser to locate the .vmx file of the virtual machine.
Select the file and click on "Register VM" to reregister the virtual machine with the vCenter Server.
Acknowledge the ‘VM consolidation needed’ status and wait for the consolidation process to complete.
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, the virtual machine can be re-registered and select "Remove All Snapshots" to delete all existing snapshots. If the intent is to delete the virtual machine entirely, re-register the VM and then choose "Delete from Disk" to remove it completely.