Wednesday 1 August 2012

How to uninstall vCenter Server Agent from ESX/ESXi host

ESX

  • SSH into the host
    • Stop the vCenter agent process.  –>service vmware-vpxa stop
      • This also sometimes completed right away, and other times, just took more time than it should have.
    • Stop the hostd process.  –> service mgmt-vmware stop
      • At this point, typically the host would finally disconnect from vCenter, if it hadn’t already completed the disconnect process issued earlier.
    • Delete the user account vCenter uses to communicate with the host.  –> userdel vpxuser
    • Find all of the vCenter and HA processes.  –> rpm -qa |grep -iE ‘vpx|aam’
    • Delete the RPM’s found earlier –> rpm -e
    • Start the hostd process. –> service mgmt-vware start
  • Now that’s all done.  Go back into vCenter and reconnect the host.

ESXi

ESXi is a slightly different beast.  Since it doesn’t use a Red Hat based service console, there are no RPM’s to remove as was done above.  To remove the agents from ESXi:
  • SSH into the host
    • Delete the user account vCenter uses to communicate with the host.  –> userdel vpxuser
    • Move into the uninstaller directory –> cd to /opt/vmware/uninstallers
    • Remove the HA/aam agent –> ./VMware-aam-ha-uninstall.sh to
    • Remove the vCenter agent –> ./VMware-vpxa-uninstall.sh to
  • Now that’s all done.  Go back into vCenter and reconnect the host