VMware Cloud Community
tomtom1
Enthusiast
Enthusiast

Host Hardware information

Hi, is there a script which will tell me about the host hardware. I dont want a detailed report like esxcfg-info command output. But something like nic card build number, processor, FC Card and their PCI slot details.

I have a mix environment of vSpehre and ESX 3.5

Thanks

10 Replies
LucD
Leadership
Leadership

For the PCI slots and the cards you can use the script from my Name that hardware post.

For properties like NIC card build you will have to explore the HostSystem object and more specifically the PhysicalNic object.

____________

Blog: LucD notes

Twitter: lucd22


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

tomtom1
Enthusiast
Enthusiast

I am sorry but I am not able to download the Name that hardware script from your site.

My knowledge in programming is very very little.

thanks

0 Kudos
LucD
Leadership
Leadership

There is no download button in the post.

If you hover your mouse over the code box 4 icons will appear in the top right corner.

The 2nd icon will copy the code to your clipboard.

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
tomtom1
Enthusiast
Enthusiast

Thanks for the info.

When I run the script I am getting following erro message...

PS C:\Documents and Settings\tom\Desktop> .\hwinfo.ps1

New-Object : A parameter cannot be found that matches parameter name 'Property'.

At C:\Documents and Settings\tom\Desktop\hwinfo.ps1:32 char:57

+ $deviceTab[$vendorId] = New-Object PSObject -Property <<<< @{

New-Object : A parameter cannot be found that matches parameter name 'Property'.

At C:\Documents and Settings\tom\Desktop\hwinfo.ps1:32 char:57

+ $deviceTab[$vendorId] = New-Object PSObject -Property <<<< @{

You cannot call a method on a null-valued expression.

At C:\Documents and Settings\tom\Desktop\hwinfo.ps1:24 char:51

+ if(!$deviceTab[$vendorId].deviceTab.ContainsKey <<<< ($deviceId)){

New-Object : A parameter cannot be found that matches parameter name 'Property'.

At C:\Documents and Settings\tom\Desktop\hwinfo.ps1:32 char:57

+ $deviceTab[$vendorId] = New-Object PSObject -Property <<<< @{

New-Object : A parameter cannot be found that matches parameter name 'Property'.

At C:\Documents and Settings\tom\Desktop\hwinfo.ps1:32 char:57

+ $deviceTab[$vendorId] = New-Object PSObject -Property <<<< @{

You cannot call a method on a null-valued expression.

At C:\Documents and Settings\tom\Desktop\hwinfo.ps1:24 char:51

+ if(!$deviceTab[$vendorId].deviceTab.ContainsKey <<<< ($deviceId)){

You cannot call a method on a null-valued expression.

At C:\Documents and Settings\tom\Desktop\hwinfo.ps1:18 char:51

+ if(!$deviceTab[$vendorId].deviceTab.ContainsKey <<<< ($subdeviceId)){

You cannot call a method on a null-valued expression.

At C:\Documents and Settings\tom\Desktop\hwinfo.ps1:18 char:51

+ if(!$deviceTab[$vendorId].deviceTab.ContainsKey <<<< ($subdeviceId)){

New-Object : A parameter cannot be found that matches parameter name 'Property'.

At C:\Documents and Settings\tom\Desktop\hwinfo.ps1:32 char:57

+ $deviceTab[$vendorId] = New-Object PSObject -Property <<<< @{

I think I have a older Powershell. Now sure. Any ideas ?

Thanks

0 Kudos
LucD
Leadership
Leadership

Yes, I'm pretty sure you have an older PS.

The script uses the -Property parameter with the New-Object cmdlet, and that is PS v2 only I'm afraid.

Can you upgrade to PS v2 ?

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
tomtom1
Enthusiast
Enthusiast

I just checke di have PS2 installed.

Major Minor Build Revision

-


-


-


-


2 0 -1 -1

0 Kudos
Treecko
Contributor
Contributor

I've been poking around the SDK for a while to retrieve the HostSystem object, and it seems to give me exactly the information I'm looking for.

Do you know if there's an alternative way to do this? Preferably one that doesn't involve having to deal with SOAP and Managed Objects?

0 Kudos
LucD
Leadership
Leadership

If you use Get-VMHost to retrieve the ESXi node you want, via the ExtensionData property on the returned object, you have access to the HostSystem object.


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

0 Kudos
sjesse
Leadership
Leadership

Look at this

GitHub - arielsanchezmora/vDocumentation: vDocumentation provides a community-created set of PowerCL...

it gives you an option to run a report on all your devices report that looks like this, I left off the host names, that was the first column.

    

Slot DescriptionVMKernel NameDevice NameVendor NameDevice ClassPCI AddressVIDDIDSVIDSSIDDriverDriver VersionFirmware VersionVIB NameVIB Version
Chassis slot 4.00vmhba0MegaRAID SAS Fusion ControllerLSI / Symbios LogicRAID bus controller000:082:00.01000005b10009271megaraid_sasVersion 6.602.54.00.1vmw, Build: 1198610, Interface: 9.2 Built on: Nov 20 2013scsi-megaraid-sas6.602.54.00-1OEM.550.0.0.1198610
vmnic0I350 Gigabit Network ConnectionIntel CorporationEthernet controller000:002:00.0808615211137008bigbVersion 5.0.5.1, Build: 2403361, Interface: 9.2 Built on: Jan  1 20151.63, 0x80000aa5, 0.324.97net-igb5.0.5.1.1-1vmw.550.2.54.2403361
vmnic1I350 Gigabit Network ConnectionIntel CorporationEthernet controller000:002:00.1808615211137008bigbVersion 5.0.5.1, Build: 2403361, Interface: 9.2 Built on: Jan  1 20151.63, 0x80000aa5, 0.324.97net-igb5.0.5.1.1-1vmw.550.2.54.2403361
vmnic2I350 Gigabit Network ConnectionIntel CorporationEthernet controller000:002:00.2808615211137008bigbVersion 5.0.5.1, Build: 2403361, Interface: 9.2 Built on: Jan  1 20151.63, 0x80000aa5, 0.324.97net-igb5.0.5.1.1-1vmw.550.2.54.2403361
vmnic3I350 Gigabit Network ConnectionIntel CorporationEthernet controller000:002:00.3808615211137008bigbVersion 5.0.5.1, Build: 2403361, Interface: 9.2 Built on: Jan  1 20151.63, 0x80000aa5, 0.324.97net-igb5.0.5.1.1-1vmw.550.2.54.2403361
0 Kudos
sjesse
Leadership
Leadership

theres more, it looks like it cut off the site. The column headers are 

Hostname Slot Description VMKernel Name Device Name Vendor Name Device Class PCI Address VID DID SVID SSID Driver Driver Version Firmware Version VIB Name VIB Version

0 Kudos