VMware Cloud Community
BastiaanvanH
Contributor
Contributor

Get-vmhostmodule list all modules and options

Hi all,

Fist, have a happy christmas and a great new year!

I'm new to powercli, but i'm learning. I'm able to set some module value's thru Get-vmHostModule. But before setting a value, you need to know the module name. (Where "lpfc820" is the module/driver name").

Get-VMhostModule "lpfc820" | Set-VMHostModule -Options "lpfc_lun_queue_depth=16"

My question, can a ESX(i) host be populated to display all loaded modules/drivers? Perhaps with it's current options set?

Kind regards,

Bastiaan

0 Kudos
4 Replies
LucD
Leadership
Leadership

Afaik there is no cmdlet for that, but you can use the QueryModules method.

Something like this

$esx = Get-VMHost
$kernSys = Get-View $esx.ExtensionData.ConfigManager.KernelModuleSystem
$kernSys.QueryModules() | Select Name


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

BastiaanvanH
Contributor
Contributor

Hi,

Thank you for this!

Could you assist me to make a "foreach" to loop thu each module name, and output the options for that particular module?

Regards!

0 Kudos
BastiaanvanH
Contributor
Contributor

Never mind, got it:

$esx = Get-VMHost
$kernSys = Get-View $esx.ExtensionData.ConfigManager.KernelModuleSystem
foreach($module in $kernSys.QueryModules()){
$module | Select Name, OptionString
}
0 Kudos
LucD
Leadership
Leadership

You could even do it without a foreach by simply using the Select-Object cmdlet

$esx = Get-VMHost 
$kernSys
= Get-View $esx.ExtensionData.ConfigManager.KernelModuleSystem $kernSys.QueryModules() | Select Name,OptionString


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

0 Kudos