Time to read:
In this post we are going to go over a potential solution to not being able to add a VMware ESXi host to vCenter Server because it cannot complete the license assignment operation.
For reference my VMware set up is version 7 with 2 vCenter Server Appliances connected via Enhanced Linked Mode. The fact there are 2 vCenter Server Appliances (VCSAs) is the main cause of the issue and I will explain why later in the post.
SECTION I – The Problem
When trying to add a new ESXi 7.0.3 host to one of my vCenter instances I get the following error message:
Failed to add ESXi host: Cannot complete license assignment operation
Before we get into my solution for the problem make sure that you have covered off the basics:
- The licensing service is running on the vCenter instance.
- You have available licenses with the required features and correct number of vCentral Processing Units (vCPUs) for the ESXi host you are trying to add.
Once you are happy that the basics are correct and you still get the same error then you are in the same position I was so hopefully the solution in Section II works for you.
SECTION II – The Solution
The solution I found revolved around the VMDir which is synced between my multiple VCSA instances. If for some reason the VCSA instances VMDir fall out of sync for too long then one or both of them will convert into a read only mode in a way to protect itself from changing before they can be synced. I have seen the VMDir state being in read only mode cause a lot off strange things within VCSA where you cannot carry out normal operations.
To check the read only state connect to the VCSA instance via Secure Shell (SSH) and then enter the following command:
/usr/lib/vmware-vmdir/bin/vdcadmintool
This will bring up a number options menu, select the number 6 to view the current state of the VMDir.
If the output says Read Only then you will not be able to add ESXi hosts to the VCSA instance.
In order to change the state of the VMDir enter the following command again:
/usr/lib/vmware-vmdir/bin/vdcadmintool
This time select option 5 and then enter ‘NORMAL’.
Now if you check the state of the VMDir again you should see that it says its in Normal mode. If it is then you should be able to add the ESXi host to the VCSA instance.
Keep an eye on the VMDir state to see if either VCSA instance switches back to Read Only mode because if it does then you have a bigger issue of the instances not replicating properly that you need to fix.


Leave a comment