target.service could not start after reboot of iSCSI target host and shows python traces

Solution Verified - Updated -

Issue

  • We have created iSCSI LUNs using targetcli and exported it to the initiator, the backstores used for LUNs were lvm volume.

    There were new PV, VG, LV created on iSCSI LUNs from initiator side. But after rebooting the target server, it was observed that target.service could not start automatically and shows errors that lvm volumes used for backstores are already in use:

    $ systemctl start target.service
    Job for target.service failed. See 'systemctl status target.service' and 'journalctl -xn' for details.
    
    # systemctl status target.service
    target.service - Restore LIO kernel target configuration
       Loaded: loaded (/usr/lib/systemd/system/target.service; enabled)
       Active: failed (Result: exit-code) since Sun 2015-01-05 10:27:12 CET; 8s ago
      Process: 1234 ExecStart=/usr/bin/targetctl restore (code=exited, status=1/FAILURE)
     Main PID: 1234 (code=exited, status=1/FAILURE)
    
    Jan 05 10:27:12 iscsihost target[1234]: errors = RTSRoot().restore_from_file(restore_file=from_file)
    Jan 05 10:27:12 iscsihost target[1234]: File "/usr/lib/python2.7/site-packages/rtslib/root.py", line 255, in restore_from_file
    Jan 05 10:27:12 iscsihost target[1234]: abort_on_error=abort_on_error)
    Jan 05 10:27:12 iscsihost target[1234]: File "/usr/lib/python2.7/site-packages/rtslib/root.py", line 189, in restore
    Jan 05 10:27:12 iscsihost target[1234]: so_obj = so_cls(**kwargs)
    Jan 05 10:27:12 iscsihost target[1234]: File "/usr/lib/python2.7/site-packages/rtslib/tcm.py", line 669, in __init__
    Jan 05 10:27:12 iscsihost target[1234]: self._configure(dev, wwn, readonly)
    Jan 05 10:27:12 iscsihost target[1234]: File "/usr/lib/python2.7/site-packages/rtslib/tcm.py", line 682, in _configure
    Jan 05 10:27:12 iscsihost target[1234]: + "device %s is already in use." % dev)         <<---------
    Jan 05 10:27:12 iscsihost target[1234]: rtslib.utils.RTSLibError: Cannot configure StorageObject because device /dev/mapper/vgtarget-lvlun1 i...dy in use.      <<---------
    Jan 05 10:27:12 iscsihost systemd[1]: target.service: main process exited, code=exited, status=1/FAILURE
    Jan 05 10:27:12 iscsihost systemd[1]: Failed to start Restore LIO kernel target configuration.
    Jan 05 10:27:12 iscsihost systemd[1]: Unit target.service entered failed state.
    Hint: Some lines were ellipsized, use -l to show in full.
    

Environment

  • Red Hat Enterprise Linux 7
  • targetcli

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.