Snapshot Deletion Fails Due to Error "vim.fault.GenericVmConfigFault. The virtual machine is a template"
search cancel

Snapshot Deletion Fails Due to Error "vim.fault.GenericVmConfigFault. The virtual machine is a template"

book

Article ID: 368221

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

 

A VM's snapshots are unable to be deleted or consolidated.

Note: While this issue is typically observed from the vSphere web GUI, the error thrown when consolidating or deleting snapshots is rather generic. To confirm this particular issue effects a VM, verify by tracing Steps 1-5 of Method 1 and Method 2 in the Resolution section below. If the templateVM parameter is set to FALSE, then this issue is not the cause of the snapshot deletion and consolidation failures. 

 

Symptoms:

  • From the vSphere GUI a Delete All Snapshots job for a VM throws the error "A general system error occurred: Fauled cause: vim.fault.GenericVmConfigFault.
  • From the ESXi Host GUI a Delete All Snapshots job for a VM throws the error "Failed to delete all snapshots from virtual machine: 'VM_NAME'"
  • The following ESXi Host/Virtual Machine Log entries are observed: 
    • From /var/log/hostd.log:
      • YYYY-MM-DDTHH:MM:SS.Z verbose hostd[2xxxx8] [Originator@6876 sub=Vigor.Vmsvc.vm:/vmfs/volumes/<Datastore>/<VM_Directory>/<VM_Name.vmx> opID=xxxxxxxxxxxxxx] Delete snapshot 1 and its children message: An error occurred while deleting a snapshot: The virtual machine is a template.
    • From /vmfs/volumes/<vm_directory>/vmware.log:
      • YYYY-MM-DDTHH:MM:SS.Z In(05) vmx 47839-118772-auto-2jn9-h5:70024065-9-ed-e857 SNAPSHOT: Snapshot_Delete failed: The virtual machine is a template (19)

Note: Timestamps and opID numbers in the log entries above are strictly shown for example. File paths have also been altered with placeholder values. 

Environment

vCenter Server 7.0.x

vCenter Server 8.0.x

vSphere ESXi 7.0.x

vSphere ESXi 8.0.x

Cause

This can occur if a VM was deployed using a public OVF template downloaded from a third party vendor that specified the value templateVM = "True" in the VM's .vmx file. While the VM may appear and behave as a normal VM in the GUI, this value will prevent snapshot deletion/consolidation. 

Resolution

Note: Brief downtime will be required to resolve this issue as the VM will need to be powered off.

 

Method 1 - vSphere GUI:

  1. Navigate and log into the vSphere web GUI
  2. Navigate to the VM
  3. Power off the VM: Click Actions > Power > Shut Down Guest OS 
  4. Enter the Edit Settings page for the VM: Click Actions > Edit SettingsAdvanced Parameters tab 
  5. Filter the Attribute column for "templateVM". The Value column will be listed as TRUE 

  6. Click on the TRUE value and replace it with the value FALSE. Once entered, click the check box and then OK to save the changes. Once saved, go back and verify that the setting now shows a value of FALSE instead of TRUE
  7. Delete/Consolidate the VM's snapshots.
  8. Power on the VM 

 

Method 2 - ESXi Host GUI:

  1. Navigate and log into the ESXi Host web GUI of the host the VM is registered to
  2. Power off the VM: Click Actions > Guest OS > Shut Down 
  3. Navigate to the VM's Edit Settings page: Click Actions Edit Settings
  4. Navigate to the VM's Advanced Configuration Parameters page: Click VM Options tab > Expand Advanced > Click Edit Configuration
  5. Using the Search bar on the top right, filter for templateVM


  6. Click on the Value that is set as TRUE and change it to FALSE. Click OK to save changes. Once saved, go back and verify the Value is now set to FALSE 


  7. Delete/Consolidate the VM's snapshots
  8. Power on the VM 

 

Method 3 - CLI:

  1. Power off the VM 
  2. SSH or Console into the host the VM is registered to
  3. Use the VI Editor to enter into the VM's .vmx file using the following command:
    • vi /vmfs/volumes/VM_Datastore/VM_Directory/VM_Name.vmx
  4. Press the Insert key to enter Edit Mode
  5. Using the arrow keys, navigate down to the line templateVM = "TRUE"
  6. Using the arrow and backspace keys, remove TRUE and replace the value with FALSE 
  7. Use the ESC key to exit Edit Mode 
  8. Type :wq! and press Enter to save changes. Verify the changes saved by using the same command from Step 3, or the following command: 
    • less /vmfs/volumes/VM_Datastore/VM_Directory/VM_Name.vmx
  9. Delete/Consolidate the VM's snapshots.
  10. Power on the VM.