as title..Pls advise if there is anything liht getHostHardwardInfo() that I missed? Thanks
Message was edited by:
lopezroy
You can use the managed object reference to the hostsystem and use getObjectProperty method, passing it the moref to your host system and the property.
e.g.
System.out.println("HOST INFO: "+getObjectProperty(hostRef, "hardware.systemInfo.uuid"));
System.out.println("HOST INFO: "+getObjectProperty(hostRef, "hardware.systemInfo.vendor"));
For finding the implementation of getObjectProperty, you can refer VMPowerOps.java sample code available with the java sdk.
You didn't mention the development language, so I will give you the answer for the VI Perl Toolkit.
First, you get the host view. In VI Perl, that's simple:
my $name = 'host1.eng.company.com'; # substitute with the host name
my $host_view = Vim::find_entity_view (view_type => 'HostSystem', filter => {name => "^$name\$"; surround name with ^ and $ to get an exact match
\# here are various fields of the hardware info object
print "Model: ", $host_view->systemInfo->model, "\n";
print "UUID: ", $host_view->systemInfo->uuid, "\n";
print "Vendor: ", $host_view->systemInfo->vendor, "\n";
print "CPU Speed", $host_view->cpuInfo->hz, "\n";
HostHardwareInfo is a data object that is retrieved when you get the HostSystem view (in Perl, at least).
H
-deleted-
Message was edited by:
roberthehe
Thanks for your advise..Actually, I'm using Java SDK..
I already have the MoRef(hostSystem) by findByDnsName(), but I don't know how to go further with HostHardwareInfo object.
You can use the managed object reference to the hostsystem and use getObjectProperty method, passing it the moref to your host system and the property.
e.g.
System.out.println("HOST INFO: "+getObjectProperty(hostRef, "hardware.systemInfo.uuid"));
System.out.println("HOST INFO: "+getObjectProperty(hostRef, "hardware.systemInfo.vendor"));
For finding the implementation of getObjectProperty, you can refer VMPowerOps.java sample code available with the java sdk.
Thanks a lot..
It's working.