Automation

 View Only

 Configuring SIOC statistics collection

sc_21111's profile image
sc_21111 posted Jun 12, 2024 08:22 AM

I'm trying to configure SIOC statistics collection for several NFS volume via powercli 

The setting I'd like to configure is the following

I found a script on one thread that could be adapted but I found it not working

Here is the script

 
 
$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)
}

the error I got is the following

Exception calling "ConfigureDatastoreIORM" with "2" argument(s): "Datastore '' is not accessible. No connected and
accessible host is attached to this datastore."
At C:\Scripts\Definitivi\SetSIOC.ps1:95 char:5
+     $storMgr.ConfigureDatastoreIORM($ds.MoRef,$spec)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : VimException

LucD's profile image
LucD

I think the error is clear, there is no ESXi node connected to that Datastore that you can reach from your session.
Is that Datastore listed when you do for example

Get-VMHost | Get-Datastore

Also, how did you populate the $ds variable?