[Bug 1802354] Re: iscsid does not run if there are only initramfs initiated targets
Scott Moser
ssmoser2+ubuntu at gmail.com
Tue Nov 27 20:07:12 UTC 2018
I'm marking bionic as verified.
In order to test this I did the following:
a.) have attached the log and artifacts from the open-iscsi dep8 run
for open-iscsi/2.0.874-5ubuntu2.4 on 2018-11-20 18:42:40 UTC
as 'bionic-autopkgtest.log' and 'bionic-autopkgtest-artifacts.tar.gz'
b.) tested on oracle bare metal.
Launched an instance of image '2018.10.16-0'
There was a more recent '2018.11.17-0', but I wanted to avoid any
workarounds that might have been put into it.
Upon connection via ssh:
## verify not running and show old version.
$ dpkg-query --show open-iscsi
open-iscsi 2.0.874-5ubuntu2.3
$ systemctl is-active iscsid.service
inactive
$ systemctl status iscsid.service --full --no-pager
● iscsid.service - iSCSI initiator daemon (iscsid)
Loaded: loaded (/lib/systemd/system/iscsid.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:iscsid(8)
# show there is a iscsi mount
$ ls /dev/disk/by-path/
ip-169.254.0.2:3260-iscsi-iqn.2015-02.oracle.boot:uefi-lun-1
ip-169.254.0.2:3260-iscsi-iqn.2015-02.oracle.boot:uefi-lun-1-part1
ip-169.254.0.2:3260-iscsi-iqn.2015-02.oracle.boot:uefi-lun-1-part14
ip-169.254.0.2:3260-iscsi-iqn.2015-02.oracle.boot:uefi-lun-1-part15
## enable -proposed and upgrade and reboot
$ echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-proposed main" | sudo tee -a /etc/apt/sources.list.d/proposed.list
deb http://archive.ubuntu.com/ubuntu bionic-proposed main
$ sudo apt-get update -q
$ sudo apt-get install open-iscsi
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
open-iscsi
1 upgraded, 0 newly installed, 0 to remove and 104 not upgraded.
Need to get 280 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 open-iscsi amd64 2.0.874-5ubuntu2.4 [280 kB]
...
Unpacking open-iscsi (2.0.874-5ubuntu2.4) over (2.0.874-5ubuntu2.3) ...
...
Setting up open-iscsi (2.0.874-5ubuntu2.4) ...
...
# the upgrade requires a reboot to fix.
$ systemctl is-active iscsid.service
inactive
$ sudo reboot
## ssh back in to see fix.
$ dpkg-query --show open-iscsi
open-iscsi 2.0.874-5ubuntu2.4
$ systemctl is-active iscsid.service
active
$ systemctl status iscsid.service --full --no-pager
● iscsid.service - iSCSI initiator daemon (iscsid)
Loaded: loaded (/lib/systemd/system/iscsid.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2018-11-27 20:04:06 UTC; 1min 22s ago
Docs: man:iscsid(8)
Process: 1885 ExecStart=/sbin/iscsid (code=exited, status=0/SUCCESS)
Process: 1873 ExecStartPre=/lib/open-iscsi/startup-checks.sh (code=exited, status=0/SUCCESS)
Main PID: 1890 (iscsid)
Tasks: 2 (limit: 11059)
CGroup: /system.slice/iscsid.service
├─1888 /sbin/iscsid
└─1890 /sbin/iscsid
Nov 27 20:04:01 smoser-b1 iscsid[1885]: iSCSI logger with pid=1888 started!
Nov 27 20:04:02 smoser-b1 iscsid[1888]: iSCSI daemon with pid=1890 started!
Nov 27 20:04:02 smoser-b1 iscsid[1888]: Could not read data from db. Using default and currently negotiated values
Nov 27 20:04:04 smoser-b1 iscsid[1888]: connection1:0 is operational after recovery (1 attempts)
Nov 27 20:04:00 smoser-b1 systemd[1]: Starting iSCSI initiator daemon (iscsid)...
Nov 27 20:04:06 smoser-b1 systemd[1]: Started iSCSI initiator daemon (iscsid).
** Tags removed: verification-needed-bionic
** Tags added: verification-done-bionic
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to open-iscsi in Ubuntu.
https://bugs.launchpad.net/bugs/1802354
Title:
iscsid does not run if there are only initramfs initiated targets
Status in open-iscsi package in Ubuntu:
Fix Released
Status in open-iscsi source package in Bionic:
Fix Committed
Status in open-iscsi source package in Cosmic:
Fix Committed
Bug description:
=== Begin SRU Template ===
[Impact]
A previous change to open-iscsi made under bug 1755858 caused a regression
that is seen when a system has only a iscsi mounts that were made
in the initramfs. The most likely scenario would be iscsi root.
The problem seen is that in this scenario the iscsid.service will not be
started. That generally works, but will have unexpected issues if
service is done to the iscsi target (external system). That could occur
if the remote system needed to be serviced for any reason. If iscsid
is running, the client will handle this scenario properly.
The change made here is to add a udev rule installed into
/lib/udev/rules.d/70-iscsi-disk.rules with the content:
SUBSYSTEM=="block", ACTION=="add", ENV{ID_PATH}=="*-iscsi-*",
ENV{SYSTEMD_WANTS}="iscsid.service"
The key things to see in that rule are:
a.) only matches on add of a block device.
We will not currently stop the iscsid.service ever via udev.
b.) only matches a PATH with '-iscsi-' in it.
tests show that ID_PATH will come up with something like:
ip-<ipv4-dotted-quad>:<port>-iscsi-<target>-lun-<lun>
example:
ip-192.168.1.1:3270-iscsi-mydisk1-lun-2
See other info section below for a 'udevadm info' output.
c.) uses SYSTEMD_WANTS.
More information can be seen on that at
https://www.freedesktop.org/software/systemd/man/systemd.device.html
doc states:
"[systemd_wants] may be used to activate arbitrary units when a specific
device becomes available."
[Test Case]
A check for iscsid.service to be running has been added to the dep8
test of the open-iscsi package. The simplist check is to have
the dep8 test run. The test will gate entry into -proposed so
we can have confidence the bug is fixed.
Since this bug was originally reported on Oracle public cloud instances
we should also test that platform.
To do that:
* launch a hardware instance on oracle of 16.04.
* verify iscsid.service is *not* running.
If iscsid.service is already running, it may have been started by
an image modification. To make this a valid test, you will
then need to disable whatever change made that occur.
* enable proposed and upgrade
* reboot
* verify that iscsid.service is running.
[Regression Potential]
The most likely chance for regression here would be the iscsid.service
running when it should not be running. Saving a udev rule execution
error, a false-positive on the 'match' above would trigger this.
It seems relatively unlikely that a non-iscsi device would have a ID_PATH
containing '-iscsi-', but is possible.
[Other Info]
Here is output of 'udevadm info' on a iscsi root device:
http://paste.ubuntu.com/p/dj89ScVR82/
There is autopkgtest run of proposed
bionic: http://paste.ubuntu.com/p/FqPPtD8jV6/
cosmic: http://paste.ubuntu.com/p/Fb3rYP7Xhs/
=== End SRU Template ===
It was reported that after the changes made in bug 1755858, the iscsid
service was not running when initramfs (via iscsi_* params or iBft)
set up an iscsi mount.
This seems to not be a problem until there is a restart of the iscsi
*host* service or some other hiccup. Thus, in normal testing you will
not see this issue.
--
Related bugs:
* bug 1755858: iscsid autostarts on all servers when it has nothing to do.
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: open-iscsi 2.0.874-5ubuntu2.3 [modified: lib/systemd/system/open-iscsi.service]
ProcVersionSignature: Ubuntu 4.15.0-36.39-generic 4.15.18
Uname: Linux 4.15.0-36-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.4
Architecture: amd64
Date: Thu Nov 8 17:42:46 2018
ProcEnviron:
TERM=screen.xterm-256color
PATH=(custom, no user)
LANG=C.UTF-8
SHELL=/bin/bash
SourcePackage: open-iscsi
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.iscsi.iscsid.conf: 2018-10-12T16:51:00.187144
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1802354/+subscriptions
More information about the foundations-bugs
mailing list