VMware Cloud Community
Pinball
Enthusiast
Enthusiast

Get-SpbmStoragePolicy fails with "Index was outside the bounds of the array"

Hi All

Trying to make use of William Lams great post on correcting VSAN Thick/Thin disk assignment but getting the following when trying to use the script or a single command. I've seen this on a similar pos related to consuming Tags.

Environment:

Client side = Windows 10

PowerCli Version = VMware vSphere PowerCLI 6.3 Release 1 build 3737840

vCenter = VCSA 6.0 U2 Build 3634794

Script source:

http://www.virtuallyghetto.com/2016/06/heads-up-ovfova-always-deployed-as-thick-on-vsan-when-using-v...

Error:

PowerCLI C:\Scripts> Get-SpbmStoragePolicy -Name "my"

Get-SpbmStoragePolicy : 26/07/2016 14:47:01    Get-SpbmStoragePolicy        Index was outside the bounds of the array.

At line:1 char:1

+ Get-SpbmStoragePolicy -Name "my"

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Get-SpbmStoragePolicy], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Storage.Commands.Cmdlets.Spbm.GetStora

   geProfile

Running the full script: (modified the line with the vc connection details and the line where the vm is listed.

PowerCLI C:\Scripts> .\Set-VSANPolicy.ps1

Applying VSAN VM Storage Policy: Virtual SAN Default Storage Policy to DLTGIT01 ...

Get-SpbmEntityConfiguration : 26/07/2016 10:13:37    Get-SpbmEntityConfiguration        Index was outside the bounds

of the array.

At C:\Scripts\Set-VSANPolicy.ps1:25 char:53

+ ... onfiguration -Configuration (Get-SpbmEntityConfiguration $hds) -Stora ...

+                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Get-SpbmEntityConfiguration], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Storage.Commands.Cmdlets.Spbm.GetSpbmE

   ntityConfiguration

Set-SpbmEntityConfiguration : Cannot validate argument on parameter 'Configuration'. The argument is null or empty.

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

If it's any consolation, you're not alone.

The issue has been reported several times before.

Looks like a bug I'm afraid.

Over to the Dev Team.


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

Reply
0 Kudos
Pinball
Enthusiast
Enthusiast

Thanks for the quick response Luc

I'll wait in the wings then for the fix. Any suggestions on a workaround then, this VSAN thick/tin conversion is quite an issue and it seems like PowerCli is the only way.

I'll ask William on his block what version he used to make it work.

Johan

Reply
0 Kudos
lamw
Community Manager
Community Manager

I recall running the latest version which was PowerCLI 6.3 R1 but didn't run into the bug you mentioned. Since then, I've upgraded to several other versions for beta testing, so I can't say 100%. Maybe alanrenouf‌ can chime in on this particular issue?

Reply
0 Kudos
jb_bhs
Contributor
Contributor

Somewhat similarly, I get this when trying to run Get-SpbmEntityConfiguration to check compliance:

Get-SpbmEntityConfiguration : 8/16/2016 2:12:02 PM    Get-SpbmEntityConfiguration        Index was out of range. Must be non-negative and less than the size

of the collection.

Parameter name: index   

At line:1 char:1

+ Get-SpbmEntityConfiguration

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Get-SpbmEntityConfiguration], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Storage.Commands.Cmdlets.Spbm.GetSpbmEntityConfiguration



Reply
0 Kudos