Clear Stale Entries of vCenter Server from Single Sign-On

  • Post category:VMware / Vmware vSphere
  • Post last modified:January 6, 2020
Clear Stale Entries of vCenter Server from Single Sign-On

While working on a case I got into a situation where the customer has removed a vCenter Virtual Machine from the Datastore and now wanted me to clear its stale entries from the Existing vCenter.

While opening the vCenter customer was getting the Error: “Could not connect to one or more vCenter Server systems: https://192.120.2.200:443/sdk

vCenter Name: 192.120.2.200 was the one which the customer deleted without properly taking it down.

Now the Simplest way to Clear Stale Entries of vCenter Server from Single Sign-On is using the below Command:

cmsso-util unregister --node-pnid <vCenter Name> --username administrator@vsphere.local --passwd <vCenter Password>

Example: cmsso-util unregister –node-pnid 192.120.2.200 –username administrator@vsphere.local –passwd @Asd1992

The proper way of decommissioning a Server:

If you have a multiple PSC in your environment. First, you will have to find the PSC to which the vCenter which you want to Decommissioning is pointing:

To Find this run the command:

VCSA:

#/usr/lib/vmware-vmafd/bin/vmafd-cli get-ls-location --server-name localhost

Windows VC:

C:\Program Files\VMware\vCenter Server\vmafdd\vmafd-cli get-ls-location --server-name localhost

The process to Decommission a vCenter:

vCenter Server Appliance:

  • Log in as root to the appliance shell of the Platform Services Controller appliance with which the vCenter Server Appliance is registered.
  • To enable the Bash shell, run the command
shell.set --enabled
  • Run the shell command to start the Bash shell and log in.
  • Run the cmsso-util unregister command to unregister the vCenter Server Appliance:
cmsso-util unregister --node-pnid vCenterServer_System_Name --username administrator@your_domain_name --passwd vCenter_Single_Sign_On_password
  • Power Off the VM and remove it from the Inventory.

Windows vCenter Server:

  • On the Platform Service Controller, click Start > Run, type cmd, and click OK. The Command Prompt window opens.
  • Navigate to C:\Program Files\VMware\vCenter Server\bin\.
  • Run the cmsso-util unregister command to unregister the vCenter Server:
cmsso-util unregister --node-pnid vCenter_Server_System_Name --username administrator@your_domain_name --passwd vCenter_Single_Sign_On_password
  • Power Off the VM and remove it from the Inventory.

While Removing vCenter you might get an error “unable to find host id” you can run the below command:

cmsso-util unregister --hostId <host id> --node-pnid vCenter_Server_System_Name --username administrator@your_domain_name --passwd vCenter_Single_Sign_On_password

The process to decommission a Platform Services Controller

In order to Decommission the PSC from your environment, you will have to make sure that no vCenter server is pointing out to this PSC. Please refer to the Article: https://knowitlikepro.com/repoint-the-psc-in-vcenter-environment/ for more information on how we can repoint the vCenter from One PSC to another.

Platform Services Controller Appliance:

  • In the Platform Service Controller, click Start > Run, type cmd, and click OK. The Command Prompt window opens.
  • Navigate to C:\Program Files\VMware\vCenter Server\bin\.
  • Run the cmsso-util unregister command to unregister the stopped Platform Services Controller:
cmsso-util unregister --node-pnid PSC_System_Name --username administrator@your_domain_name --passwd vCenter_Single_Sign_On_password
  • Power Off the VM and remove it from the Inventory.

Windows Platform Services Controller:

  • In the Platform Service Controller, click Start > Run, type cmd, and click OK. The Command Prompt window opens.
  • Navigate to C:\Program Files\VMware\vCenter Server\bin\.
  • Run the cmsso-util unregister command to unregister the stopped Platform Services Controller:
cmsso-util unregister --node-pnid PPSC_System_Name --username administrator@your_domain_name --passwd vCenter_Single_Sign_On_password
  • Power Off the VM and remove it from the Inventory.

Ashutosh Dixit

I am currently working as a Senior Technical Support Engineer with VMware Premier Services for Telco. Before this, I worked as a Technical Lead with Microsoft Enterprise Platform Support for Production and Premier Support. I am an expert in High-Availability, Deployments, and VMware Core technology along with Tanzu and Horizon.

Leave a Reply