Loading...

We've detected that your browser language is Chinese. Would you like to visit our Chinese website? [ Dismiss ]
By: Emma

When Should You Remove a Host from vCenter

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:

  • Host Decommissioning or Retirement: When server hardware reaches end-of-life, you need to safely evacuate all VMs and remove the host before physical disposal.
  • Migrating to a New vCenter Instance: If you’re consolidating data centers or upgrading your management infrastructure, you’ll need to disconnect the host from the old vCenter before adding it to the new one.
  • Hardware Replacement: If a host suffers a critical failure, removing it from the inventory lets you replace the node cleanly — especially when the replacement uses the same IP address or hostname.
  • Lab and Test Environment Cleanup: In dev or test setups, hosts are regularly moved between clusters or removed to free up licenses and resources.
  • Troubleshooting Persistent Connection Errors: When a host shows as “Not Responding” or “Inaccessible” and a reconnect doesn’t help, removing and re-adding it can reset the management agents and clear communication issues.

How to Remove an ESXi Host from the vCenter Safely

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.

Prerequisites: What to Do BEFORE Removing the Host

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.

Tip: Not sure whether to use a backup or a snapshot to protect your VCSA? For VM protection before host removal, also consider whether agent-based or agentless backup better fits your environment.

Method 1: Remove Host from vCenter via vSphere Client

The vSphere Client is the most straightforward way to remove a host from the inventory.

  1. Log in to the vSphere Client with an account that has administrator privileges.
  2. In the left-hand panel, go to Menu > Hosts and Clusters.
  3. Right-click the target ESXi host and select Maintenance Mode > Enter Maintenance Mode.
  4. If DRS is enabled on the cluster, vCenter will automatically migrate VMs via vMotion. If not, migrate or power off all VMs manually before continuing.
  5. Once the host displays the Maintenance Mode indicator, right-click the host again.
  6. Select Remove from Inventory.
  7. Click Yes to confirm.
  8. Confirm the host no longer appears in the inventory pane.

remove host from vcenter via GUI

Method 2: Remove Host from vCenter Using PowerCLI

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 

remove host from vcenter with powercli

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.

Note: If DRS is not enabled and VMs are still running, Set-VMHost -State Maintenance will hang until you manually evacuate them.

How to Force Remove a Host When Normal Methods Fail

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.

“Remove from Inventory” Is Greyed Out

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 

Host Is Disconnected or Inaccessible and Won’t Remove

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.

vCenter Is Gone or Unreachable

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.

  1. Enable SSH on the ESXi host and log in as root.
  2. Remove the vpxa agent configuration and restart the host daemon:
rm -rf /etc/vmware/vpxa

/etc/init.d/hostd restart 

 

  1. The host will revert to standalone mode and can now be added to a new vCenter instance without triggering a “Managed by another vCenter” conflict.
Note: This is a last-resort procedure. Only proceed if the original vCenter cannot be recovered.

Backup vCenter VMs Before You Remove a Host

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.

Key Features of i2Backup

  • Agentless VM Backup: i2Backup protects virtual machines without installing agents on each guest. It uses native VMware APIs to perform backups with zero impact on running workloads — no disruption to the VMs you’re migrating or the hosts still in production.
  • Instant VM Recovery: If a VM is lost or corrupted during the host removal process, i2Backup can recover it immediately by remotely mounting the backup to the target platform. There’s no need to wait for a full restore to complete before the VM is usable again.
  • Point-in-Time Recovery: i2Backup captures continuous backup logs and maintains multiple restore points. If a VM ends up in a bad state after migration, you can roll it back to a specific point before the issue occurred.
  • Centralized Web-Based Management: All backup tasks are managed through a web console, with real-time status updates and scheduling controls. You can set up automated backup jobs before starting any host removal operation and monitor progress from a single interface.

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.

FREE Trial for 60-Day

After Host Removal: What’s Next?

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.

  • Verify License Release: After removal, the host’s license should return to the vCenter license pool automatically. Go to Administration > Licensing > Licenses and confirm the available seat count has increased.
  • Power Off the Host: If you’re decommissioning the hardware, physically power it off and remove it from your rack and management network.
  • Add to New vCenter Instance: If you’re migrating the host, add it to the new vCenter using the Add Host wizard in the vSphere Client, or use PowerCLI with Add-VMHost.
  • Clean Up Orphaned Objects: Check the inventory for any VMs or datastores marked as (orphaned) or (invalid). These are typically leftovers from the removed host and should be deleted from the vCenter database manually.
  • Confirm Backup Coverage: Run a backup job for any VMs that were migrated to new hosts. This verifies that your backup solution recognizes them in their new location and that protection is still active.

Conclusion

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. 

Emma
Emma is the bridge between complex engineering and the people who need it. As a content creator at Info2Soft, she spends her days translating "tech-speak" into clear, actionable stories about data resilience. She’s not just documenting software; she's uncovering how data replication and recovery actually change the way businesses run.

More Related Articles

Table of Contents:
Stay Updated on Latest Tips
Subscribe to our newsletter for the latest insights, news, exclusive content. You can unsubscribe at any time.
Subscribe
Ready to Enhance Business Data Security?
Start a 60-day free trial or view demo to see how Info2Soft protects enterprise data.
{{ country.name }}
Please fill out the form and submit it, our customer service representative will contact you soon.
By submitting this form, I confirm that I have read and agree to the Privacy Notice.
{{ isSubmitting ? 'Submitting...' : 'Submit' }}