solidfire / PowerShell

Collection of scripts, functions, and examples using the SolidFire Tools for PowerShell
MIT License
27 stars 20 forks source link

Parameter asignment and matching in Get-SFiSCSISession #71

Closed scaleoutsean closed 2 years ago

scaleoutsean commented 5 years ago
PS /home/sean> Get-SFIscsiSession -Target 192.168.103.29
Get-SFIscsiSession : Unable to find SFConnection with Name or Target/IP like '192.168.103.29'.
At line:1 char:1
+ Get-SFIscsiSession -Target 192.168.103.29
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (:) [Get-SFIscsiSession], Exception
+ FullyQualified

1) I didn't specify any SFConnection so Target shouldn't be matched against it 2) Target - whether it's specified as IP, IP:3260, or *VolumeName* - doesn't get matched against valid TargetName or TargetIP. 3) Without -Target, the cmdlet works but on one physical HCI cluster with v11, it shows AccountID 0 for all sessions, and therefore misses to translate it to the correct AccountName (null string all the time). On another v11 cluster (SF-Demo node), I have two volumes with one session each, and in this case both AccountID and AccountName are correctly collected and displayed. I can't tell why this is happening.

It would be nice to have -NodeID added as another optional parameter to this cmdlet, as there seems to be no easy way to get the number of active connections on individual storage node.

arjun960 commented 2 years ago

@scaleoutsean Please find answers below:

  1. I didn't specify any SFConnection so Target shouldn't be matched against it

    SFConnection is like a Session object whereas target is the hostname that SFconnection points to. Every command in powershell when ran tries to find whether or not there are any active SFconnection objects. So, in this case when Target parameter is passed to Get-SFIscsiSession commandlet it is trying to find a SFConnection with that target Name. SFConnection has to match against the Target provided. Also, the Error message above tells that there is no active solidfireconnections, which necessitates the need for running Connect-SFcluster.

  2. Target - whether it's specified as IP, IP:3260, or VolumeName - doesn't get matched against valid TargetName or TargetIP.

    Assuming your ask here is to pass a valid IP address, IP:3260 or VolumeName to the Target Parameter - I hope that the explanation given above would answer. Also, Mostly Target comes as a advantage when we want to work with multiple solidfire connections present in a single powershell session. And when there are multiple connections present, and want to run a command we can pass wildcard strings to Target parameter to filter out the specific connection corresponding to wildcard specified. Some examples of wildcard are: 10.113., cluster*.

  3. Without -Target, the cmdlet works but on one physical HCI cluster with v11, it shows AccountID 0 for all sessions, and therefore misses to translate it to the correct AccountName (null string all the time). On another v11 cluster (SF-Demo node), I have two volumes with one session each, and in this case both AccountID and AccountName are correctly collected and displayed. I can't tell why this is happening.

    This issue is duplicate of other powershell issue created here https://github.com/solidfire/PowerShell/issues/85. An element bug has been raised to fix this issue as it is element issue and the fix will be available in future element releases.
  4. It would be nice to have -NodeID added as another optional parameter to this cmdlet, as there seems to be no easy way to get the number of active connections on individual storage node.

     This is a valid task, the changes have been made to pass -NodeId parameter to the Get-SFISCSISessions commandlet, and the changes will be available in the next SDK release.
arjun960 commented 2 years ago

@scaleoutsean NodeID parameter has been added to Get-SFISCSISessions commandlet. And the changes will be available in the next SDK release. So, closing the issue.