Merge lp:~smoser/maas/iscsi-root-equal into lp:~maas-committers/maas/trunk

Proposed by Scott Moser
Status: Merged
Approved by: Scott Moser
Approved revision: no longer in the source branch.
Merged at revision: 1428
Proposed branch: lp:~smoser/maas/iscsi-root-equal
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 42 lines (+7/-6)
2 files modified
src/provisioningserver/kernel_opts.py (+6/-5)
src/provisioningserver/tests/test_kernel_opts.py (+1/-1)
To merge this branch: bzr merge lp:~smoser/maas/iscsi-root-equal
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Raphaël Badin (community) Approve
Andres Rodriguez (community) Approve
Review via email: mp+146016@code.launchpad.net

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.

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Looks good to me.

review: Approve
Revision history for this message
Raphaël Badin (rvb) :
review: Approve
Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/provisioningserver/kernel_opts.py'
2--- src/provisioningserver/kernel_opts.py 2012-11-08 10:05:27 +0000
3+++ src/provisioningserver/kernel_opts.py 2013-02-01 01:14:23 +0000
4@@ -126,19 +126,20 @@
5 """Return the list of the purpose-specific kernel options."""
6 if params.purpose == "commissioning":
7 # These are kernel parameters read by the ephemeral environment.
8+ tname = "%s:%s" % (ISCSI_TARGET_NAME_PREFIX,
9+ get_ephemeral_name(params.release, params.arch))
10 return [
11 # Read by the open-iscsi initramfs code.
12- "iscsi_target_name=%s:%s" % (
13- ISCSI_TARGET_NAME_PREFIX,
14- get_ephemeral_name(params.release, params.arch)),
15+ "iscsi_target_name=%s" % tname,
16 "iscsi_target_ip=%s" % params.fs_host,
17 "iscsi_target_port=3260",
18 "iscsi_initiator=%s" % params.hostname,
19 # Read by cloud-initramfs-dyn-netconf and klibc's ipconfig
20 # in the initramfs.
21 "ip=::::%s:BOOTIF" % params.hostname,
22- # cloud-images have this filesystem label.
23- "ro root=LABEL=cloudimg-rootfs",
24+ # kernel / udev name iscsi devices with this path
25+ "ro root=/dev/disk/by-path/ip-%s:%s-iscsi-%s-lun-1" % (
26+ params.fs_host, "3260", tname),
27 # Read by overlayroot package.
28 "overlayroot=tmpfs",
29 # Read by cloud-init.
30
31=== modified file 'src/provisioningserver/tests/test_kernel_opts.py'
32--- src/provisioningserver/tests/test_kernel_opts.py 2012-11-08 10:05:27 +0000
33+++ src/provisioningserver/tests/test_kernel_opts.py 2013-02-01 01:14:23 +0000
34@@ -128,7 +128,7 @@
35 self.assertThat(
36 cmdline,
37 ContainsAll([
38- "root=LABEL=cloudimg-rootfs",
39+ "root=/dev/disk/by-path/ip-",
40 "iscsi_initiator=",
41 "overlayroot=tmpfs",
42 "ip=::::%s:BOOTIF" % params.hostname]))