VMware ESXi and vSphere Cluster Management

Remove a Virtual Machine in VMware vSphere and ESXi

Learn how to remove a VMware VM from inventory, delete its datastore files, and re-register an existing VM safely.

VMware vSphere provides two different removal actions for a virtual machine (VM): Remove from Inventory and Delete from Disk. They have very different effects on the VM's files.

Use Remove from Inventory when you want to unregister the VM but retain its files on a datastore. Use Delete from Disk only when the VM and its stored data are no longer needed and permanent deletion is intended.

Important terms

  • vSphere inventory: The organizational view managed by vCenter Server and ESXi that contains VM objects, hosts, and their placement.
  • Datastore: Storage presented to an ESXi host that contains VM folders, configuration files, virtual disks, snapshots, and related files.
  • Unregister: Remove a VM's configuration from the host or vCenter inventory without necessarily deleting its files.
  • Register: Add an existing VM configuration back into the vSphere inventory.
  • .vmx file: The VM configuration file used when registering an existing VM.
  • vSphere Client: The web-based interface used to manage VMs, hosts, and datastores.
  • ESXi host: The VMware hypervisor server on which a VM is registered and runs.

Remove from Inventory versus Delete from Disk

The two actions can look similar because both make the VM disappear from the inventory. The difference is what happens to the VM's datastore files.

Action: Remove from Inventory
Removed from inventory: Yes
Files retained: Yes
Can be re-registered: Yes, if the .vmx file remains
Data-loss risk: Normally none to the retained files
Typical use: Temporarily hide a VM, move it administratively, or retain it for later use

Action: Delete from Disk
Removed from inventory: Yes
Files retained: No; associated datastore files are removed
Can be re-registered: Not from the deleted files
Data-loss risk: High and normally irreversible
Typical use: Retire a VM and permanently remove its stored data

Remove a VM from inventory

Remove from Inventory unregisters the VM from the ESXi host and vCenter Server inventory. The VM object disappears from the vSphere Client, but the VM folder and its files remain on the datastore.

This is appropriate when a lab VM is temporarily unused, when a VM must be hidden from an inventory view, or when you plan to move or later re-register the VM. It is also the safer choice when you are uncertain whether the stored data must be preserved.

Procedure in the vSphere Client

  1. Locate and select the correct virtual machine.
  2. Open the VM's available vCenter actions, commonly by selecting the actions menu or right-clicking the VM.
  3. Choose Remove from Inventory.
  4. Read the confirmation prompt and confirm only after verifying that the files should remain on the datastore.

After confirmation, the VM no longer appears in the inventory. Its datastore folder, .vmx configuration file, virtual disks, and other retained files remain available for storage management or later registration.

Example: temporarily removing a lab VM

If a lab VM is not needed in the current inventory but may be used next week, choose Remove from Inventory. The expected result is that the VM disappears from the inventory while its folder and .vmx file remain on the datastore.

Re-register a VM after removing it from inventory

Re-registration restores an existing VM to the vSphere inventory. It does not recreate the guest operating system or virtual disks. vSphere reads the existing .vmx configuration file and creates an inventory object for those existing files.

The ESXi host selected during registration must have access to the datastore containing the VM folder.

Find the VM configuration file

  1. Open the datastore storage view in the vSphere Client.
  2. Use the datastore browser to locate the folder belonging to the VM.
  3. Identify the VM's .vmx configuration file.
  4. Confirm that the folder and files belong to the intended VM before starting registration.

Register the existing VM

  1. Select the .vmx file in the datastore browser.
  2. Choose Register VM.
  3. In the Register Virtual Machine wizard, select the inventory location, such as a datacenter, folder, or other permitted placement.
  4. Select the ESXi host on which the VM will be registered and run.
  5. Review the wizard settings, including the selected VM, inventory location, and host.
  6. Finish the wizard.

Step: Locate storage
Location: Datastore browser
Administrator action: Open the VM folder and find the .vmx file
Expected result: The existing VM configuration is identified

Step: Start registration
Location: Datastore browser
Administrator action: Select the .vmx file and choose Register VM
Expected result: The registration wizard opens

Step: Choose placement
Location: Register Virtual Machine wizard
Administrator action: Select the inventory location
Expected result: vSphere knows where to place the VM object

Step: Choose host
Location: Register Virtual Machine wizard
Administrator action: Select an ESXi host with access to the datastore
Expected result: The VM has a host on which it can run

Step: Complete registration
Location: Review page in the wizard
Administrator action: Verify settings and finish
Expected result: The VM returns to the inventory without recreating its files

After successful registration, the VM appears in the selected inventory location and can be managed normally. If the intended host cannot see the datastore, select a host with the required storage access or correct the host's storage connectivity first.

Delete a VM from disk

Delete from Disk removes the VM from the vSphere inventory and deletes its associated files from datastore storage. This can include the VM configuration, virtual disks, snapshots, and other files in the VM folder, depending on the storage layout and file associations.

Treat this as an irreversible deletion operation in normal administrative use. Inventory actions cannot restore files that have been deleted from the datastore.

Procedure in the vSphere Client

  1. Select and verify the correct virtual machine.
  2. Open the VM's available vCenter actions, commonly by selecting the actions menu or right-clicking the VM.
  3. Choose Delete from Disk.
  4. Confirm the prompt only after validating that permanent deletion is intended.

When the operation completes, the VM disappears from inventory and its associated datastore files are removed.

Example: retiring an obsolete test VM

For an obsolete test VM, first confirm the VM identity and verify that no backup or retained copy is needed. Then choose Delete from Disk and confirm. The expected result is removal of both the inventory entry and the VM's datastore files.

Decision checklist

  • Verify the VM name, guest purpose, and operating system so that the correct VM is selected.
  • Check the datastore and folder containing the VM files.
  • Determine whether the VM must be retained, moved, reviewed, or permanently erased.
  • Check backup, export, replica, and recovery requirements.
  • Review snapshot status and any snapshot-related files before deletion.
  • Choose Remove from Inventory when storage contents must remain available.
  • Choose Delete from Disk only when the VM and its stored data are no longer needed.
  • Read the confirmation dialog carefully before committing the operation.

Troubleshooting

The VM removed from inventory is no longer visible

This is the expected result of unregistering a VM. Browse the datastore, locate the VM folder and its .vmx file, and register the VM again.

The .vmx file cannot be found

Verify that you are browsing the correct datastore and folder. The files may have been moved, the wrong VM may have been selected, or the VM may have been deleted from disk. If the files were permanently deleted, recovery requires an available backup, export, replica, or other independent copy.

The VM cannot be registered on the intended ESXi host

The host may not have access to the datastore containing the VM files. Select a host with datastore access or correct the host's storage connectivity before registering the VM.

An administrator expected Delete from Disk to be recoverable

Delete from Disk is not the same as Remove from Inventory. The former deletes the stored files, so recovery depends on an independent backup or another recovery copy. Inventory actions alone cannot restore deleted datastore data.

Exam-relevant notes

  • Remove from Inventory: unregisters the VM but retains its datastore files.
  • Delete from Disk: unregisters the VM and deletes its datastore files.
  • An unregistered VM can be restored by registering its existing .vmx file.
  • The ESXi host used for registration must have access to the VM's datastore.
  • When uncertain about data retention, Remove from Inventory avoids the immediate storage deletion associated with Delete from Disk.

For broader administration practice, review VMware ESXi administration, adding an ESXi host to vCenter Server inventory, and communication between vCenter Server and ESXi.