ESXi Agent Manager (EAM) does auto-cleanup of orphaned VMs
search cancel

ESXi Agent Manager (EAM) does auto-cleanup of orphaned VMs

book

Article ID: 321003

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides information about the new vSphere ESX Agent Manager (EAM) orphaned VMs automatic clean up capability added in vSphere 7.0 Update 1. The article provides details about how it works, and what are the workflows that it impacts.

Environment

VMware vSphere 7.0.x

Resolution

What is this new capability?

New capability introduced in vSphere 7.0U1 automatically cleans up VMs provisioned by EAM which do not have a corresponding agency (Orphaned VMs). EAM powers off and deletes such VMs. A VM becomes orphaned in the following cases:
  • А host with EAM agent VMs is moved from one vCenter to another.
  • A host with EAM agent VMs is disconnected from a vCenter Server, the Agency is destroyed, and the host is reconnected to the vCenter Server.
  • Cluster with agent VMs is removed from the inventory, the Agency is destroyed, and some of its hosts which containing agent VMs are added back to the vCenter Server later.
  • An agent VM is moved from one vCenter Server to another.
  • Any other case in which an agent VM is presented in a vCenter Server and EAM does not have a corresponding Agency for this VM.
Note: EAM does not support cross vCenter Server agencies. One vCenter Server does not have knowledge for the EAM agencies in another vCenter Server.

Why did VMware introduce this new capability?

Previously (in releases 6.5 and 6.7) EAM did not remove the orphaned VMs. This was a known limitation and it was expected that EAM’s clients will remove them manually if needed. In vSphere 7.0 Update 1, it was decided to address the limitation by having EAM perform automatic cleanup of orphaned VMs as that would also help with the below:
  • Improvement of the user experience.
  • Reduce vCenter Server resources consumption.
Starting with vSphere 7.0 Update 1c, VMware made this EAM auto-cleanup capability optional.
Prior to vSphere 7.0 Update 1, this is the default behavior. 

For example:

EAM will auto-cleanup only the vSphere Cluster Services (vCLS) VMs and other VMs are not cleaned up. 
In vSphere 7.0 Update 1c, if EAM is needed to auto-cleanup all orphaned VMs, this configuration is required:

Note: EAM can be configured to cleanup not only the vCLS VMs but also all VMs which are provisioned by vCLS and considered as orphaned.
  1. Connect to the vCenter Server appliance through SSH.
  2. Open /usr/lib/vmware-eam/web/webapps/eam/WEB-INF/classes/eam-server-beans.xml.
  3. Find entry:

    <bean id="orphanedChecker"
    class="com.vmware.eam.vc.vm.orphaned.impl.OrphanedChecker"><constructor-arg value="true"/></bean>

     
  4. Change the "constructor-arg" value to false.
  5. Restart the EAM service by running this command:

    /usr/lib/vmware-vmon/vmon-cli -r eam