Skip to content

Instantly share code, notes, and snippets.

@dlinsley
Created August 6, 2017 21:08
Show Gist options
  • Save dlinsley/116bebd79920c939241bc620f3449799 to your computer and use it in GitHub Desktop.
Save dlinsley/116bebd79920c939241bc620f3449799 to your computer and use it in GitHub Desktop.
Assign license to ESXi HostSystem
// VMware vRealize Orchestrator (vRO) action sample
//
// Assign license key to ESXi Host (HostSystem)
//
// For vRO v7.0+
//
// Action Inputs:
// host - VC:HostSystem
// license - string
//
// Return type: void
// consider using sample: https://code.vmware.com/samples/1479/decode-vsphere-license
// to validate license
if (!license || license.length != 29) {
throw("invalid license key")
}
host.sdkConnection.licenseManager.licenseAssignmentManager.updateAssignedLicense(host.id, license);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment