Archive for Decommissioning vCenter and PSC

Decommissioning a Windows 2012 vCenter 6 Server and a Windows 2012 PSC 6 Server

Decommissioning a vCenter 6 Server and a PSC 6 Server

After you deploy a vCenter Server with an embedded Platform Services Controller or a vCenter Server with an external Platform Services Controller, if you no longer need any of the appliances or if an appliance stops responding, you can decommission and delete the appliance from vSphere inventory and domain.

Note
: The process for removing a vCenter Server or a Platform Services Controller from the vSphere domain is irreversible. After you remove an appliance from the domain, you cannot rejoin it to the same domain. You must perform a re-install or a re-deploy of  vCenter Server or Platform Services Controller system in order to re-join it to the domain.

Infrastructure

In my scenario I have 2 PSCs in multisite mode and 1 vCenter connected to each PSC. Note: These are Windows Server 2012 servers. The link at the bottom of the page details the process for the VCSA appliance

  • techlabsso002.techlab.local (Windows 2012 PSC)
  • techlabsso003.techlab.local (Windows 2012 PSC)
  • techlabvcs002.techlab.local (Windows 2012 vCenter connected to techlabsso002)
  • techlabvcs003.techlab.local (Windows 2012 vCenter connected to techlabsso003)

I am going to remove 1 vCenter and 1 PSC from this scenario which will be techlabsso003.techlab.local and techlabvcs003.techlab.local.

Step 1 Decommission the vCenter Server

First of all I want to decommission my vCenter Server from the Platform Services Controller

  • Log into the first PSC server; in my case techlabsso003
  • Browse to C:\ProgramData\VMware\vCenterServer\cfg\install-defaults.
  • Open the vmdir.ldu-guid file to find the hostid.

  • On the Platform Service Controller, click Start > Run, type cmd.exe, and click OK. The Command Prompt window open.
  • Navigate to C:\Program Files\VMware\vCenter Server\bin
  • Run the cmsso-util unregister command to unregister the vCenter Server. Where, vCenter_Server_System_Name is the FQDN or IP address of vCenter Server that you want to decommission. You must run this command only on the Platform Services Controller which your vCenter Server is registered.

cmsso-util unregister --hostId host_Id --node-pnid vCenter_Server_System_Name --username administrator@your_domain_name --passwd vCenter_Single_Sign_On_password

  • You should see the following asking you to confirm you want to unregister the vCenter Server. Note I had to remove the –hostid argument as the command didn’t recognise it

  • You should then see it say Success

  • Power off the vCenter Server

Step 2 Decommission the PSC Server

  • Personally I would shut down the PSC or simply stop the Platform Services Controller services. Note below that I’ve only stopped the Platform Service but all services would need stopping

  • On the PSC to be decommissioned, browse to C:\ProgramData\VMware\vCenterServer\cfg\install-defaults.
  • Open the vmdir.ldu-guid file to find the hostid.

  • On one of the other Platform Service Controllers, click Start > Run, type cmd.exe, and click OK. The Command Prompt window open.
  • Navigate to C:\Program Files\VMware\vCenter Server\bin
  • Run the cmsso-util unregister command to unregister the stopped Platform Services Controller
  • Where, Platform_Services_Controller_System_Name is the FQDN or IP address of the Platform Services Controller that you want to decommission. You must run this command only on one of the Platform Services Controller replication partners, as the synchronization removes the entries from all other Platform Services Controller replication partners.

cmsso-util unregister --hostId host_Id --node-pnid PSC_System_Name --username administrator@your_domain_name --passwd vCenter_Single_Sign_On_password

  • Now you may get errors such as the below

Could not find a host ID which maps to “Servername” in Component Manager

Leave federation cleanup failed. Error [1] – Operations error and Error registering Computer account

  • If either of these occur then make sure you have switched off the PSC to be decommissioned
  • Navigate to C:\Program Files\VMware vCenter Server\vmdird and run the below command

.\vdcleavefed -h -u administrator -w

  • If you get a message to say Leave Federation cleanup done then you can then go ahead and delete the Platform Services Controller appliance that you no longer need from the vSphere inventory.
  • Reviewing the Nodes > Objects tab in the Web Client successfully removed the object from inventory.

Notes on vdcleavefed

cmsso-util leverages vdcleavefed to clean up the machine account, but also goes through and cleans up the solution users and anything else that may have been registered in component manager. It also has some pre-flight checks involved. vdcleavefed on its own will just rip out the machine account, and really should not be used unless in case of an emergency where we are in such a state where cmsso-util will not suffice (e.g. doesn’t work). cmsso-util is the preferred method of cleanup.

Link

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2106736