[node-patches] Change in ovirt-node[ovirt-3.5]: installer: Name multipathed device for boot

fabiand at redhat.com fabiand at redhat.com
Thu Dec 18 14:11:25 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: installer: Name multipathed device for boot
......................................................................

installer: Name multipathed device for boot

Previously (pre-el7) it was tried to discover and assemble the correct
multipath devices in dracut - this worked quite well.
In el7 we need to name multipath devices we want to get assembled in
dracut, if not, then the assmebling can fail due to races with dracut
and udev.
To prevent this, now the wwid of the multipathed root device is given on
the kernel cmdline, this is then pickedup within dracut to assemble the
correct device.

Change-Id: I13b9cd1c07b0780813ba91cf75a7ed0070c306d0
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1152948
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
(cherry picked from commit 99673926becd068b3af5ac82fe8449cab58d27e4)
---
M src/ovirtnode/install.py
1 file changed, 24 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/79/36279/1

diff --git a/src/ovirtnode/install.py b/src/ovirtnode/install.py
index b71602a..abf9849 100755
--- a/src/ovirtnode/install.py
+++ b/src/ovirtnode/install.py
@@ -560,6 +560,30 @@
                                                             ).replace(
                                                             "rd_NO_MULTIPATH",
                                                             "")
+
+        with open("/etc/system-release-cpe", "r") as src:
+            is_el7 = ":7:" in src.read()
+        if is_el7 and self.disk and self.disk.startswith("/dev/mapper"):
+            """On el7 we need to specify the wwid of the root device, if it
+            is using multiple paths, to prevent races within dracut.
+            Basically there are two options:
+            1. bake wwid of root device into initrd
+            2. pass wwid of root device on kernel cmdline
+            I choose 2 because it seems to be less invasive.
+            https://bugzilla.redhat.com/show_bug.cgi?id=1152948
+            """
+            wwidcmd = "multipath -ll | egrep -o '^.*dm-[0-9]' | cut -d' ' -f1"
+            logger.debug("We are on el7, checking for multipath: %s" % wwidcmd)
+            wwidproc = _functions.subprocess_closefds(wwidcmd, shell=True,
+                                                      stdout=subprocess.PIPE,
+                                                      stderr=subprocess.STDOUT)
+            wwidout, wwiderr = wwidproc.communicate()
+            logger.debug("multipath returned: %s -- %s" % (wwidout, wwiderr))
+            wwid = wwidout.strip()
+            logger.debug("Using multipath wwid: %s" % wwid)
+            self.bootparams += " mpath.wwid=%s" % wwid
+            logger.debug("Cmdline with mpath: %s" % self.bootparams)
+
         if " " in self.disk or os.path.exists("/dev/cciss"):
             # workaround for grub setup failing with spaces in dev.name:
             # use first active sd* device
@@ -582,7 +606,6 @@
             sysfs = open("/proc/sys/vm/drop_caches", "w")
             sysfs.write("3")
             sysfs.close()
-
         if not self.disk.startswith("/dev/"):
             self.disk = "/dev/" + self.disk
         try:


-- 
To view, visit http://gerrit.ovirt.org/36279
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I13b9cd1c07b0780813ba91cf75a7ed0070c306d0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>



More information about the node-patches mailing list