Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-IscsiSession seems to lowercase the TargetNodeAddress attribute which causes issues for piping the object etc #17306

Closed
5 tasks done
travisghansen opened this issue May 11, 2022 · 3 comments
Labels
Needs-Triage The issue is new and needs to be triaged by a work group. Resolution-External The issue is caused by external component(s).

Comments

@travisghansen
Copy link

Prerequisites

Steps to reproduce

Initially discussed on the kubernetes slack in the csi-windows channel.

Observe the below:

Get-IscsiTarget | ConvertTo-Json
{
    "CimInstanceProperties":  [
                                  {
                                      "Name":  "NodeAddress",
                                      "Value":  "iqn.2000-01.com.synology:XpenoDsm62x.csi-pvc-111-clustera",
                                      "CimType":  14,
                                      "Flags":  "Property, Key, NotModified",
                                      "IsValueModified":  false
                                  }
                              ],
    "NodeAddress":  "iqn.2000-01.com.synology:XpenoDsm62x.csi-pvc-111-clustera",
}


Get-IscsiSession | ConvertTo-Json
{
    "CimInstanceProperties":  [
                                  {
                                      "Name":  "TargetNodeAddress",
                                      "Value":  "iqn.2000-01.com.synology:xpenodsm62x.csi-pvc-111-clustera",
                                      "CimType":  14,
                                      "Flags":  "Property, NotModified",
                                      "IsValueModified":  false
                                  },
                              ],
    "TargetNodeAddress":  "iqn.2000-01.com.synology:xpenodsm62x.csi-pvc-111-clustera",
}

# difference
iqn.2000-01.com.synology:XpenoDsm62x.csi-pvc-111-clustera
iqn.2000-01.com.synology:xpenodsm62x.csi-pvc-111-clustera

# makes these fail
Disconnect-IscsiTarget -NodeAddress $iqn -Confirm:$false
Get-iSCSISession -IscsiTarget $t

Expected behavior

I can use the referenced target to delete a session, or disconnect a target via `NodeAddress` property.

Actual behavior

It depends on the particular use-case:

- `Disconnect-IscsiTarget -NodeAddress $iqn -Confirm:$false` - noop
- `Get-iSCSISession -IscsiTarget $t` - error below
- I'm sure there are other relevant scenarios where things fail due to the discrepancy

Error details

Get-iSCSISession -IscsiTarget $t
Get-iSCSISession : No matching MSFT_iSCSISession objects found by CIM query for enumerating instances of the ROOT/Microsoft/Windows/Storage/MSFT_iSCSISession class on the  CIM server, that are associated with the following instance: MSFT_iSCSITarget (NodeAddress =
"iqn.2000-01.com.synology:SynologyDSM7.d...). Verify query parameters and retry.
At line:1 char:1
+ Get-iSCSISession -IscsiTarget $t
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (MSFT_iSCSISession:String) [Get-IscsiSession], CimJobException
    + FullyQualifiedErrorId : CmdletizationQuery_NotFound,Get-IscsiSession

PS C:\Users\Administrator\Projects\democratic-csi> Get-Error
Get-Error : The term 'Get-Error' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-Error
+ ~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-Error:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


### Environment data

```powershell
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.2867
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.2867
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


### Visuals

_No response_
@travisghansen travisghansen added the Needs-Triage The issue is new and needs to be triaged by a work group. label May 11, 2022
@travisghansen
Copy link
Author

travisghansen commented May 11, 2022

In my initial debugging I found this article and believe the individual was experiencing exactly this issue: https://community.spiceworks.com/topic/2279882-synology-iscsi-will-not-disconnect-using-powershell-commands

The Spiceworks Community
experts, We use Synology DS1517+ as our external storage on Windows server 2016 server using micr... | Data Storage, Windows Server, and PowerShell

@daxian-dbw
Copy link
Member

The reported issue is specific to the iSCSI module, which is in the System32 module path and only supports Windows PowerShell. This repository is only for PowerShell Core (PowerShell 7+). Windows PowerShell (5.1) specific issues should be reported with the Feedback Hub app, by choosing "Apps > PowerShell" in category.

@daxian-dbw daxian-dbw added the Resolution-External The issue is caused by external component(s). label May 11, 2022
@ghost
Copy link

ghost commented May 13, 2022

This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

@ghost ghost closed this as completed May 13, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Triage The issue is new and needs to be triaged by a work group. Resolution-External The issue is caused by external component(s).
Projects
None yet
Development

No branches or pull requests

2 participants