VMware Cloud Community
Matthias_Hehnen
VMware Employee
VMware Employee

Applying non-ESX licenses using PowerCLI?

I wonder, if it's possible to apply using PowerCLI licenses to VMware products like ChargeBack, vShield and so on.

Within the vSphere 5.0 documentation a sample script is given for applying vSphere licenses in a auto deploy environment:

http://pubs.vmware.com/vsphere-50/index.jsp?topic=/com.vmware.vsphere.install.doc_50/GUID-48AEE987-B...

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)
6

Provision  one or more hosts with Auto Deploy and assign them to the data center  or to the cluster that you assigned the license data to.

7

Verify that the host is successfully assigned to the default license XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.

a

Using a vSphere Client, log in to the vCenter Server system.

b

Navigate to the Configuration > License Features tab for the host and check that the correct license is displayed.

The syntax shows, that a "licenseKeyEntry.TypeID" must be defined. As such a TypeID the script uses "vmware-vsphere".

Would it be possible to replace "vmware-vsphere" with other TypeID's? Could I use i.e. "vmware.chargeback" and give then a valid chareback license key in the next line?

I did some intensive search on learning more about "$licenseKeyEntry.TypeID" without success. Unfortunately I also do not have an environment in which I could play a bit.

But perhaps someone else knows more...

Many thanks,

0 Kudos
0 Replies