Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1684507 - missing /etc/target prevents iscsi target from being configured
Summary: missing /etc/target prevents iscsi target from being configured
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: rhosp-director-images
Version: 15.0 (Stein)
Hardware: All
OS: Linux
Target Milestone: beta
: 15.0 (Stein)
Assignee: Lon Hohberger
QA Contact: Gurenko Alex
Depends On:
TreeView+ depends on / blocked
Reported: 2019-03-01 12:06 UTC by Luca Miccini
Modified: 2019-03-18 14:06 UTC (History)
1 user (show)

Fixed In Version: rhosp-director-images-15.0-20190301.1.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Target Upstream Version:

Attachments (Terms of Use)

Description Luca Miccini 2019-03-01 12:06:44 UTC
Description of problem:

ipa-ramdisk is missing the /etc/target directory and this apparently prevents ironic-agent from creating the iscsi target.

conductor complains about:

2019-02-28 03:43:09.798 1 ERROR ironic.conductor.utils [req-04a05d1a-f5a7-4fb7-bb24-8085ce752577 - - - - -] Failed to start the iSCSI target to deploy the node a3cbbe57-03e9-4a4c-848a-662c184a3594. Error: {u'message': u"Error starting iSCSI target: Error starting iSCSI target: [Errno 2] No such file or directory: 'tgtd': 'tgtd'. Failed with exit code 2. stdout: None. stderr: None", u'code': 500, u'type': u'ISCSICommandError', u'details': u"Error starting iSCSI target: [Errno 2] No such file or directory: 'tgtd': 'tgtd'. Failed with exit code 2. stdout: None. stderr: None"}

but apparently it seems to be failing in 

def _start_lio(iqn, portal_port, device):
        storage = rtslib_fb.BlockStorageObject(name=iqn, dev=device)
        target = rtslib_fb.Target(rtslib_fb.FabricModule('iscsi'), iqn,
        tpg = rtslib_fb.TPG(target, mode='create')
        # disable all authentication
        tpg.set_attribute('authentication', '0')
        tpg.set_attribute('demo_mode_write_protect', '0')
        tpg.set_attribute('generate_node_acls', '1')
        # lun=1 is hardcoded in ironic
        rtslib_fb.LUN(tpg, storage_object=storage, lun=1)
        tpg.enable = 1
    except rtslib_fb.utils.RTSLibError as exc:
        msg = 'Failed to create a target: {}'.format(exc)
        raise errors.ISCSIError(msg)

        # bind to the default port on all interfaces
        listen_ip = netutils.wrap_ipv6(netutils.get_wildcard_address())
        rtslib_fb.NetworkPortal(tpg, listen_ip, portal_port)
    except rtslib_fb.utils.RTSLibError as exc:
        msg = 'Failed to publish a target: {}'.format(exc)
        raise errors.ISCSIError(msg)

calling _start_lio returns:

Traceback (most recent call last):
  File "", line 112, in <module>
    p = _start_lio("", '', '/dev/vda')
  File "", line 101, in _start_lio
    raise errors.ISCSIError(msg)
ironic_python_agent.errors.ISCSIError: Error starting iSCSI target: Error starting iSCSI target: Failed to create a target: Cannot set dbroot to /etc/target. Please check if this directory exists.

# ls /etc/targ*
ls: cannot access '/etc/targ*': No such file or directory

patching the ramdisk to include that directory allows the iscsi target to come up and the deployment to continue.

$ sudo dnf whatprovides /etc/target
Last metadata expiration check: 1:12:06 ago on Fri 01 Mar 2019 07:35:09 AM CET.
target-restore-2.1.fb67-5.fc29.noarch : Systemd service for targetcli/rtslib
Repo        : fedora
Matched from:
Filename    : /etc/target

targetcli-2.1.fb48-6.fc29.noarch : An administration shell for storage targets
Repo        : fedora
Matched from:
Filename    : /etc/target

Version-Release number of selected component (if applicable):

tested with osp15 20190228 images

How reproducible:


Steps to Reproduce:

reproduced with osp14 undercloud and osp15 images.

Additional info:

I kept some notes in

Note You need to log in before you can comment on or make changes to this bug.