thanos24
Enthusiast
Enthusiast

how to pull vcenter and esxi licenses

i am new to c sharp i am using the sdk vmware.vim.dll api... i have figured out how to connect to vcenter host and query for list of esx hosts and pull information ... that took some work i did that a few months ago.  now i am trying to figure out how to get license info from the vcenter host AND esxi hosts that vcenter manages. here is some code i have see below, of course i have basic code on connecting to the vcenter host etc... as well i just didn't post that.

HostKernelModuleSystem mod = (HostKernelModuleSystem)client.GetView(host.ConfigManager.KernelModuleSystem, null);

KernelModuleInfo[] mod_list = mod.QueryModules();

foreach (KernelModuleInfo entry in mod_list)

{

     perform opeations......

}

now this code gets me list of modules running , if i debug and look at my "host" object or even "client" object which is my vcenter host , the LicenseManger info is NULL...  so i am looking in host.ConfigManager.LicenseManager

i have tried numerous things and can't figure out how to get license..

i must say vmware api documentation is confusing to me Smiley Sad but i am not a seasoned programmer either... but i found the following in their api documentation

Data Object - LicenseManagerLicenseInfo

and i am interested in the following properties

licenseKeyxsd:string

Key for the license. E.g. serial number.
namexsd:string

Display name for the license

but i can't for life of me figure how to get that info, i assume that if host.ConfigManager.LicenseManager if NULL then i can't go any further...

i hate to ask for code but i don't what else to do, so any help would be appreciated at this point???? Smiley Happy

Tags (2)
0 Kudos
1 Reply
LucD
Leadership
Leadership

I moved your question to the VMware Developer Community.

I suspect you have a better chance of getting an answer in this community.

Regards


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos