Datasheet
LICENSING 31
Install, Con gure, and
Manage the vSphere
Environment
PART I
$clus = Get-Cluster $Cluster | Get-View
$spec = New-Object vmware.Vim.ClusterConfigSpecEx
$spec.dpmConfig = New-Object VMware.Vim.ClusterDpmConfigInfo
$spec.DpmConfig.DefaultDpmBehavior = $DPMBehavior
$spec.DpmConfig.Enabled = $Enabled
$clus.ReconfigureComputeResource_Task($spec, $true)
}
}
Set-DPM -Cluster “Cluster01” -Behavior “Automated”
Licensing
Licensing is one of the rst areas that will be critical to setting up a new host. Without
a valid license, you can manage and use your host-to-host VMs for only 60 days.
You may be surprised to learn that there are no cmdlets to help with licensing ESX
hosts or even viewing the current license details. However, the licensing informa-
tion is available through the
Get-View
cmdlet, and you can manipulate the SDK to
perform the actions necessary to both view license information and set the license
key for your hosts. You can write functions to help you deal with these cmdlets and
make them a little friendlier than the SDK code.
Viewing License Information
To make things easier, you can use the functions we’ll show you next to list all
license keys registered on the vCenter Server and also to set a license key on a host.
e
Get-LicenseKey
function in Listing 1.13 lists all existing license keys.
LISTING 1.13
Retrieving license key information from vCenter Server
Function Get-LicenseKey {
<#
.SYNOPSIS
Retrieves License Key information
.DESCRIPTION
This function will list all license keys added to
vCenter Server
890790c01.indd 31890790c01.indd 31 3/3/11 10:22:16 AM3/3/11 10:22:16 AM