Hi Luc ,
if yu can check following script i am planning to configure sioc on all datastores belonging to datastore cluster .
one of the prerequistes we have is to have only one extent in datastors .also the congestion threshold default value value to be 30
would yu like to add more to it in terms of vmdk shares .
$datastoreclusters=Get-DatastoreCluster
foreach($dcluster in $datastoreclusters)
{
$datastorecluster=Get-DatastoreCluster $dcluster
foreach($data in $datastorecluster)
{
$datastores = Get-Datastore -Location $data
foreach($d in $datastores )
{
$datastore = Get-Datastore $d
$freespaceGB=$datastore.FreeSpaceGB
$capacityGB=$datastore.CapacityGB
$freespaceratio=$freespaceGB/$capacityGB
$freespacepercent=$freespaceratio*100
$freespacepercentround=[math]::Round($freespacepercent)
[pscUSTOMoBJECT]@{
datastoreclustername = $datastorecluster.name
datastore = $datastore.name
extents=($datastore.ExtensionData.Info.Vmfs.Extent).Count
freespacepercentround = $freespacepercentround
storageiocontrolenabled = $datastore.StorageIOControlEnabled
congestionthreshold = $datastore.CongestionThresholdMillisecond
}
}
}}
Your script will work, but there is some duplication of cmdlets in there.
I would do something like this
ForEach-Object -Process {
Get-Datastore -Location $dsc -PipelineVariable ds |
ForEach-Object -Process {
New-Object -TypeName PSCustomObject -Property ([ordered]@{
DSCname = $dsc.Name
Datastore = $ds.Name
Extents = $ds.ExtensionData.Info.Vmfs.Extent.Count
FreeSpacePerc = [math]::Round($ds.FreespaceGB/$ds.CapacityGB*100)
SiocEnabled = $ds.StorageIOControlEnabled
CongestionThreshold = $ds.CongestionThresholdMillisecond
})
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Your script will work, but there is some duplication of cmdlets in there.
I would do something like this
ForEach-Object -Process {
Get-Datastore -Location $dsc -PipelineVariable ds |
ForEach-Object -Process {
New-Object -TypeName PSCustomObject -Property ([ordered]@{
DSCname = $dsc.Name
Datastore = $ds.Name
Extents = $ds.ExtensionData.Info.Vmfs.Extent.Count
FreeSpacePerc = [math]::Round($ds.FreespaceGB/$ds.CapacityGB*100)
SiocEnabled = $ds.StorageIOControlEnabled
CongestionThreshold = $ds.CongestionThresholdMillisecond
})
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
thanks luc but i wanted to know if we should configure shares also to vmdk to make it more effective .or this is sufficient enough .
also if yu could suggest what duplicates yu are referring .i understand pipeline variable makes it concise in case of nested loops as yu mentioned .
but the one which i posted should be correct also as im getting proper output .
please suggest if there is any major flaw using foreach loop besides little more code to it.
Not sure what you mean by "configure shares also to vmdk"
You are using Get-DatastoreCluster twice.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
well what i meant when there is a situation of contention (and congestion theshold exceeds 30 ms the default value)in datastore high priority vms can be given high shares
by configuring shares .
Afaik disk shares (if that is what you mean), prioritise disk access on a LUN.
The system organises the bandwidth distribution based on those relative shares.
This has nothing to do with SDRS, which uses space and IO on the datastore level.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Storage I/O Control, the basics | Yellow Bricks
as per this sioc uses disk shares to assgin i/o q slots.
Yes, but this has, as I said, nothing to do with the SDRS SIOC setting.
What Duncan describes is that VMs, based on their disk share, will get proportional IO bandwidth to the LUN.
The SDRS SIOC will move VMs off from a datastore when the SIOC count exceeds a threshold.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference