Unable to remove license key from vCenter server 6.0 due to stale licensing entry in VMware Directory.
• ESXi host in the licensing section are seen grayed out.
• Trying to assign the license on the host throws an error stating there is no enough license to be assigned
• This issue is generally encountered post reinstalling vCenter on a external PSC
This issue occurs when we have stale entries in the VMware Directory.
PSC takes care of licensing section hence any modification done at the vCenter should be done in a proper manner.Whenever vCenter is not uninstalled properly or reinstalled on the same machine the metadata cleanup does not occur where we tend to see stale licenses since every installation of vCenter will create a new instance causing PSC to assume a new installation has occurred. If the un-installation do not succeed properly we would find 2 instances where in one would be the current instance and the other would be a stale one
To differentiate between the stale and actual entry of the VC using jxplorer, Easiest way would be to get the active instance id of the underlying vCenter from instance.cfg.
Windows vCenter C:\programdata\VMware\vCenterserver\cfg\vmware-vpx\instance.cfg.
vCenter Appliance /etc/vmware-vpx/instance.cfg
To differentiate between host uuid you can access that information from vmdir.ldu-guid.
Windows vCenter C:\ProgramData\VMware\vCenterServer\cfg\install-defaults.
vCenter Appliance /etc/vmware/install-defaults
In jxplorer you would find 2 instances of the vCenter. One would be with entry mentioned in instance.cfg/vmdir.ldu-guid and the other would be the stale one.
Steps to install and use jxplorer can be found in the below link
Jxplorer(in the above image)
For eg current entry in instance.cfg is 5206ff5e-bb83-4b5d-a3e8-5408c4580879 and vmdir.ldu-guid is 7207cnn3d-9c77-11e6-93ab-005056a6a627ba
AssetEntity_5206ff5e-bb83-4b5d-a3e8-5408c4580879-7207cnn3d-9c77-11e6-93ab- 005056a6a627ba where
5206ff5e-bb83-4b5d-a3e8-5408c4580879—vCenter instance id
7207cnn3d-9c77-11e6-93ab-005056a6a627ba –host instance id
4B776AC7-5BF7-4626-ACA1-A37180356AAD—vCenter instance id
995a020f-1cfb-11e5-a5b5-005056a627ba—host instance id
VMwLicSvcAsset name(identifier) – to differentiate the stale and actual entries hostname would be common for both under VMwLicSvcAsset name on the right hand side in details section illustrated in second screenshot.)
AssetEntity-Value–> implies the vCenter entry
AssetEntity_host-Value–>implies the host entry
Currently 5206ff5e-bb83-4b5d-a3e8-5408c4580879 is considered as active instance & the other instance would be considered stale. I.e 4B776AC7-5BF7-4626-ACA1-A37180356AAD
Before proceeding to modify any content ensure you have performed two things
• Take a active snapshot of all the vCenter and PSC currently available in the environment
• Stop the licensing service from PSC.
Based on the previous data we have to go ahead and remove stale entries which match the host entry with uuid 995a020f-1cfb-11e5-a5b5-005056a627ba (Any stale entries associated with host needs to be removed)
The reason being id 995a020f-1cfb-11e5-a5b5-005056a627ba is generated along with older(stale) instance where any entry associated with this respective id is considered stale and needs to be removed.
Right click and click on delete in order to delete any entry as shown below. Below screenshot is just taken as an eg and does not match the eg we have taken in to consideration.
For instance(Every host entry that would be stale will end up with same id making it easier to differentiate between actual and stale instance).
Host entry which is currently active would be host uuid ending with 7207cnn3d-9c77-11e6-93ab-005056a6a627ba
Once the associate host entries are removed you can go ahead and remove the Stale vCenter instance
Once all the respective stale entries are removed go ahead and start the licensing service. Login to the web client and verify if all the underlying stale entries are removed. You should be able to achieve adding the license henceforth
To avoid such issue going forward ensure you perform a clean uninstallation or unregister the vCenter from PSC.