8.0

Table Of Contents
3 Create a 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)
6 Provision one or more hosts with vSphere Auto Deploy and assign them to the data center or
to the cluster that you assigned the license data to.
7 You can use the vSphere Client to verify that the host is successfully assigned to the default
license XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.
Results
All hosts that you assigned to the data center are now licensed automatically.
How vSphere Auto Deploy Works with PowerCLI
You can manage vSphere Auto Deploy with PowerCLI cmdlets to create rules that associate hosts
with image profiles, host profiles, custom scripts and locations on the vCenter Server target. You
can also update hosts by testing rule compliance and repairing compliance issues.
Managing vSphere Auto Deploy with PowerCLI Cmdlets
You can manage vSphere Auto Deploy with PowerCLI cmdlets to create rules that associate hosts
with image profiles, host profiles, custom scripts and locations on the vCenter Server target. You
can also update hosts by testing rule compliance and repairing compliance issues.
Overview of the vSphere Auto Deploy Process by Using PowerCLI
Getting started with vSphere Auto Deploy requires that you learn how vSphere Auto Deploy
works, install the vSphere Auto Deploy server, install PowerCLI, write PowerCLI rules that
provision hosts, and power on your hosts to be booted with the image profile you specify. You can
customize of the image profile, host profile, and vCenter Server location.
See Scenario to Set Up vSphere Auto Deploy and Provision Hosts with vSphere PowerCLI for a
step-by-step exercise that helps you set up your first vSphere Auto Deploy environment.
VMware ESXi Installation and Setup
VMware, Inc. 125