← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~smoser/maas/iscsi-root-equal into lp:maas

 

Scott Moser has proposed merging lp:~smoser/maas/iscsi-root-equal into lp:maas.

Commit message:
in ephemeral/commissioning boot, specify root= by iscsi device path

previously we were booting iscsi root with 'LABEL=cloudimg-rootfs'.
There were a few issues with that:
 a.) that implied/required that all ephemeral images would have this root
     filesystem label.
 b.) if there was a filesystem on the local system with the given label
     the selected device would be non-determinable.
     This could happen innocently, or potentially on purpose as an attempt
     to retain control of a system after it had been returned.

By booting with a /dev/disks/by-path, we're explicitly telling the
initramfs that is being sent that we want the root device to come over
iscsi.  The tradeoff here is that we're now expecting the kernel/initramfs
to consistently provide this path.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1075313 in MAAS: "no reliable way to boot from iscsi root"
  https://bugs.launchpad.net/maas/+bug/1075313

For more details, see:
https://code.launchpad.net/~smoser/maas/iscsi-root-equal/+merge/146016

in ephemeral/commissioning boot, specify root= by iscsi device path

previously we were booting iscsi root with 'LABEL=cloudimg-rootfs'.
There were a few issues with that:
 a.) that implied/required that all ephemeral images would have this root
     filesystem label.
 b.) if there was a filesystem on the local system with the given label
     the selected device would be non-determinable.
     This could happen innocently, or potentially on purpose as an attempt
     to retain control of a system after it had been returned.

By booting with a /dev/disks/by-path, we're explicitly telling the
initramfs that is being sent that we want the root device to come over
iscsi.  The tradeoff here is that we're now expecting the kernel/initramfs
to consistently provide this path.

-- 
https://code.launchpad.net/~smoser/maas/iscsi-root-equal/+merge/146016
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~smoser/maas/iscsi-root-equal into lp:maas.
=== modified file 'src/provisioningserver/kernel_opts.py'
--- src/provisioningserver/kernel_opts.py	2012-11-08 10:05:27 +0000
+++ src/provisioningserver/kernel_opts.py	2013-02-01 01:14:23 +0000
@@ -126,19 +126,20 @@
     """Return the list of the purpose-specific kernel options."""
     if params.purpose == "commissioning":
         # These are kernel parameters read by the ephemeral environment.
+        tname = "%s:%s" % (ISCSI_TARGET_NAME_PREFIX,
+                           get_ephemeral_name(params.release, params.arch))
         return [
             # Read by the open-iscsi initramfs code.
-            "iscsi_target_name=%s:%s" % (
-                ISCSI_TARGET_NAME_PREFIX,
-                get_ephemeral_name(params.release, params.arch)),
+            "iscsi_target_name=%s" % tname,
             "iscsi_target_ip=%s" % params.fs_host,
             "iscsi_target_port=3260",
             "iscsi_initiator=%s" % params.hostname,
             # Read by cloud-initramfs-dyn-netconf and klibc's ipconfig
             # in the initramfs.
             "ip=::::%s:BOOTIF" % params.hostname,
-            # cloud-images have this filesystem label.
-            "ro root=LABEL=cloudimg-rootfs",
+            # kernel / udev name iscsi devices with this path
+            "ro root=/dev/disk/by-path/ip-%s:%s-iscsi-%s-lun-1" % (
+                params.fs_host, "3260", tname),
             # Read by overlayroot package.
             "overlayroot=tmpfs",
             # Read by cloud-init.

=== modified file 'src/provisioningserver/tests/test_kernel_opts.py'
--- src/provisioningserver/tests/test_kernel_opts.py	2012-11-08 10:05:27 +0000
+++ src/provisioningserver/tests/test_kernel_opts.py	2013-02-01 01:14:23 +0000
@@ -128,7 +128,7 @@
         self.assertThat(
             cmdline,
             ContainsAll([
-                "root=LABEL=cloudimg-rootfs",
+                "root=/dev/disk/by-path/ip-",
                 "iscsi_initiator=",
                 "overlayroot=tmpfs",
                 "ip=::::%s:BOOTIF" % params.hostname]))


Follow ups