ONTAP Discussions

Issue with Remotely Invoking SDCLI commands with PowerShell?

n_yannios
2,800 Views

We are using Windows PowerShell with remoting.  We issue a PowerShell Invoke command to run SDCLI on a remote server.  SDCLI DISK LIST commands work fine, however when we go to run a more complex command such as the one below to create a LUN and mount it, not all of the parameters that were passed are being interpreted correctly.

Invoke-Command -computername TEST -scriptblock { SDCLI DISK CREATE  -m TEST -p N1:/vol/clientvol_aggr6001_lun_1/Testdb_LUN1 -d C:\NA_Mounts\Testdb_LUN1 -dtype dedicated  -IG TEST TEST -z 65MB -rs n  }

When the command is received on the remote system the command received is identical to the command that was sent, however the argument  after the -z is not being interpreted correctly and we see this error from the utility.


Invalid disk size 104857600MB. Must be in range [64MB, 2002022MB].
Please enter a valid disk size.

Yet if we run powershell and PASTE (or type) the EXACT command on the remote system with the utility from a remote desktop or the console, the command works correctly.

What would cause this?  We are just passing a static string?

Thanks

Nikos

1 REPLY 1

n_yannios
2,800 Views

After some more testing, we were able to get the command to successfully work by simply dropping the "MB" after the number and allowing it to default

invoke-command -computername TEST -scriptblock { sdcli disk create -m test -p netapp1:/vol/clientvol_aggr6001_lun_1/testdb_lun3 -d c:\netapp_mounts\testdb_lun3 -dtype dedicated -IG TEST viaRPC.21:00:00:1b:32:10:f0:a2.TEST -z 1000 }

TEST : Checking input parameters
TEST : Checking access control
TEST : Checking policies
TEST : Turning off snap scheduling
TEST : Creating the LUN
TEST : Creating a partition
TEST : Formatting the disk with NTFS
TEST : Mounting volume on the disk
UNC Path: None
LUN Path: NetApp1:/vol/clientvol_aggr6001_lun_1/testdb_lun3
Storage System:  NetApp1
Storage System Path: /vol/clientvol_aggr6001_lun_1/testdb_lun3
Type:   lun
Disk serial number: W9mPNo/bO0a0
Backed by Snapshot Copy:
Shared:   No
BootOrSystem Disk: No
SCSI port:  2
Bus:   0
Target:   0
LUN:   9
Readonly:  No
Size:   1004
Snapmirror Source: No
Snapvault Primary: No
Disk Partition Style: GUID Partition Table (GPT)
Clone Split Restore status: Normal
DiskID:   19
Volume Name:  \\?\Volume{f11d06d0-b9bb-4617-a295-3caeff6fc0de}\
Mount points:  c:\netapp_mounts\testdb_lun3\
IP Addresses:  10.146.0.10, 10.146.10.2, 10.146.4.150
The operation completed successfully.

A snippet of the code that we used to issue the remote command from C# is attached....

Nikos

Public