VMware ESXi and vSphere Cluster Management
Remove or Delete a Virtual Machine in VMware vSphere
Learn how Remove from Inventory differs from Delete from Disk in VMware vSphere, and how to register an unregistered VM from its .vmx file.
In vSphere, removing a virtual machine (VM) can mean two very different things. You can remove only the VM's inventory record, or you can remove the inventory record and delete the VM's files from its datastore.
Confirm the intended outcome before selecting an action. Removing a VM from inventory preserves its files for later registration. Deleting it from disk is destructive and normally cannot be reversed through vSphere.
Key terms
- vSphere: VMware's platform for managing ESXi hosts, datastores, and virtual machines.
- vCenter Server: The centralized management service that maintains the vSphere inventory and manages resources.
- ESXi host: The VMware hypervisor server on which virtual machines run.
- Virtual machine inventory: The organizational record that makes a VM visible and manageable in the vSphere Client.
- Datastore: Storage used by ESXi for VM configuration files, virtual disks, snapshots, and related files.
- Virtual disk: A disk file containing the guest operating system, applications, and data.
- Snapshot: A point-in-time VM state that can include disk delta files. Snapshots should be considered before permanent deletion.
Remove from Inventory versus Delete from Disk
vSphere provides two removal actions. The first unregisters the VM while retaining its files. The second unregisters the VM and deletes its associated datastore files.
Remove from Inventory
Remove from Inventory is an unregistration action. It removes the VM's entry from vCenter Server and the ESXi host inventory, but it does not delete the VM's files from the datastore.
After removal, the VM no longer appears in the vSphere inventory and cannot be managed there until it is registered again. Its configuration file, virtual disks, snapshots, and other retained files remain in datastore storage. Retaining those files makes later registration possible.
Web Client workflow
- In the vSphere Client, locate the correct VM in the inventory.
- Open the VM's context menu.
- Choose the vCenter action for Remove from Inventory.
- Review the confirmation prompt, verify the VM identity, and confirm the action.
The VM should disappear from the inventory after the operation. This disappearance does not prove that the files were deleted; check the datastore if you need to confirm that the VM data remains.
Register an unregistered virtual machine
Registering a VM adds an existing VM back to the vSphere inventory. This is useful after a VM was intentionally removed from inventory, after inventory metadata was lost, or when an existing VM must be made manageable by vCenter Server again.
The registration process uses the VM's .vmx file. This is the virtual machine configuration file. It describes the VM's settings and references its existing virtual disks; registering it does not recreate the disks.
Registration workflow
- Open the datastore browser from the vSphere Client.
- Locate the datastore and folder containing the VM files.
- Find and select the VM's
.vmxconfiguration file. - Open the action for registering the VM, such as Register VM or the equivalent datastore registration action.
- In the registration wizard, select the destination inventory location.
- Select the ESXi host on which the VM should be registered or run.
- Review the selected VM, inventory location, host, and other choices.
- Complete the wizard.
After successful registration, the existing VM returns to the inventory with its existing virtual disks. Registration does not copy or recreate the guest data. If the VM was powered off when unregistered, it normally remains powered off until you deliberately start it.
Delete from Disk
Delete from Disk is the destructive removal action. It removes the VM from the vSphere inventory and deletes its associated files from the datastore, including configuration and virtual disk files that vSphere identifies as belonging to the VM.
Web Client workflow
- Locate and carefully select the correct VM.
- Open the VM's context menu.
- Choose the vCenter action for Delete from Disk.
- Review the confirmation prompt and confirm only after completing the required checks.
After deletion, the VM disappears from the inventory and its datastore storage is removed. This action is irreversible through normal vSphere operations. Recovery requires an available backup or another retained copy of the VM files.
Virtual Machine Removal Decision Checklist
Operational safety practices
- Read the action name carefully. Remove from Inventory means unregistration; it does not destroy VM data.
- Delete from Disk means removal from inventory plus deletion of stored VM files.
- Verify the selected VM using more than its display name when possible, such as its folder, host, datastore, or workload owner.
- Check the datastore browser after inventory removal if you need to confirm that the VM folder and files remain.
- Check the datastore after deletion only as an operational verification; do not assume that missing files can be restored without a backup.
- Review snapshots before deletion. Snapshot files can affect storage use and recovery planning.
- Confirm that backup retention and organizational decommissioning requirements have been satisfied.
Practical examples
Temporarily hide or detach a VM
Suppose a VM should no longer be managed from the current inventory, but its configuration and virtual disks must remain available. Choose Remove from Inventory. The VM disappears from vSphere, while its files remain on the datastore for later registration.
Restore a VM removed from inventory
Browse the datastore, open the VM folder, select its .vmx file, and start the registration wizard. Select an inventory location and ESXi host, review the choices, and finish the wizard. The existing VM and virtual disks are added back without recreating them.
Decommission a retired workload
After confirming that backups, retention obligations, snapshots, and recovery requirements are satisfied, use Delete from Disk. The inventory entry and datastore files are removed, so normal re-registration is no longer possible.
Troubleshooting
The VM removed from inventory is not visible in vSphere
This is expected when the VM was unregistered rather than deleted. Locate its .vmx file in the datastore browser and register the VM again.
The VM cannot be re-registered
Check that you are browsing the correct datastore and VM folder, that the .vmx file exists, and that the account has permission to browse datastore files and register VMs. Also verify that the datastore is accessible to the selected ESXi host.
VM data was expected to remain after Delete from Disk
The destructive option was selected. Delete from Disk removes the inventory record and the VM's datastore files. Recovery is possible only from an available backup or another retained copy.
The wrong removal option is about to be selected
Stop before confirming. Decide whether the VM must remain recoverable from datastore files. If file retention is required, cancel the operation and choose Remove from Inventory instead.
Summary
- Remove from Inventory: unregisters the VM but preserves its datastore files.
- Register VM: uses the existing
.vmxfile to add a retained VM back to inventory. - Delete from Disk: removes the VM from inventory and deletes its datastore files.
- Always verify the VM identity, snapshots, backups, retention requirements, and intended recovery outcome before confirming a destructive action.
For related administration guidance, see virtual machine removal procedures.