Bug 1312149

Summary: Booting from iSCSI LUKS partition hangs for 90 seconds
Product: Red Hat Enterprise Linux 7 Reporter: William Skupa <skupawa>
Component: dracutAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Release Test Team <release-test-team>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: dracut-maint-list, harald, jstodola, mbanas, skupawa
Target Milestone: rcFlags: harald: needinfo?
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-06 12:45:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1289485, 1313485    

Description William Skupa 2016-02-25 21:22:05 UTC
Description of problem:
Booting from a LUKS partition mounted over iSCSI takes 90 seconds.  This is because LUKS systemd service blocks the iSCSI systemd service.  Once the LUKS service times out after 90 seconds, the iSCSI drive is mounted and decrypted and the boot continues.

If you switch 95iscsi/iscsiroot.sh to use iscsistart instead of systemd-run, the problem goes away

Version-Release number of selected component (if applicable):
dracut 033-360.el7_2
dracut-network 033-360.el7_2

How reproducible:
100%

Steps to Reproduce:
1.  Create a system with an iSCSI root LUKS partition.  crypttab and key are both stored in dracut image.  Kernel params are used to specify iSCSI info
    crypttab device /dev/sda1
    root=/dev/dm-0
    netroot=<iscsi.target>
2. Boot system

Actual results:
[  OK  ] Reached target Paths.
<System hangs for 90 seconds>
[ TIME ] Timed out waiting for device dev-sda1.device
[DEPEND] Dependency failed for Cryptography Setup for luks-<UUID>
[DEPEND] Dependency failed for Encrypted Volumes
[  OK  ] Reached target System Initialization
[  OK  ] Listening on Open-iSCSI iscsiuio Socket
[  OK  ] Reached target Sockets
[  OK  ] Reached target Basic System
         Starting Login iSCSI Target <iscsi.target>
[  OK  ] Started Login iSCSI Target <iscsi.target>
         Starting Cryptography Setup for luks-<UUID>
[  OK  ] Found device /dev/mapper/luks-<UUID>
[  OK  ] Found device /dev/dm-0
[  OK  ] Started Cryptography Setup for luks-<UUID>

Expected results:
System shouldn't hang for 90 seconds

Additional info:
After forcing the code to use iscsistart instead of systemd-run:

[  OK  ] Reached target Paths.
[   11.188915] dracut-initque[309]: iscsistart: Can not bind IPC socket
[   11.189141] dracut-initque[309]: iscsistart: Could not setup mgmt ipc
[  OK  ] Found device <iscsi.target> 1.
         Starting Cryptography Setup for luks-<UUID>
[  OK  ] Found device /dev/mapper/luks-<UUID>
[  OK  ] Found device /dev/dm-0
[  OK  ] Started Cryptography Setup for luks-<UUID>
[  OK  ] Reached target Encrypted Volumes
[  OK  ] Reached target System Initialization
[  OK  ] Listening on Open-iSCSI iscsiuio Socket
[  OK  ] Reached target Sockets
[  OK  ] Reached target Basic System

Comment 3 Harald Hoyer 2017-01-11 12:26:54 UTC
Does it help to add:

                           -p 'DefaultDependencies=no' \

to the systemd-run call?

Comment 4 William Skupa 2018-09-18 20:45:25 UTC
Project was terminated. Recommend closing for lack of data