VMware vSphere

 View Only

 PowercLI script to monitor DIskQfullSampleSize and DiskQFullThreshold

cer113a's profile image
cer113a posted Nov 01, 2024 11:17 AM

HI

I would like to find out these values on all hosts in vCenter which is advanced host settings not to change them just to monitor and output

Tried this

$hosts = Get-VMHost | Select-Object Name, @{Name='QFullSampleSize'; Expression={Get-VMHostAdvancedSetting -Entity $_ -Name Disk.QFullSampleSize | Select-Object Value}}, @{Name='QFullThreshold'; Expression={Get-VMHostAdvancedSetting -Entity $_ -Name Disk.QFullThreshold | Select-Object Value}}

 

$hosts | Format-Table -AutoSize

And got empty values for QFullSample size and QfullThreshold

Name         QFullSampleSize QFullThreshold
----         --------------- --------------
172.20.0.111                               
172.20.0.112                               
172.20.0.117                               
172.20.0.119                               
172.20.0.131                               
172.20.0.113                               
172.20.0.114                               
172.20.0.116                               
172.20.0.115                               
172.20.0.53

Any time when we create new LUN on 3PAR this setting has to be changed for all hosts but at this point we just want to see what are the values and we will change them one by one3  

Andrea Consalvi's profile image
Andrea Consalvi

Hey,

Yeah, I see what’s happening. The issue is that Get-VMHostAdvancedSetting returns an object, so when you do Select-Object Value, you’re trying to extract a property from something that might not exist (which is why you're getting empty values).

Try modifying your script like this:

$hosts = Get-VMHost | Select-Object Name,
@{Name='QFullSampleSize'; Expression={(Get-VMHostAdvancedSetting -Entity $_ -Name "Disk.QFullSampleSize").Value}},
@{Name='QFullThreshold'; Expression={(Get-VMHostAdvancedSetting -Entity $_ -Name "Disk.QFullThreshold").Value}}

$hosts | Format-Table -AutoSize 

This should correctly extract the Value property instead of returning an empty object.