ISCSI target validation fails when target name includes a ':'

Bug #1679222 reported by Blake Rouse
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
High
Unassigned
MAAS RSD
High
Unassigned
curtin
High
Nish Aravamudan
curtin (Ubuntu)
High
Unassigned
Xenial
Undecided
Unassigned
Yakkety
Undecided
Unassigned

Bug Description

Passes validation:

'user-mXTuYJ:pass-dvyBl7:init_user-Vwl10V:init_pass-w57xKH@56.104.48.78::3266:2:target-2wxHmO'

Fails validation:

'user-mXTuYJ:pass-dvyBl7:init_user-Vwl10V:init_pass-w57xKH@56.104.48.78::3266:2:iqn.maas.io:target-2wxHmO'

Error:
"invalid literal for int() with base 10: 'iqn.maas.io'"

For some reason it thinks iqn.maas.io is the lun, but '2' is the lun. Using this defined format in the documentation.

[user:password[:iuser:ipassword]@]host:proto:port:lun:targetname

Related branches

Revision history for this message
Blake Rouse (blake-rouse) wrote :

This patch fixes the issue with IPv4:

=== modified file 'curtin/block/iscsi.py'
--- curtin/block/iscsi.py 2017-02-18 00:33:38 +0000
+++ curtin/block/iscsi.py 2017-04-03 15:54:03 +0000
@@ -37,7 +37,7 @@
     ''', re.VERBOSE)

 RFC4173_TARGET_REGEX = re.compile(r'''^
- (?P<host>[^@]*): # greedy so ipv6 IPs are matched
+ (?P<host>[^@:]*): # greedy so ipv6 IPs are matched
     (?P<proto>[^:]*):
     (?P<port>[^:]*):
     (?P<lun>[^:]*):

But will break it for IPv6. I think the IPv6 matching will need to be improved to require the IP address to be wrapped in '[', ']'. The target name is allowed to have ':' and its actual quite common.

Since MAAS discovers already composed machines in RSD with ISCSI, target names without ':' cannot be enforced so this must be supported.

tags: added: rsd
tags: added: iscsi
Changed in maas:
status: New → Invalid
Changed in maasrsd:
status: New → Invalid
status: Invalid → Triaged
Changed in maas:
status: Invalid → Triaged
importance: Undecided → High
Changed in maasrsd:
importance: Undecided → High
Changed in curtin:
importance: Undecided → High
Changed in maas:
milestone: none → 2.2.0rc2
Changed in maasrsd:
milestone: none → beta
Nish Aravamudan (nacc)
Changed in curtin:
assignee: nobody → Nish Aravamudan (nacc)
Nish Aravamudan (nacc)
Changed in curtin:
status: Triaged → In Progress
Scott Moser (smoser)
Changed in curtin (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Changed in curtin:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package curtin - 0.1.0~bzr482-0ubuntu1

---------------
curtin (0.1.0~bzr482-0ubuntu1) zesty; urgency=medium

  * New upstream snapshot.
    - Fix iscsi disks that have a ':' in the target name. (LP: #1679222)
    - tests: re-enable ZestyTestMdadmBcache.
    - curthooks: fix pylint reported error when using ubuntu_core_curthooks.

 -- Scott Moser <email address hidden> Wed, 05 Apr 2017 15:22:25 -0400

Changed in curtin (Ubuntu):
status: Confirmed → Fix Released
Changed in maasrsd:
status: Triaged → Fix Committed
status: Fix Committed → Invalid
Changed in maas:
status: Triaged → Invalid
Changed in maas:
milestone: 2.2.0rc2 → none
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in curtin (Ubuntu Xenial):
status: New → Confirmed
Changed in curtin (Ubuntu Yakkety):
status: New → Confirmed
Scott Moser (smoser)
Changed in curtin:
status: Fix Committed → Fix Released
Changed in curtin (Ubuntu Xenial):
status: Confirmed → Fix Released
Changed in curtin (Ubuntu Yakkety):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers