This website use cookies to help you have a superior and more admissible browsing experience on the website.
Loading...
In a stable vSphere environment, hosts stay managed by vCenter to keep features like vMotion, High Availability (HA), and Distributed Resource Scheduler (DRS) running smoothly. But there are situations where removing a host from the inventory is the right call:
There are two ways to do this — via the vSphere Client GUI or PowerCLI. Either way, the prerequisites are the same. Complete the checklist below before using either method.
Before you remove a host, you need to prepare it properly. Skipping these steps is a common mistake that can leave orphaned VMs, broken network paths, or “ghost” objects stuck in your vCenter database.
| Step | Action | Why It Matters |
|---|---|---|
| 1 | Evacuate or Power Off All VMs : Use vMotion if DRS is enabled; otherwise migrate or shut down VMs manually. | Prevents data loss and ensures no workloads are disrupted during removal. |
| 2 | Remove Host from vDS: Migrate VMkernel adapters and VM networks to a standard vSwitch, or remove the host from the vDS entirely. | Skipping this causes networking errors if the host is re-added to another vCenter later. |
| 3 | Unmount and Detach Storage: Unmount and detach any iSCSI or NFS datastores used exclusively by this host. | Prevents All Paths Down (APD) conditions on the storage array. |
| 4 | Check HA Admission Control: Verify that removing the host won’t leave the cluster without enough failover capacity. | Avoids violating HA admission control policy and leaving VMs unprotected. |
| 5 | Enter Maintenance Mode: Put the host into Maintenance Mode before proceeding. | Signals vCenter to stop assigning tasks to the host and confirms all VMs are off it. |
| 6 | Back Up vCenter: Take a file-based backup of the VCSA. Do not use a VM snapshot as a substitute. | Gives you a recovery point before making inventory changes. |
The vSphere Client is the most straightforward way to remove a host from the inventory.
PowerCLI is the better option when you’re managing multiple hosts or need to automate the removal process as part of a larger script.
# Connect to vCenter
Connect-VIServer -Server
# Set host to Maintenance Mode
$VMHost = Get-VMHost -Name
$VMHost | Set-VMHost -State Maintenance
# Remove host from inventory
$VMHost | Remove-VMHost -Confirm:$false
Connect-VIServer opens an authenticated session with your vCenter Server. Set-VMHost -State Maintenance places the host into Maintenance Mode — a required step before removal. If the cluster has DRS enabled, add -Evacuate to automatically trigger vMotion for any remaining VMs:
$VMHost | Set-VMHost -State Maintenance -Evacuate
Once in Maintenance Mode, Remove-VMHost removes the host from the vCenter inventory. The -Confirm:$false flag suppresses the confirmation prompt for use in automated scripts.
Set-VMHost -State Maintenance will hang until you manually evacuate them.Sometimes the standard removal process fails due to database locks, network issues, or stuck management tasks. The three scenarios below cover the most common reasons and how to clear them.
If the option is unavailable in the vSphere Client, vCenter has likely detected a dependency that hasn’t been cleared yet.
Check vDS membership: Make sure the host has been fully removed from any vSphere Distributed Switch (vDS), including uplink and port group configurations. This is the most common reason the option is greyed out.
Cancel active vLCM tasks: A running scan or remediation task from vSphere Lifecycle Manager (vLCM) can lock the host object. Check for active tasks in the Recent Tasks panel and cancel any that involve the host before retrying.
Force removal via PowerCLI: If the GUI remains unresponsive after clearing the above, use the -Force flag:
Remove-VMHost -VMHost -Force
When a host loses connectivity to vCenter, it may enter a “Not Responding” or “Inaccessible” state. vCenter may block removal because it can’t confirm the host’s current status.
Restart management agents: If you still have SSH or DCUI access to the ESXi host, restart the management agents to re-establish communication with vCenter:
services.sh restart
This refreshes both hostd and vpxa. Once the host reconnects, retry the normal removal steps.
Force removal: If the host is permanently offline and cannot be recovered, use Remove-VMHost -Force to delete the host entry from the vCenter database without waiting for a response from the server.
If your vCenter Server is permanently lost and you need to add the ESXi host to a new vCenter instance, you’ll need to manually clear the management agent on the host.
root.rm -rf /etc/vmware/vpxa
/etc/init.d/hostd restart
Before removing a host from vCenter, make sure every VM that was running on it is properly backed up. Even with careful preparation, things can go wrong, like a VM may not migrate cleanly, a snapshot may be left uncommitted, or a datastore may become inaccessible mid-process. A backup gives you a recovery point if any of that happens.
For production environments, manual snapshots aren’t enough. You need an automated, enterprise-grade solution that protects your VMs consistently and lets you recover quickly without downtime. That’s where i2Backup comes in.
Backing up your VMs before a host removal is a simple step that eliminates a significant amount of risk. With Info2soft’s i2Backup handling protection automatically, you can carry out the removal process with confidence — and recover quickly if anything goes wrong.
Removing the host from inventory is only part of the process. Run through the following tasks to make sure your environment stays clean and nothing gets left behind.
Add-VMHost.VMs evacuated, vDS dependencies cleared, and Maintenance Mode entered before you proceed. For hosts that won’t respond to normal methods, PowerCLI’s -Force flag and the vpxa reset procedure are your reliable fallbacks.
Before you start, back up your VMs. A clean migration can still go wrong, and a recent recovery point is the fastest way to resolve it if it does. So make sure you choose the agentless VM backup solution like i2Backup carefully to protect your data safely.
After removal, spend a few minutes verifying license release, clearing orphaned objects, and confirming that backup coverage has followed your workloads to their new location.