8 Replies Latest reply on Mar 2, 2012 1:33 PM by Chaz999

    Retrieving ESX host hardware information

    xacolabril Expert

      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.

        • 1. Re: Retrieving ESX host hardware information
          RvdNieuwendijk Virtuoso
          vExpertUser Moderators

          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      :
          

           

          1 person found this helpful
          • 2. Re: Retrieving ESX host hardware information
            RvdNieuwendijk Virtuoso
            vExpertUser Moderators

            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
            

             

            • 3. Re: Retrieving ESX host hardware information
              RvdNieuwendijk Virtuoso
              vExpertUser Moderators

              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.

              1 person found this helpful
              • 4. Re: Retrieving ESX host hardware information
                LucD Guru
                vExpertUser ModeratorsCommunity Warriors

                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

                • 5. Re: Retrieving ESX host hardware information
                  RvdNieuwendijk Virtuoso
                  vExpertUser Moderators

                  Thanks Luc, you're awesome.

                   

                  Robert

                  • 6. Re: Retrieving ESX host hardware information
                    LucD Guru
                    vExpertUser ModeratorsCommunity Warriors

                    Have a look at my Name that hardware post.

                    Gives you all the PCI HW.

                     

                     

                     

                     

                    ____________

                    Blog: LucD notes

                    Twitter: lucd22

                    • 7. Re: Retrieving ESX host hardware information
                      RaMorn Novice

                      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,

                      • 8. Re: Retrieving ESX host hardware information
                        Chaz999 Novice

                        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