Home > Blogs > VMware vSphere Blog


Cleanup vCloud Director Agent from Host with Running VMs

Typically, unpreparing a host in vCloud Director is fairly straightforward and works without issue. In the rare occasion it doesn’t work, there are posted workarounds for manually removing the vcloud-agent from the vSphere Host through the esxcli. Well, what about the even rarer chance you need to remove the vCloud Director agent from a vSphere Host while it still has workloads (VMs) running on it?

I can’t speak for the type of support you’d get in a situation like this, so consider this to be unsupported as of now. Imagine the scenario you, for some reason, lost or deleted your vCloud Director instance and needed to rebuild it and add your hosts back in but they have workloads powered on that you just can’t power off or migrate for whatever reason.

Well, here’s a workaround that can get you out of trouble in a pinch (again, I’m assuming this is your lab environment, unless you’ve checked with VMware support for their blessing on performing this action).

Log into the ESXi (vSphere Host) shell and perform the following action:

esxcli software vib remove -n="vcloud-agent" --maintenance-mode

Successfully removed agent while not requiring a reboot:

Now, you will be able to go into your new vCloud Director environment and prepare this host:

This host has been successfully prepared:

So, not all is lost if you ever encounter this situation. I keep trying to think of all the situations in which this type of action would need to occur (no VMotion availalbe, host affininity requirements, etc), and I come up with many blanks. I’d be curious to hear from you if you have run into this or if you run “other” workloads on your vCloud Director hosts (required appliances unrelated to vCloud Director that need host affinity?).

Get notification of new blog postings and more by following Harry on Twitter: @HarrySiii

This entry was posted in vCloud Director and tagged , , , , , on by .
Harry Smith

About Harry Smith

Harry Smith is a Senior Technical Marketing Manager in the SDDC Technical Marketing group at VMware. Harry currently focuses on the Software-Defined Datacenter infrastructure, including the vCloud Suite and other products that may go along with it. Previous to Technical Marketing, Harry worked within the VMware Professional Services Organization. His main focus was vCloud Director (and Lab Manager) private clouds, especially SDLC (Test/Dev) in the cloud. He has a long history with vCloud/vSphere Architecture Design, as well as concentrating on business, people, and process to assist in the adoption of virtualization strategies to align with business goals. Get notification of new blog postings and more by following Harry on Twitter: @HarrySiii

4 thoughts on “Cleanup vCloud Director Agent from Host with Running VMs

  1. Jonathan

    Harry,

    The blog post discusses how to remove a cloud agent without maintenance mode/reboot.

    But when vCloud prepares the host, vCloud wants to put the host into maintenance mode in order to install the vcloud agent. So we are stuck with the same problem.

    Why can a new vCloud instance not recognize the pre-existing vCloud agents on the host without requiring a repeated preparation and thus maintenance mode ?

  2. kevin klueber

    i have a situation where i am trying to dcom a host. there are no VMs runniing on the host but vcloud director thinks it has running VMs. so i can’t unprepare the host. how do get vcd sync’d up?

  3. Ramasudhakar

    i have a situation where i am trying to dcom a host. there are no VMs runniing on the host but vcloud director thinks it has running VMs. so i can’t unprepare the host. how do get vcd sync’d up?

Comments are closed.