Start a Conversation

Unsolved

This post is more than 5 years old

977

December 19th, 2016 05:00

ScaleIOPluginSetup-2.0-7536.0.ps1 - startIndex cannot be large r than length of string.

Hi All,


We are trialing EMC ScaleIO on vSphere 6.0.

So I have a setup of:

- 3 ESXi hosts with VMware ESXi, 6.0.0, 3620759

- vCSA 6.0.0, 4541948

And now I want to register the ScaleIO extension into vCenter server.

I have failed to configure it so far. As soon as I start the powershell script i get the following errors:

PowerCLI C:\EMC-ScaleIO-vSphere-plugin-installer-2.0-7536.0> . .\ScaleIOPluginSetup-2.0-7536.0.ps1

cmdlet ScaleIOPluginSetup-2.0-7536.0.ps1 at command pipeline position 1

Supply values for the following parameters:

(Type !? for Help.)

vCenter: vc01.******.****

Username: Administrator@***.***

Password: **********

Exception calling "Substring" with "1" argument(s): "startIndex cannot be larger than length of string.

Parameter name: startIndex"

At C:\EMC-ScaleIO-vSphere-plugin-installer-2.0-7536.0\ScaleIOPluginSetup-2.0-7536.0.ps1:835 char:1

+ $currentScriptVersion=$MyCurrentScriptName.substring( $index + ($scriptPrefix

.Le ...

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

~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ArgumentOutOfRangeException

You cannot call a method on a null-valued expression.

At C:\EMC-ScaleIO-vSphere-plugin-installer-2.0-7536.0\ScaleIOPluginSetup-2.0-7536.0.ps1:836 char:1

+ $index = $currentScriptVersion.IndexOf(".ps1")

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

    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.

At C:\EMC-ScaleIO-vSphere-plugin-installer-2.0-7536.0\ScaleIOPluginSetup-2.0-7536.0.ps1:837 char:1

+ $currentScriptVersion = $currentScriptVersion.substring(0, $index)

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

    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.

At C:\EMC-ScaleIO-vSphere-plugin-installer-2.0-7536.0\ScaleIOPluginSetup-2.0-7536.0.ps1:838 char:1

+ $currentScriptVersion=$currentScriptVersion.replace("-",".")

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

    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull


Can those error messages influence the registration of ScaleIO extension in vCenter ?

Bregs, Roman

December 21st, 2016 03:00

Hi Alaa

1. Yep

PowerCLI C:\scaleio> java -version

java version "1.8.0_66"

Java(TM) SE Runtime Environment (build 1.8.0_66-b18)

Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)

2. Not exactly the 6.0. I could not find it on VMware download site. So I am using 6.5:

   VMware PowerCLI 6.5 Release 1 build 4624819

Component Versions

   VMware Cis Core PowerCLI Component 6.5 build 4624453

   VMware VimAutomation Core PowerCLI Component 6.5 build 4624450

   VMWare ImageBuilder PowerCLI Component 6.5 build 4561891

   VMWare AutoDeploy PowerCLI Component 6.5 build 4561891

   VMware Vds PowerCLI Component 6.5 build 4624695

   VMware Cloud PowerCLI Component 6.5 build 4624821

   VMware HA PowerCLI Component 6.0 build 4525225

   VMware HorizonView PowerCLI Component 7.0.2 build 4596620

   VMware Licensing PowerCLI Component 6.5 build 4624822

   VMware PCloud PowerCLI Component 6.5 build 4624825

   VMware Storage PowerCLI Component 6.5 build 4624820

   VMware vROps PowerCLI Component 6.5 build 4624824

   VMware vSphere Update Manager PowerCLI 6.5 build 4540462

3. and 4. - No firewall between the Server and vCenter Server and connection between them is proper.

December 22nd, 2016 01:00

As I suspected the PowerShell errors described earlier were the reason why I failed to register ScaleIO extension in vSphere 6.0 environment.

As it is common to POC environments I started building my environment on the latest vSphere version which is 6.5.

Which means PowerCLI 6.5 and PowerShell 3.0. After I have figured out that ScaleIO is not supported yet on vSphere 6.5 I have switched over to 6.0. I have reinstalled my vSphere environment, deployed new vCenter server and installed (according to Alaa H. suggestion) PowerCLI 6.0 U3.

Still no use. Same PowerShell error was occurring and ScaleIO extension registration failed on vCenter side with the following errors:

[2016-12-20T12:03:44.159Z] [ERROR] session-init-pool-2156       70000433 100012 200006 com.vmware.vise.vim.extension.VcExtensionManager Invalid VC extension data, none of these attributes can be null:

Extension.key = com.emc.s3g.scaleio.vSpherePlugin

Extension.ClientInfo.version =

Extension.ClientInfo.url = https:// :65101/resources/plugin

Which made me think that it is not getting some crucial information from the PowerShell script - Plugin version to be exact.

So if I take look at PowerShell script where the version of the plugin is generated (lines 831-838 in ScaleIOPluginSetup-....ps1):

#Get currentScriptVersion

# defines a starting point for version lookup

$scriptPrefix="ScaleIOPluginSetup-"

# environmental variable to reach script name

$MyCurrentScriptName = $MyInvocation.InvocationName 

# starting index of prefix

$index = $MyCurrentScriptName.IndexOf( $scriptPrefix )

# cuts out prefix from script filename

$currentScriptVersion=$MyCurrentScriptName.substring( $index + ($scriptPrefix.Length) )

# get start index of filename extension

$index = $currentScriptVersion.IndexOf(".ps1")

# extracts version from filename

$currentScriptVersion = $currentScriptVersion.substring(0, $index)

# substitutes all dashes with dots

$currentScriptVersion=$currentScriptVersion.replace("-",".")

So in a long run, if you have a PowerShell script named ScaleIOPluginSetup-2.0-7536.0.ps1 by the end of this section you should be left with:

$currentScriptVersion="2.0.7536.0"

Which is used later in line 749:

- $extension.Version = $currentScriptVersion

and later as a part of object in registering the extension in vCenter.

I don't know whether it is PowerShell 3.0 specific behavior. As I see it, the $MyInvocation.InvocationName gives nothing, that's why everything else fails.

For me the workaround was to bluntly put extension version into PowerShell script by commenting out lines 832 to 838 and adding a new one:

$currentScriptVersion="2.0.7536.0"


No Events found!

Top