vmk2014
Expert
Expert

Script for Audit - VMware tools,VM version, VMFS and ESXi host version etc..

Jump to solution

Hello All,

I'm looking for a script which will help me do interim audit while upgrading the

1)VM tool version status

2)VM Hardware version

3)VMFS version upgrade. ( E.g. 5.60, 5.81,6.81 etc

4)ESXi Firmware Upgrade (HPE HW - I have the script)

5)ESXi host version 5.5 & 6.5

Note :- 1)We need to extract report only for the Microsoft OS 2008,2008R2,2012,2012R2 & 2016 only.

        ii) EXclude powered off VM's

      

thanks

vmk

cwvx- and cwvxp

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

Try like this

Get-VMHost -PipelineVariable esx |

Get-VM |

Select @{N='VMHost';E={$esx.Name}},

   @{N='VM';E={$_.Name}},

   @{N='VMHost Version';E={$esx.Version}},

   @{N='VMHost Firmware';E={'???'}},

   @{N='Datastore';E={(Get-Datastore -RelatedObject $_ | where{$_.ExtensionData.Summary.MultipleHostAccess}).Name -join '|'}},

   @{N='Datastore Version';E={(Get-Datastore -RelatedObject $_ | where{$_.ExtensionData.Summary.MultipleHostAccess}).FileSystemVersion -join '|'}},

   @{N='VMware Tools';E={$_.Guest.ToolsVersion}},

   @{N='HW';E={$_.Version}}


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

View solution in original post

0 Kudos
16 Replies
LucD
Leadership
Leadership

Try like this.

I left the ESXi firmware open, since I don't have HP HW to test.

You should plug in the code you have.

Get-VMHost -PipelineVariable esx |

Get-VM |

Select @{N='VMHost';E={$esx.Name}},

   @{N='VM';E={$_.Name}},

   @{N='VMHost Version';E={$esx.Version}},

   @{N='VMHost Firmware';E={'???'}},

   @{N='Datastore';E={(Get-Datastore -RelatedObject $_).Name -join '|'}},

   @{N='Datastore Version';E={(Get-Datastore -RelatedObject $_).FileSystemVersion -join '|'}},

   @{N='VMware Tools';E={$_.Guest.ToolsVersion}},

   @{N='HW';E={$_.Version}}


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

0 Kudos
vmk2014
Expert
Expert

LucD,

Firmware version also possible through your script, I guess not. if possible then include for HPE HW.

VMHost Firmware';E={'???'}}''

thanks

vmk

0 Kudos
LucD
Leadership
Leadership

What script do you have?
I can try to inject that code into this one.


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

0 Kudos
vmk2014
Expert
Expert

$cmdSub = '/usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -a'

shared by you in earlier mail thread. I'm only looking for host firmware

Re: Host firmware, hba driver, NIC version etc,

0 Kudos
LucD
Leadership
Leadership

That command produces a lot more output, not just the firmware version.
So you would have to extract the firmware version from the returned text.

Since I don't have HP HW I don't know how the ouputlooks like and what exactly to extract.
If you can show me what an ESXi node returns and which field you want, I can give it a shot to extract the firmware version.


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

0 Kudos
vmk2014
Expert
Expert

Ok , let me check. Meanwhile, Can we exclude local data store VMFS version from the output?

0 Kudos
LucD
Leadership
Leadership

Try like this

Get-VMHost -PipelineVariable esx |

Get-VM |

Select @{N='VMHost';E={$esx.Name}},

   @{N='VM';E={$_.Name}},

   @{N='VMHost Version';E={$esx.Version}},

   @{N='VMHost Firmware';E={'???'}},

   @{N='Datastore';E={(Get-Datastore -RelatedObject $_ | where{$_.ExtensionData.Summary.MultipleHostAccess}).Name -join '|'}},

   @{N='Datastore Version';E={(Get-Datastore -RelatedObject $_ | where{$_.ExtensionData.Summary.MultipleHostAccess}).FileSystemVersion -join '|'}},

   @{N='VMware Tools';E={$_.Guest.ToolsVersion}},

   @{N='HW';E={$_.Version}}


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

0 Kudos
vmk2014
Expert
Expert

LucD,

It worked, if you can inject the below information  using the previous thread

 

ESXi Build
8294253
8294253
10390116
10884925

 

FW System Rom
I41 10/02/2018
I41 10/02/2018
I41 08/08/2018
I41 10/02/2018
I41 10/02/2018
I41 10/02/2018
I41 10/02/2018
I41 10/02/2018
I41 10/02/2018
I41 08/08/2018
0 Kudos
LucD
Leadership
Leadership

Is this returned from the command?
Is that 1 long string or separate lines?

And which number in there is the firmware version?


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

0 Kudos
vmk2014
Expert
Expert

Sorry, not from this command. It was an example only and extracted from ESXCLI.

/usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -a

will perform a detailed dump

0 Kudos
vmk2014
Expert
Expert

LucD,

Is this returned from the command?  /usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -a
Is that 1 long string or separate lines?  It's column wise.

And which number in there is the firmware version? from text file. Let me know if you want to see the output.

In case not feasible then i'm fine LucD. I appreciate your help here.

0 Kudos
LucD
Leadership
Leadership

Yes please, show some sample output.
Perhaps I can find a way to extract the required data.


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

0 Kudos
LucD
Leadership
Leadership

Thanks.
Which field in there is the actual firmware version you want to see?

I find 2 HBA adapters, FC ports and 2 drivers, but no server node info.


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

0 Kudos
vmk2014
Expert
Expert

LucD,

Yes, it seems node info is missing here. I'll check with the team and find out how they did pull out below info. I'm exactly looking the below info. sorry for the confusion.

 

FW iLO5
1.37 Oct 25 2018
1.37 Oct 25 2018
1.35 Aug 14 2018
0 Kudos
vmk2014
Expert
Expert

LucD,

I did check from the team, firmware info was extracted from HP oneview.

0 Kudos
LucD
Leadership
Leadership

That's what I suspected.

Any other way of getting the info?

Or do you leave if out from the report?

If you have that OneView report in a file, we could extract the info from there.

But I would need a sample report to determine how to extract the info.


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

0 Kudos