Skip to content

Instantly share code, notes, and snippets.

@manualbashing
Created October 9, 2019 14:16
Show Gist options
  • Select an option

  • Save manualbashing/c7cb14441c369fe6407b60a2f2166ac1 to your computer and use it in GitHub Desktop.

Select an option

Save manualbashing/c7cb14441c369fe6407b60a2f2166ac1 to your computer and use it in GitHub Desktop.
Returns nmp Device Settings for SC Storage
function Get-NmpDeviceSettings ($VMHost)
{
$VMHost = Get-VMHost $VMHost
foreach ($vmh in $VMHost)
{
$esxcli = $VMHost | Get-EsxCli -V2
$esxcli.storage.nmp.device.list.Invoke() |
Where-Object DeviceDisplayName -like COMPELNT* |
Select-Object Device*,
PathSelectionPolicy,
StorageArrayType,
@{n='action_OnRetryErrors'; e={ ($_.StorageArrayTypeDeviceConfig -replace '^.*action_OnRetryErrors=(on|off).*$', '$1') -eq 'on' }},
@{n='iops'; e={ $_.PathSelectionPolicyDeviceConfig -replace '^.*iops=([0-9]+).*$', '$1' }},
@{n='VMHost'; e={ $vmh }}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment