VMware Cloud Community
waldronmct
Contributor
Contributor

"Corrected" Steps to Set Up Bulk Licensing (Fixed Manual Typo)

As the procedure on Pages 71-72 for setting up Bulk Licensing has still not been fixed (it still contains a typo and that one typo will keep it from working and it took me 2 days to track it down), I'm posting the corrected steps here, in their entirety.  The key is that first line in step 3.  In the published manual there is an un-necessary period between Vim and Automation, below there is no period.  I hope someone finds this useful and saves them two or more days of hair pulling and searching.

Procedure

  1. Connect to the vCenter Server system you want to use and bind the associated license manager to a variable.

    Connect-VIServer -Server 192.XXX.X.XX -User username -Password password
    $licenseDataManager = Get-LicenseDataManager

  2. Run a cmdlet that retrieves the datacenter in which the hosts for which you want to use the bulk licensing feature are located.

    $hostContainer = Get-Datacenter -Name Datacenter-X

    You can also run a cmdlet that retrieves a cluster to use bulk licensing for all hosts in a cluster, or retrieves a folder to use bulk licensing for all hosts in a folder.
  3. Create a new LicenseData object and a LicenseKeyEntry object with associated type ID and license key.

    $licenseData = New-Object VMware.VimAutomation.License.Types.LicenseData
    $licenseKeyEntry = New-Object Vmware.VimAutomation.License.Types.LicenseKeyEntry
    $licenseKeyEntry.TypeId = "vmware-vsphere”
    $licenseKeyEntry.LicenseKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"

  4. Associate the LicenseKeys attribute of the LicenseData object you created in step 3 with the LicenseKeyEntry object.

    $licenseData.LicenseKeys += $licenseKeyEntry

  5. Update the license data for the data center with the LicenseData object and verify that the license is associated with the host container.

    $licenseDataManager.UpdateAssociatedLicenseData($hostContainer.Uid, $licenseData)
    $licenseDataManager.QueryAssociatedLicenseData($hostContainer.Uid)

0 Kudos
8 Replies
txl5858
Contributor
Contributor

Greetings. Just wondering if you or anyone has had success using this with Auto-deploy? I have run the commands as shown, and the last one (the query) shows the correct association. Events in VCenter show the default license has been updated for the datacenter i chose. However, when autodeploy successfully finishes adding the host to VCenter (also shown in the events), the host immediatly discconnects with a License failure. Any help would be great!

0 Kudos
Schorschi
Expert
Expert

Anyone do this idea using the VMware Perl CLI or SDK?

0 Kudos
Sharantyr3
Enthusiast
Enthusiast

Same here. All steps done succesfully, events show default key changed, my key has 14 free instances, and I still get this stupid message :

The Evaluation Mode license assigned to Host has expired. Recommend updating the license.

I don't understand, I boot this host from pxe so how can his license be expired as it is a ephemereal host ??

Why my license is not getting attached to him ??

0 Kudos
txl5858
Contributor
Contributor

The steps from guide do work. My mistake was using the wrong key. I was using our lic key for VCenter instead of vsphere (whoops epic fail). To see what key vsphere host is using, select the host within virtual center and click the configuration tab. Under licensed features, you will see the key.

0 Kudos
Sharantyr3
Enthusiast
Enthusiast

Not working here, I'm sure of my key. I had to manually had the host selecting the good key. Now when rebooting it's working.

I think there is some sort of "cache" association between keys and hosts when using autodeploy because it was working fine when I started my tests like 1 1/2 months ago.

0 Kudos
txl5858
Contributor
Contributor

Good stuff. Glad you got it working.

0 Kudos
Techstarts
Expert
Expert

Thank you so much for saving my time. Have you send email to 'docfeedback@vmware.com' so that they can correct this typo in their next release

With Great Regards,
0 Kudos
sherlock_holmes
Contributor
Contributor

Hello,

Thank you for the tutorial. It works for me for a single. I was trying to setup multiple keys so that if licenses from one key are exhausted than it starts using the second key automatically. Is there a way to add multiple ESXi keys?

Thank you

0 Kudos