VMware Cloud Community
Mattvo
Contributor
Contributor
Jump to solution

Exporting hardware status data via PowerCLI

Hello there,

I was wondering if someone have used PowerCLI to export the Hardware Status xml information for a host in vCenter?

I'm not really familiar with PowerShell or PowerCLI so I'm not sure if this is even possible but it would help us fully automate some third party driver checking.

Thank you for your time and help

Matt

Tags (1)
1 Solution

Accepted Solutions
ryandking
Contributor
Contributor
Jump to solution

You can check the driver versions while connected to a Host without need for an XML export.

I have attached a quick and dirty script to write the versions of all drivers to the console.

Main points of the script:

Connect-VIServer --- Connect to vCenter

Get-VMHost --- Lists Hosts associated with the vCenter

Get-EsxCli --- Access to ESX Host's CLI

$EsxCli.system.module.get("$DRIVER_NAME") --- Retrieves the VMKernel module (if the system knows about it) by name

This is just the fastest way to show how to get driver information. Basically you just connect to the vCenter Server via PowerCLI, then connect to Hosts one by one. While connected to a Host, use EsxCli to get the driver (module) information.

I also forgot to add a line at the end of the script, so here it is: "$DISCONNECT = Disconnect-VIServer $VCENTER_SERVER -Force -Confirm:$FALSE"

---Ryan D. King

View solution in original post

0 Kudos
3 Replies
Anjani_Kumar
Commander
Commander
Jump to solution

Not sure if this can help you out . but give it a try.

https://www.packtpub.com/books/content/inventorying-servers-powershell

Please consider marking this answer "correct" or "helpful" if you found it useful. Anjani Kumar | VMware vExpert 2014-2015-2016 | Infrastructure Specialist Twitter : @anjaniyadav85 Website : http://www.Vmwareminds.com
0 Kudos
ryandking
Contributor
Contributor
Jump to solution

You can check the driver versions while connected to a Host without need for an XML export.

I have attached a quick and dirty script to write the versions of all drivers to the console.

Main points of the script:

Connect-VIServer --- Connect to vCenter

Get-VMHost --- Lists Hosts associated with the vCenter

Get-EsxCli --- Access to ESX Host's CLI

$EsxCli.system.module.get("$DRIVER_NAME") --- Retrieves the VMKernel module (if the system knows about it) by name

This is just the fastest way to show how to get driver information. Basically you just connect to the vCenter Server via PowerCLI, then connect to Hosts one by one. While connected to a Host, use EsxCli to get the driver (module) information.

I also forgot to add a line at the end of the script, so here it is: "$DISCONNECT = Disconnect-VIServer $VCENTER_SERVER -Force -Confirm:$FALSE"

---Ryan D. King

0 Kudos
ryandking
Contributor
Contributor
Jump to solution

Good article on CIM Sessions, but didn't work for me. Tried CIM sessions to the ESX Hosts unsuccessfully. Found another way to get the driver information that doesn't require an XML export (from vSphere Web Client). You can use EsxCli to get the driver info. Posted my findings and a sample script on this thread.

0 Kudos