First try the steps in this KB to clear the licenses from the vCenter object:
Removing License in vCenter if you are not able to remove from License Manager or JXplorer
If that fails then please follow the steps below.
Fix licenses assigned to the vCenter
- Take a powered off snapshot of the vCenter Server. If in ELM please power off all vCenter nodes and then snapshot them. See: VMware vCenter in Enhanced Linked Mode pre-changes snapshot (online or offline) best practice
- Record the currently assigned vCenter license key.
- Record vCenter Server ID
- Open SSH connection to vCenter as root
- cat "/etc/vmware-vpx/instance.cfg"
Note down the instance UUID "instanceUuid=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
- Obtain current vCenter Node LDU ID with command:
- /usr/lib/vmware-vmafd/bin/vmafd-cli get-ldu --server-name localhost
yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
- Remove license associated with current LDU ID by command:
- /opt/likewise/bin/ldapdelete -H ldap://localhost -D "cn=administrator,cn=users,dc=vsphere,dc=local" -W "cn=AssetEntity_<XXXXX>-<yyyyyyyy>,cn=LicenseService,cn=Services,dc=vsphere,dc=local"
- Note:
Adjust dc=vsphere,dc=local to reflect the environment's SSO domain
Replace XXXXXXXX with the vCenter service ID from step 1 in capital letters
Replace yyyyyyyy with the LDU ID from above Step 4.
- If the above step (e) fails to remove the license with an error similar to: ldap_delete: No such object (32) additional info: (9703)((MDB_NOTFOUND: No matching key/data pair found
- Then confirm if the command is typed out correctly, and that the domain matches what is configured for vCenter SSO.
- Reboot vCenter and re-assign the license.
Remove all licenses assigned to the vCenter
- If the vCenter asset is showing multiple still times then run a full removal for all the License AssetEntity_ID's in the vCenters LDAP:
- /opt/likewise/bin/ldapsearch -b "dc=vsphere,dc=local" -s sub -D "cn=Administrator,cn=Users,dc=vsphere,dc=local" -W > $(hostname)_"date +"%m-%d-%Y"".ldif
- Cat hostname_m-d-Y.ldif
- Find the AssetEntity_ID that matches the Service ID (From step 1b above) for vCenter server and is under the License Service. Search for the "vmwLicSvcAssetName" that has vCenters FQDN that listed. Near it will be all the other licenses under vCenter in the LDIF output.
There should be 2-3 that are associated with the vCenter Server License. One for the Evaluation License, one for the vCenter Server asset that gets assigned the licene, and one for the License you are trying to use.
- Notate down the 2-3 AssetEntity_ID's for the Eval License, vCenter License, and vCenter asset.
- Run a ldapdelete for all 3 assets:
-
- /opt/likewise/bin/ldapdelete -H ldap://localhost -D "cn=administrator,cn=users,dc=vsphere,dc=local" -W "cn=AssetEntity_<ZZZZZZZZ-ZZZZ-ZZZZ-ZZZZ-ZZZZZZZZZZZZ>,cn=LicenseService,cn=Services,dc=vsphere,dc=local"
- Reboot vCenter and re-assign the license.