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

The Jiva iSCSI target returns a negative "target portal group tag" upon discovery #28

Closed
ksatchit opened this issue Nov 4, 2017 · 1 comment

Comments

@ksatchit
Copy link

ksatchit commented Nov 4, 2017

The discovery of a Jiva iSCSI target via the Ctrl Pod/Service IP is seen to return a negative value (-1) for the target portal group tag.

karthik@MayaHost01:/var/openebs$ sudo iscsiadm -m discovery -t st -p 10.36.0.1:3260
10.102.158.249:3260,-1 iqn.2016-09.com.openebs.jiva:pvc-2845cd53-c11f-11e7-9be8-000c298ff5fc

The ansible-based integration test attempting login/volume mount is seen to fail due to the above.

Some details about this key from iSCSI RFC :

TargetPortalGroupTag=<16-bit-binary-value>

Examples:
TargetPortalGroupTag=1

The target portal group tag is a 16-bit binary-value that uniquely
identifies a portal group within an iSCSI target node. This key
carries the value of the tag of the portal group that is servicing
the Login request. The iSCSI target returns this key to the
initiator in the Login Response PDU to the first Login Request PDU
that has the C bit set to 0 when TargetName is given by the
initiator.

For the complete usage expectations of this key see Section 5.3 Login
Phase

Test error details :

  • Ansible uses an open-iscsi module to perform discovery, login etc.., It fails with following error :
TASK [Establish iSCSI session with volume] *****************************************************************************
task path: /home/ciuser/openebs/e2e/ansible/playbooks/feature/snapshots/test-snapshot.yml:67
fatal: [localhost -> None]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Shared connection to 20.10.49.12 closed.\r\n", "module_stdout": "\r\nTraceback (most recent call last):\r\n  File \"/tmp/ansible_8U8slY/ansible_module_open_iscsi.py\", line 390, in <module>\r\n    main()\r\n  File \"/tmp/ansible_8U8slY/ansible_module_open_iscsi.py\", line 333, in main\r\n    target = nodes[0]\r\nIndexError: list index out of range\r\n", "msg": "MODULE FAILURE", "rc": 0}
  • In the ansible open-iscsi module, the discovery o/p is processed here :
def iscsi_get_cached_nodes(module, portal=None):

    cmd = '%s --mode node' % iscsiadm_cmd
    (rc, out, err) = module.run_command(cmd)

    if rc == 0:
        lines = out.splitlines()
        nodes = []
        for line in lines:
            # line format is "ip:port,target_portal_group_tag targetname"
            parts = line.split()
            if len(parts) > 2:
                module.fail_json(msg='error parsing output', cmd=cmd)
            target = parts[1]
            parts = parts[0].split(':')
            target_portal = parts[0]

            if portal is None or portal == target_portal:
                nodes.append(target)
@ksatchit
Copy link
Author

This is fixed by 7572788

karthik@MayaHost01:~$ sudo iscsiadm -m discovery -t st -p 10.44.0.3:3260
[sudo] password for karthik:
10.109.235.159:3260,1 iqn.2016-09.com.openebs.jiva:pvc-4f9b0571-d521-11e7-a157-000c298ff5fc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant