vmwaredownload
Enthusiast
Enthusiast

Need a quick one line script to disable SIOC on all Datastores attached to a vCenter

Jump to solution

Need a quick one line script to disable SIOC on all Datastores attached to a vCenter

0 Kudos
1 Solution

Accepted Solutions
mattboren
Expert
Expert

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?

View solution in original post

0 Kudos
2 Replies
mattboren
Expert
Expert

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?

0 Kudos
vmwaredownload
Enthusiast
Enthusiast

Workled flawlessly

Thanks!

0 Kudos