PowerCLI

 View Only
  • 1.  How to disable Storage IO Stats collection through PowerCLI?

    Posted Jul 06, 2017 02:17 AM

    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



  • 2.  RE: How to disable Storage IO Stats collection through PowerCLI?
    Best Answer

    Posted Jul 06, 2017 04:33 AM

    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)

    }



  • 3.  RE: How to disable Storage IO Stats collection through PowerCLI?

    Posted Jul 06, 2017 03:42 PM

    Thanks Luc! That helps!



  • 4.  RE: How to disable Storage IO Stats collection through PowerCLI?

    Posted Jul 07, 2017 08:06 PM

    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.



  • 5.  RE: How to disable Storage IO Stats collection through PowerCLI?

    Posted Jul 07, 2017 08:18 PM

    Thanks for sharing that.
    I was bitten by that "phenomena" for quite some time before I realised what was happening :smileygrin:



  • 6.  RE: How to disable Storage IO Stats collection through PowerCLI?

    Posted Jul 07, 2017 08:24 PM

    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 :smileyhappy:



  • 7.  RE: How to disable Storage IO Stats collection through PowerCLI?

    Broadcom Employee
    Posted Dec 20, 2017 02:33 PM

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



  • 8.  RE: How to disable Storage IO Stats collection through PowerCLI?

    Broadcom Employee
    Posted Jan 22, 2018 08:05 PM

    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



  • 9.  RE: How to disable Storage IO Stats collection through PowerCLI?

    Posted Mar 29, 2018 07:46 PM

    VMware bug# 1998168



  • 10.  RE: How to disable Storage IO Stats collection through PowerCLI?

    Posted Mar 29, 2018 07:56 PM

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