VMware Cloud Community
kirancsh
Contributor
Contributor
Jump to solution

I'm trying to fetch I/o imbalance value set for sdrs cluster using powercli but not finding any options. Request your help.

I searched for few days to find the option to fetch "I/o imbalance" value set for sdrs cluster using powercli but didn't any options. Request your help.

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Like this

Get-DatastoreCluster |

Select Name,

@{N = 'IoLoadImbalanceThreshold'; E = {$_.ExtensionData.PodStorageDrsEntry.StorageDrsConfig.PodConfig.IoLoadBalanceConfig.IoLoadImbalanceThreshold}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

7 Replies
LucD
Leadership
Leadership
Jump to solution

Could you explain what you mean by "IO imbalance value"?
Where do you see/set that value in for example the Web Client?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
kirancsh
Contributor
Contributor
Jump to solution

Thank you LucD for fast response. Please find the screenshot.

pastedImage_1.png

Configure --> Storage DRS --> Advanced Options --> I/O imbalance threshold

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You can change that value like this

$dscName = 'MyDsc'

$newLoadImbalanceThreshold = 10


$dsc = Get-DatastoreCluster -Name $dscName

$si = Get-View ServiceInstance

$storMgr = Get-View -Id $si.Content.StorageResourceManager

$dsc.ExtensionData.PodStorageDrsEntry.StorageDrsConfig.PodConfig.IoLoadBalanceConfig


$spec = New-Object VMware.Vim.StorageDrsConfigSpec

$spec.PodConfigSpec = New-Object VMware.Vim.StorageDrsPodConfigSpec

$spec.PodConfigSpec.IoLoadBalanceConfig = New-Object VMware.Vim.StorageDrsIoLoadBalanceConfig

$spec.PodConfigSpec.IoLoadBalanceConfig.IoLoadImbalanceThreshold = $newLoadImbalanceThreshold

$storMgr.ConfigureStorageDrsForPod($dsc.ExtensionData.MoRef,$spec,$true)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
kirancsh
Contributor
Contributor
Jump to solution

Thank you LucD. Your script is for to modify the value. I'm looking for to fetch the value. Which part I need to modify to achieve it?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Like this

Get-DatastoreCluster |

Select Name,

@{N = 'IoLoadImbalanceThreshold'; E = {$_.ExtensionData.PodStorageDrsEntry.StorageDrsConfig.PodConfig.IoLoadBalanceConfig.IoLoadImbalanceThreshold}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

kirancsh
Contributor
Contributor
Jump to solution

Thank you LucD. This worked. I did tried for this for many days and no where in internet this was available. You provided the solution in minutes. Thanks again.

This property is 5 layer down, so please guide me if  any method you use to identify deeper properties.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Well, it's all documented in the API Reference (make sure you pick the correct version).

And there is a bit of guess work (and experience).

In this case I "guessed" that the property would be named something like "ioloadImbalanceThreshold".
On the web page (API Reference) you can search, which will point you to one or more hits.

ioload.jpg

Another option is the follow the path from the top.
In that case you would start from the StoragePod (which is the name of a DatastoreCluster in the API) object.
From there descend: podStorageDrsEntry - storageDrsConfig - podConfig - ioLoadBalanceConfig

A third method is to dump the complete object, redirect the output to a file and then do a search.
Remember we are looking at the API Properties, so we start from the ExtensionData property.

And you might have to play with the Depth parameter, depending on how deep the property is located.

$dsc = Get-DatastoreCluster -Name DSC1

$dsc.ExtensionData | Format-Custom -Depth 7 | Out-File -FilePath C:\Temp\out.txt

ioload2.jpg


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos