VMware Cloud Community
exploreeverythi
Contributor
Contributor
Jump to solution

How to disable Storage IO Stats collection through PowerCLI?

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

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

9 Replies
LucD
Leadership
Leadership
Jump to solution

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

exploreeverythi
Contributor
Contributor
Jump to solution

Thanks Luc! That helps!

0 Kudos
adamjg
Hot Shot
Hot Shot
Jump to solution

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.

LucD
Leadership
Leadership
Jump to solution

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

0 Kudos
adamjg
Hot Shot
Hot Shot
Jump to solution

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 Smiley Happy

0 Kudos
bo_busillo
VMware Employee
VMware Employee
Jump to solution

adamjg, Could you please shoot me your PR # or SR # so I can follow up on this issue for one of my customers?

0 Kudos
bo_busillo
VMware Employee
VMware Employee
Jump to solution

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

0 Kudos
BenFB
Virtuoso
Virtuoso
Jump to solution

VMware bug# 1998168

0 Kudos
adamjg
Hot Shot
Hot Shot
Jump to solution

Sorry, I missed these messages.  The PR # I have from VMware for this issue is 1790041.

0 Kudos