VMware Cloud Community
vin01
Expert
Expert
Jump to solution

Esxi/Esx host hardware info


Hi

is it possible to get host hardware info like below using powercli..

Ip,Hostname,

Hardware,

Bios version,

model,

cpu Family,

biosversion,

Fc card model and version

Regards Vineeth.K
1 Solution

Accepted Solutions
kunaludapi
Expert
Expert
Jump to solution

It is because your esxihost are connected to vcenter by IP addresses not the name.

This will do the trick.

Get-VMHost | Select-object @{N="HostName";E={ $_ | Get-VMHostNetwork | select -ExpandProperty Hostname}},

        @{N="IPAddress"; E={($_ | Get-VMHostNetwork).VirtualNic | Where-Object {$_.ManagementTrafficEnabled} | Select-Object -ExpandProperty IP}},

        Manufacturer,

        Model,

        ProcessorType,

        @{N="BIOS version";E={$_.ExtensionData.Hardware.BiosInfo.BiosVersion}},

        @{N="HBA Model";E={($_ | get-vmhosthba -Type FibreChannel | select-object -ExpandProperty Model) -join ", "}},

        @{N="Driver";E={($_ | get-vmhosthba -Type FibreChannel | select-object -ExpandProperty Driver) -join ", "}}

Message was edited by: Kunal Udapi

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".

View solution in original post

12 Replies
kunaludapi
Expert
Expert
Jump to solution

For Ip,Hostname, Hardware, Bios version, model, cpu Family, biosversion

Get-VMHost | Select-object Name,`

        @{N="IPAddress"; E={($_ | Get-VMHostNetwork).VirtualNic | Where-Object {$_.ManagementTrafficEnabled}}},`

        Manufacturer, Model, ProcessorType, @{N="BIOS version";E={$_.ExtensionData.Hardware.BiosInfo.BiosVersion}}`

        @{N="HBA";E={$_.ExtensionData.Hardware.BiosInfo.BiosVersion}}

for FC card details try below command.

Get-VMHosthba

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
vin01
Expert
Expert
Jump to solution

so can you please help me out  to insert Get-vmhosthba to the above script to get Fc card model and version at once..

Regards Vineeth.K
0 Kudos
kunaludapi
Expert
Expert
Jump to solution

Script was ready but i had to try it on the real HBA card, I tested it now.

Get-VMHost | Select-object Name, @{N="IPAddress"; E={($_ | Get-VMHostNetwork).VirtualNic | Where-Object {$_.ManagementTrafficEnabled}}}, Manufacturer, Model, ProcessorType, @{N="BIOS version";E={$_.ExtensionData.Hardware.BiosInfo.BiosVersion}}, @{N="HBA Model";E={($_ | get-vmhosthba -Type FibreChannel | select-object -ExpandProperty Model) -join ", "}}, @{N="Driver";E={($_ | get-vmhosthba -Type FibreChannel | select-object -ExpandProperty Driver) -join ", "}}

I have taken FC Driver as a FC version, I will check further and get back.

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
vin01
Expert
Expert
Jump to solution

Hi kunaludapi

Sorry for delay i tested the below script host name and ip adress are not showing properly.Check the below out put

can you please correct it...and also can i generate over datacenter by adding get-datacenter |get-cluster |get-vmhost

Message was edited by: vin01

Regards Vineeth.K
0 Kudos
kunaludapi
Expert
Expert
Jump to solution

Get-Datacenter -name <DatacenterName> | Get-Cluster -Name <ClusterName> | Get-VMHost | Select-object Name,

        @{N="IPAddress"; E={($_ | Get-VMHostNetwork).VirtualNic | Where-Object {$_.ManagementTrafficEnabled} | Select-Object -ExpandProperty IP}},

        Manufacturer,

        Model,

        ProcessorType,

        @{N="BIOS version";E={$_.ExtensionData.Hardware.BiosInfo.BiosVersion}},

        @{N="HBA Model";E={($_ | get-vmhosthba -Type FibreChannel | select-object -ExpandProperty Model) -join ", "}},

        @{N="Driver";E={($_ | get-vmhosthba -Type FibreChannel | select-object -ExpandProperty Driver) -join ", "}}

I have added datacenter and cluster at the start of the script you will need to provide names.

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
vin01
Expert
Expert
Jump to solution


at output in place of

Name          :

  it is showing ip address only not host name any change to put hostname.

Regards Vineeth.K
0 Kudos
kunaludapi
Expert
Expert
Jump to solution

It is because your esxihost are connected to vcenter by IP addresses not the name.

This will do the trick.

Get-VMHost | Select-object @{N="HostName";E={ $_ | Get-VMHostNetwork | select -ExpandProperty Hostname}},

        @{N="IPAddress"; E={($_ | Get-VMHostNetwork).VirtualNic | Where-Object {$_.ManagementTrafficEnabled} | Select-Object -ExpandProperty IP}},

        Manufacturer,

        Model,

        ProcessorType,

        @{N="BIOS version";E={$_.ExtensionData.Hardware.BiosInfo.BiosVersion}},

        @{N="HBA Model";E={($_ | get-vmhosthba -Type FibreChannel | select-object -ExpandProperty Model) -join ", "}},

        @{N="Driver";E={($_ | get-vmhosthba -Type FibreChannel | select-object -ExpandProperty Driver) -join ", "}}

Message was edited by: Kunal Udapi

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
vin01
Expert
Expert
Jump to solution

Thanks Kunal that's worked..

Regards Vineeth.K
0 Kudos
vin01
Expert
Expert
Jump to solution

Kunal in the same script can we get adapter firmware driver version

Regards Vineeth.K
0 Kudos
AlbertWT
Virtuoso
Virtuoso
Jump to solution

Yes please,

how can I get the firmware version ?

/* Please feel free to provide any comments or input you may have. */
0 Kudos
vin01
Expert
Expert
Jump to solution

Which firmware version is required? Is it adapter..

Below my other post it could be helpful.

Host Hardware info with HBA and nic driver information

Regards Vineeth.K
AlbertWT
Virtuoso
Virtuoso
Jump to solution

You are awesome !

thanks for sharing.

/* Please feel free to provide any comments or input you may have. */
0 Kudos