6.7

Table Of Contents
Assigning license keys through the vSphere Web Client and assigning licensing by using PowerCLI
cmdlets function differently.
Assign license keys
with the
vSphere Web Client
You can assign license keys to a host when you add the host to the
vCenter Server system or when the host is managed by a vCenter Server
system.
Assign license keys
with
LicenseDataManager
PowerCLI
You can specify a set of license keys to be added to a set of hosts. The
license keys are added to the vCenter Server database. Each time a host is
added to the vCenter Server system or reconnects to it, the host is
assigned a license key. A license key that is assigned through PowerCLI is
treated as a default license key. When an unlicensed host is added or
reconnected, it is assigned the default license key. If a host is already
licensed, it keeps its license key.
The following example assigns licenses to all hosts in a data center. You can also associate licenses with
hosts and clusters.
The following example is for advanced PowerCLI users who know how to use PowerShell variables.
Prerequisites
Prepare Your System for vSphere Auto Deploy.
Procedure
1 In a PowerCLI session, 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
VMware ESXi Installation and Setup
VMware, Inc. 114