Decommissioning the vCenter Server or a Platform Services ControllerPosted: April 9, 2015
Now that vSphere 6 is out, at some point you’ll probably be experimenting in your lab with various vCenter deployment configurations. During my testing I shut down one of my Platform Services Controller (PSC) and vCenter to see how it would impact the other PSC/vCenter it was replicating with. When I logged into the active vCenter I saw the following:
I wanted to remove all references to the old vCenter server (vc6c.vmware.local) so I looked through the vSphere 6 Install, Configuration and Troubleshooting guides but didn’t find anything. They mentioned how to uninstall the vCenter software, but that’s it.
I decided to jump onto my existing PSC and try to see if I could find any commands that may be helpful. Since it’s faster to deploy, I’ve been using the vCenter Service Appliance (VCSA) in my lab. First I ssh to the server and then run the following commands as prompted to enter the shell:
shell.set –enabled True
The first directory that I found with some promising files was the /usr/lib/vmware-vmdir/bin directory.
vc6b:/usr/lib/vmware-vmdir/bin # ll
-rwxr-xr-x 1 root root 62656 Feb 8 06:14 vdcadmintool
-rwxr-xr-x 1 root root 46512 Feb 8 06:14 vdcbackup
-rwxr-xr-x 1 root root 48864 Feb 8 06:14 vdcleavefed
-rwxr-xr-x 1 root root 7640 Feb 8 06:14 vdcpass
-rwxr-xr-x 1 root root 50152 Feb 8 06:14 vdcpromo
-rwxr-xr-x 1 root root 13168 Feb 8 06:14 vdcrepadmin
-rwxr-xr-x 1 root root 44712 Feb 8 06:14 vdcsetupldu
-rwxr-xr-x 1 root root 42648 Feb 8 06:14 vdcsrp
-rwxr-xr-x 1 root root 57320 Feb 8 06:14 vdcupgrade
-rwxr-xr-x 1 root root 332480 Feb 8 06:14 vmkdc_admin
We can run the vdcrepadmin command to see what replication partners are registered:
./vdcrepadmin -f showpartners -h vc6b.vmware.local -u administrator -w VMware1!
Here we see that on my existing vCenter server (vc6b.vmware.local) the only replication parter is the server that I shut down (vc6c.vmware.local).
By specifying showservers as the as a parameter, we can see the distinguished name of all servers:
./vdcrepadmin -f showservers -h vc6b.vmware.local -u administrator -w VMware1!
My first attempt at trying to remove vc6c.vmware.local was by running the vdcleavefed command:
./vdcleavefed -h vc6c.vmware.local -u administrator -w VMware1!
vdcleavefd offline for server vc6c.vmware.local
Leave federation cleanup done
The output looked promising but the warning regarding vc6c.vmware.local being unavailable still remained. I then found article Decommissioning the vCenter Server or a Platform Services Controller (2106736). The KB article says to run the following command:
cmsso-util unregister –node-pnid vc6c.vmware.local –username email@example.com –passwd VMware1!
The output of the command is:
2015-04-09T04:01:20.317Z Running command: [‘/usr/lib/vmware-vmafd/bin/dir-cli’, ‘service’, ‘list’, ‘–login’, ‘firstname.lastname@example.org’]
2015-04-09T04:01:20.378Z Done running command
2015-04-09T04:01:20.449Z Running command: [‘/usr/lib/vmware-vmdir/bin/vdcleavefed’, ‘-h’, ‘vc6c.vmware.local’, ‘-u’, ‘administrator’]
2015-04-09T04:01:26.522Z Done running command
After I logged back into the Web Client I found that the warning regarding my old vCenter was gone. I re-ran the vdcrepadmin command to confirm that the old vCenter was no longer being referenced. The dir-cli service list command appears to only list the running services and the output from the cmsso-util command says the only other command that was ran was the vdcleavefed command, which I had tried previously, so it must be doing something that’s not mentioned in the output. cmsso-util is a Python script so it should be straightforward to see what it’s doing.
I wish VMware had some more documentation around the various SSO commands. I’m compiling my own list as I go along and thought this KB would be a good one to share.