Merge lp:~saviq/cloud-initramfs-tools/nfs-support into lp:cloud-initramfs-tools

Proposed by Michał Sawicz on 2013-04-07
Status: Rejected
Rejected by: Scott Moser on 2017-10-27
Proposed branch: lp:~saviq/cloud-initramfs-tools/nfs-support
Merge into: lp:cloud-initramfs-tools
Diff against target: 79 lines (+44/-0)
2 files modified
overlayroot/etc/overlayroot.conf (+13/-0)
overlayroot/scripts/init-bottom/overlayroot (+31/-0)
To merge this branch: bzr merge lp:~saviq/cloud-initramfs-tools/nfs-support
Reviewer Review Type Date Requested Status
cloud-initramfs-tools 2013-04-07 Pending
Review via email: mp+157542@code.launchpad.net

Commit message

add NFS support to overlayroot

Description of the change

This adds support for NFS-backed overlayroot

Configuration:

overlayroot=nfs:host=10.0.0.1,path=/srv/nfs-overlay

This suffers from bug #1039402 unfortunately, so it's not really workable until the bug is fixed.

To post a comment you must log in.
Scott Moser (smoser) wrote :

Michał,
  Thanks for this. It generally looks fine to me. I'm OK to pull it into trunk, my only concern is bug 1039402.
  As I understand it, this is pretty much entirely broken without that bug fix in the kernel, right?

  If so, I'm just weary of pulling in code that is effectively "known broken". I'm not entirely opposed, especially if there is evidence that the kernel issue will be fixed. I'd definitely hold off on including it in ubuntu before raring release though.

  Thoughts?

Michał Sawicz (saviq) wrote :

W dniu 09.04.2013 16:05, Scott Moser pisze:
> Michał,
> Thanks for this. It generally looks fine to me. I'm OK to pull it into trunk, my only concern is bug 1039402.
> As I understand it, this is pretty much entirely broken without that bug fix in the kernel, right?

More or less, mounting with server-side locking supposedly helps, but
you can't actually mount it like that in initramfs, and I couldn't
remount later, so yeah.

> If so, I'm just weary of pulling in code that is effectively "known broken". I'm not entirely opposed, especially if there is evidence that the kernel issue will be fixed. I'd definitely hold off on including it in ubuntu before raring release though.
>
> Thoughts?

Perfectly agree. I mostly put it out there to get a feel whether I'm
getting anywhere with this. Holding off until the bug is fixed is perfect.

Thanks!
--
Michał Sawicz <email address hidden>
Canonical Services Ltd.

Dustin Kirkland  (kirkland) wrote :

On Tue, Apr 9, 2013 at 2:13 PM, Michał Sawicz
<email address hidden> wrote:
> W dniu 09.04.2013 16:05, Scott Moser pisze:
>> Michał,
>> Thanks for this. It generally looks fine to me. I'm OK to pull it into trunk, my only concern is bug 1039402.
>> As I understand it, this is pretty much entirely broken without that bug fix in the kernel, right?
>
> More or less, mounting with server-side locking supposedly helps, but
> you can't actually mount it like that in initramfs, and I couldn't
> remount later, so yeah.
>
>> If so, I'm just weary of pulling in code that is effectively "known broken". I'm not entirely opposed, especially if there is evidence that the kernel issue will be fixed. I'd definitely hold off on including it in ubuntu before raring release though.
>>
>> Thoughts?
>
> Perfectly agree. I mostly put it out there to get a feel whether I'm
> getting anywhere with this. Holding off until the bug is fixed is perfect.

I'm quite intrigued by the feature as well. Nice work. Cool idea. I
agree with publishing the branch and putting it into a holding state
until the kernel bug is fixed.

Cheers,
--
:-Dustin

Scott Moser (smoser) wrote :

Please excuse the harsh 'Rejected'.
I'm closing this right now because
a.) bug 1039402 makes it not really work
b.) i've moved code over to git.

If you want to re-submit, please feel free to do so to the git repo.

https://code.launchpad.net/~cloud-initramfs-tools/cloud-initramfs-tools/+git/cloud-initramfs-tools

Unmerged revisions

86. By Michał Sawicz on 2013-04-07

add NFS support to overlayroot

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'overlayroot/etc/overlayroot.conf'
2--- overlayroot/etc/overlayroot.conf 2012-08-29 00:51:40 +0000
3+++ overlayroot/etc/overlayroot.conf 2013-04-07 12:04:24 +0000
4@@ -66,6 +66,19 @@
5 # crypt:mapname=mapper,pass=foo,fstype=ext3,mkfs=1,dev=/dev/disk/by-label/my-jumpdrive,timeout=120
6 # crypt:dev=xvdb
7 #
8+# * overlayroot=nfs:host=IP,path=SHARE
9+# mount IP:SHARE as overlayfs and write changes there
10+#
11+# available parameters are:
12+# * host: default: "" [REQUIRED]
13+# use given server for backing filesystem.
14+# * path: default: "" [REQUIRED]
15+# use given share on the server for backing filesystem.
16+# * see COMMON PARAMETERS
17+#
18+# examples:
19+# overlayroot=nfs:host=10.0.0.1,path=/srv/nfs-overlay
20+#
21 # * overlayroot=disabled
22 # if set explicitly to 'disabled', or an empty string, then
23 # overlayroot will do nothing.
24
25=== modified file 'overlayroot/scripts/init-bottom/overlayroot'
26--- overlayroot/scripts/init-bottom/overlayroot 2012-08-29 01:42:00 +0000
27+++ overlayroot/scripts/init-bottom/overlayroot 2013-04-07 12:04:24 +0000
28@@ -258,6 +258,26 @@
29 _RET_DEVICE="$dev"
30 }
31
32+nfs_setup() {
33+ local options="$1" host="" path="/"
34+ # options supported:
35+ # host=ip,path=/
36+ parse_string "${options}" ||
37+ { log_fail "failed parsing '${options}'"; return 1; }
38+
39+ host=${_RET_host:-${host}}
40+ path=${_RET_path:-${path}}
41+
42+ [ -n "$host" ] ||
43+ { log_fail "host= argument not provided in '${options}'"; return 1; }
44+ [ -n "$path" ] ||
45+ { log_fail "path= argument not provided in '${options}'"; return 1; }
46+
47+ debug "host=${host} path=${path}"
48+
49+ _RET_DEVICE="${host}:${path}"
50+}
51+
52 overlayrootify_fstab() {
53 # overlayrootify_fstab(input, root_ro, root_rw, dir_prefix, recurse, swap)
54 # read input fstab file, write an overlayroot version to stdout
55@@ -504,6 +524,13 @@
56 mode="device"
57 device="$_RET_DEVICE"
58 ;;
59+ nfs:*)
60+ mode="nfs"
61+ opts=${overlayroot#nfs:}
62+ nfs_setup "${opts}" ||
63+ fail "failed setup overlay for ${overlayroot}${cfgmsg}"
64+ device="$_RET_DEVICE"
65+ ;;
66 crypt:*)
67 mode="crypt"
68 opts=${overlayroot#crypt:}
69@@ -573,6 +600,10 @@
70 # mount a tmpfs using the device name tmpfs-root
71 mount -t tmpfs tmpfs-root "${root_rw}" ||
72 fail "failed to create tmpfs"
73+elif [ "$mode" = "nfs" ]; then
74+ # mount the nfs share
75+ nfsmount -o nolock "$device" "${root_rw}" ||
76+ fail "failed mount backing share $device"
77 else
78 # dev or crypto
79 mount "$device" "${root_rw}" ||

Subscribers

People subscribed via source and target branches