Bulk Licensing Feature of vSphere is especially useful when ESXi servers are deployed by AutoDeploy. As there is not option to specify the license key via Host Profile, Administrator must manually attach license to ESXi Servers.
Bulk Licensing allows administrator to use pre-defined license keys to ESXi server automatically including AutoDeployed ESXi server.
Configure Bulk Licensing
- Make sure that you have License available in vCenter Server
- To configure Bulk Licensing, you need to use PowerCLI. Connect to vCenter Server using PowerCLI then bind the associated license manager to a variable.
PowerCLI C:> Connect-VIServer -Server vc.vm.lab
Name Port User
---- ---- ----
vc.vm.lab 443 VMAdministrator
PowerCLI C:> $licenseDataManager = Get-LicenseDataManager
- Run a cmdlet that retrieves the datacenter in which the hosts for which you want to use the bulk licensing feature are located.
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. In this demonstration, I will be using my Cluster as a host containing object, so that I can use different licences for each Cluster.PowerCLI C:> $hostContainer = Get-Cluster -Name AutoDeploy_Cluster
- Create a new LicenseData object and a LicenseKeyEntry object with associated type ID and license key.
PowerCLI C:> $licenseData = New-Object VMware.VimAutomation.License.Types.LicenseData
PowerCLI C:> $licenseKeyEntry = New-Object Vmware.VimAutomation.License.Types.LicenseKeyEntry
PowerCLI C:> $licenseKeyEntry.TypeId = "vmware-vsphere"
PowerCLI C:> $licenseKeyEntry.LicenseKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXXX"
- Associate the LicenseKeys attribute of the LicenseData object you created in step 3 with the LicenseKeyEntry object.
PowerCLI C:> $licenseData.LicenseKeys += $licenseKeyEntry
- Update the license data for the data center with the LicenseData object
PowerCLI C:> $licenseDataManager.UpdateAssociatedLicenseData($hostContainer.Uid, $licenseData)
- Verify that the license is associated with the host container.
PowerCLI C:> $licenseDataManager.QueryAssociatedLicenseData($hostContainer.Uid)
LicenseKeys
-----------
{vmware-vsphere: XXXXX-XXXXX-XXXXX-XXXXX-XXXXXX}
PowerCLI C:>
Verifying Bulk Licensing Operation
- I have prepared a ESXi Server for AutoDeploy
- AutoDeploy Completes.
- See the Host Summary via Hosts and Clusters View.
- Go to Configuration > Licensed features to see the correct license is assigned to the host automatically.