Looking for a way to disable Datastore's Storage IO Stats collection through PowerCLI. By default it is set enabled (i.e.True), I need to change it to disabled (i.e. False) on multiple datastores. Any idea how to accomplish this via PowerCLI?
ExtensionData.IormConfiguration.StatsCollectionEnabled
True
Try like this.
It will disable stats collection for all shared datastores.
$si = Get-View ServiceInstance
$storMgr = Get-View -Id $si.Content.StorageResourceManager
$spec = New-Object VMware.Vim.StorageIORMConfigSpec
$spec.Enabled = $false
$spec.StatsAggregationDisabled = $true
$spec.StatsCollectionEnabled = $false
foreach($ds in (Get-View -ViewType Datastore -Filter @{'Summary.MultipleHostAccess'='True'})){
Write-Output "Configuring datastore $($ds.Name)"
$storMgr.ConfigureDatastoreIORM($ds.MoRef,$spec)
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this.
It will disable stats collection for all shared datastores.
$si = Get-View ServiceInstance
$storMgr = Get-View -Id $si.Content.StorageResourceManager
$spec = New-Object VMware.Vim.StorageIORMConfigSpec
$spec.Enabled = $false
$spec.StatsAggregationDisabled = $true
$spec.StatsCollectionEnabled = $false
foreach($ds in (Get-View -ViewType Datastore -Filter @{'Summary.MultipleHostAccess'='True'})){
Write-Output "Configuring datastore $($ds.Name)"
$storMgr.ConfigureDatastoreIORM($ds.MoRef,$spec)
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Luc! That helps!
Just a warning on this...there's a bug in vSphere 6 and 6.5 where this option gets reset on every datastore after vCenter services are restarted. Keep this script handy and run it whenever you do maintenance that requires services restarts or a reboot of your vCenter.
Thanks for sharing that.
I was bitten by that "phenomena" for quite some time before I realised what was happening :smileygrin:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yep same here...I opened an SR but was told that it will be available in the "next major release". I do have a PR# stashed away somewhere, but it looks like a vSphere 7 thing. PowerCLI to the rescue again, I just have to remember to run the script
adamjg, Could you please shoot me your PR # or SR # so I can follow up on this issue for one of my customers?
All does anyone out there have a PR (or) SR I can review one this topic? I am working with the VMware PM's and trying to validate.
Thanks
Bo
VMware bug# 1998168
Sorry, I missed these messages. The PR # I have from VMware for this issue is 1790041.