Need a quick one line script to disable SIOC on all Datastores attached to a vCenter
Hello, vmwaredownload-
If you just want quick and dirty, and know that all of your datastores are SIOC capable, you could use these few lines (you could join them to one line, separated by semi-colons, if you really need just one line):
$viewStorageRM = Get-View -Id "StorageResourceManager-StorageResourceManager" ## get the Storag Resource Manager view
$spec = New-Object VMware.Vim.StorageIORMConfigSpec -Property @{"Enabled" = $false} ## create the config spec
Get-Datastore | %{$viewStorageRM.ConfigureDatastoreIORM_Task($_.Id, $spec)} ## for all datastores, disable SIOC
That does not check if the datastore is SIOC capable, or if it is already disabled -- it just goes and tries to disable SIOC on all datastores.
For further reading, if you are interested, AC wrote about enabling/disabled SIOC in his vNugglets.com post a while back.
How do those three lines do for you?
Hello, vmwaredownload-
If you just want quick and dirty, and know that all of your datastores are SIOC capable, you could use these few lines (you could join them to one line, separated by semi-colons, if you really need just one line):
$viewStorageRM = Get-View -Id "StorageResourceManager-StorageResourceManager" ## get the Storag Resource Manager view
$spec = New-Object VMware.Vim.StorageIORMConfigSpec -Property @{"Enabled" = $false} ## create the config spec
Get-Datastore | %{$viewStorageRM.ConfigureDatastoreIORM_Task($_.Id, $spec)} ## for all datastores, disable SIOC
That does not check if the datastore is SIOC capable, or if it is already disabled -- it just goes and tries to disable SIOC on all datastores.
For further reading, if you are interested, AC wrote about enabling/disabled SIOC in his vNugglets.com post a while back.
How do those three lines do for you?
Workled flawlessly
Thanks!