xacolabril
Expert
Expert

Retrieving ESX host hardware information

Jump to solution

Hello friends,

I want to retrieve certain information about my ESX servers. My objective is to make a simple inventary.

How can I get the next information:

ESX model (part number...)

Num of CPUs

CPU Speed

RAM assigned

Number of NICs

NIC Speed

Model of NIC?

Number of HBAs

Model of HBA?

(...)

Thank you!

Kind regards.

Saludos.

Xavier

VMware Certified Professional VCP3 and VCP4.

-


Si encuentras que esta o cualquier otra respuesta ha sido de utilidad, vótalas. Gracias.

If you find this or any other information helpful or correct, please consider awarding points. Thank you.

Xavier Colomé Abril. VMware Certified Professional VCP3, VCP4 and VCP5. [Si encuentras que esta o cualquier otra respuesta ha sido de utilidad, vótalas. Gracias.] [If you find this or any other information helpful or correct, please consider awarding points. Thank you.]
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

Have a look at my Name that hardware post.

Gives you all the PCI HW.

____________

Blog: LucD notes

Twitter: lucd22


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

View solution in original post

0 Kudos
8 Replies
RvdNieuwendijk
Leadership
Leadership

The next command gives allmost everything you ask for. It does not yet give the model of nic, the nic speed and the hba model. I still have to figure out how to get these:

Get-VmHost | Get-View | ForEach-Object {
   $_.Summary.Hardware | `
  Add-Member -MemberType NoteProperty -Name "Name" -Value $_.Name -PassThru
}

This gives the following output:

Name                 : scomp0407.wurnet.nl
Vendor               : HP
Model                : ProLiant BL20p G4
Uuid                 : 34303539-3132-4742-3837-303334374836
OtherIdentifyingInfo : {VMware.Vim.HostSystemIdentificationInfo}
MemorySize           : 4293222400
CpuModel             : Intel(R) Xeon(R) CPU            5160  @ 3.00GHz
CpuMhz               : 3000
NumCpuPkgs           : 2
NumCpuCores          : 4
NumCpuThreads        : 4
NumNics              : 4
NumHBAs              : 5
DynamicType          :
DynamicProperty      :

Name                 : scomp0408.wurnet.nl
Vendor               : HP
Model                : ProLiant BL20p G4
Uuid                 : 34303539-3132-4742-3837-303334374433
OtherIdentifyingInfo : {VMware.Vim.HostSystemIdentificationInfo}
MemorySize           : 4293222400
CpuModel             : Intel(R) Xeon(R) CPU            5160  @ 3.00GHz
CpuMhz               : 3000
NumCpuPkgs           : 2
NumCpuCores          : 4
NumCpuThreads        : 4
NumNics              : 4
NumHBAs              : 5
DynamicType          :
DynamicProperty      :

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
RvdNieuwendijk
Leadership
Leadership

The next script gives you the HBA models for all hosts:

Get-VMHost | ForEach-Object {
  $VMHost = $_.Name
  Get-VMHostHba -VMHost $_ | Add-Member -MemberType NoteProperty -Name "VMHost" -Value $VMHost -PassThru
} | `
Format-Table -Property VMHost,Device,Type,Model -AutoSize

This is the output of the script in my test environment:

VMHost              Device          Type Model
------              ------          ---- -----
scomp0407.wurnet.nl vmhba32 ParallelScsi 31xESB/632xESB/3100 Chipset SATA Storage Controller IDE
scomp0407.wurnet.nl vmhba0  ParallelScsi 31xESB/632xESB/3100 Chipset SATA Storage Controller IDE
scomp0407.wurnet.nl vmhba1  FibreChannel ISP2312-based 2Gb Fibre Channel to PCI-X HBA
scomp0407.wurnet.nl vmhba2  FibreChannel ISP2312-based 2Gb Fibre Channel to PCI-X HBA
scomp0407.wurnet.nl vmhba3         Block Smart Array E200i
scomp0408.wurnet.nl vmhba32 ParallelScsi 31xESB/632xESB/3100 Chipset SATA Storage Controller IDE
scomp0408.wurnet.nl vmhba0  ParallelScsi 31xESB/632xESB/3100 Chipset SATA Storage Controller IDE
scomp0408.wurnet.nl vmhba1  FibreChannel ISP2312-based 2Gb Fibre Channel to PCI-X HBA
scomp0408.wurnet.nl vmhba2  FibreChannel ISP2312-based 2Gb Fibre Channel to PCI-X HBA
scomp0408.wurnet.nl vmhba3         Block Smart Array E200i

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
RvdNieuwendijk
Leadership
Leadership

I looked in the vSphere SDK to find the NIC model. But I could not find it. So I think it is not possible to retrieve the NIC model with PowerCLI. The NIC speed however is no problem with the following script:

Get-VMHost | ForEach-Object {
  $VMHost = $_.Name
  Get-VMHostNetworkAdapter -VMHost $VMHost | `
    Add-Member -MemberType NoteProperty -Name "VMHost" -Value $VMHost -PassThru
} | Select-Object -property VMHost,DeviceName,BitRatePerSec,FullDuplex

This script gives the following output:

VMHost                        DeviceName                                    BitRatePerSec                    FullDuplex
------                        ----------                                    -------------                    ----------
scomp0407.wurnet.nl           vmnic0                                                 1000                          True
scomp0407.wurnet.nl           vmnic2                                                 1000                          True
scomp0407.wurnet.nl           vmnic3                                                 1000                          True
scomp0407.wurnet.nl           vmnic1                                                 1000                          True
scomp0407.wurnet.nl           vswif0
scomp0407.wurnet.nl           vmk0
scomp0408.wurnet.nl           vmnic0                                                 1000                          True
scomp0408.wurnet.nl           vmnic2                                                 1000                          True
scomp0408.wurnet.nl           vmnic3                                                 1000                          True
scomp0408.wurnet.nl           vmnic1                                                 1000                          True
scomp0408.wurnet.nl           vswif0
scomp0408.wurnet.nl           vmk0

The BitRatePerSec is in MB. So 1000 means 1GB.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
LucD
Leadership
Leadership

You can find the NICs by using the PCI ClassId.

Like this

$esx = Get-VMHost <hostname> | Get-View
$esx.Hardware.PciDevice | where {$_.ClassId -eq 512} | Select VendorName, DeviceName

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
RvdNieuwendijk
Leadership
Leadership

Thanks Luc, you're awesome.

Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
LucD
Leadership
Leadership

Have a look at my Name that hardware post.

Gives you all the PCI HW.

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
RaMorn
Contributor
Contributor

The following worked great for me when grabbing HBA's info:

Get-VMHost ESX_server_name | Get-VMHostHba -Device *hba* | fl

Hope this helps!

Regards,

0 Kudos
Chaz999
Enthusiast
Enthusiast

Bro, any idea,

How to we get IBM/HP host Serial number

I meant

Script show 3 things , Host, Host IP and Serial number of the host

much appreciate in advance

Thanks

0 Kudos