Commit Graph

7 Commits

Author SHA1 Message Date
Serge Hallyn
1e0f62acaa ubuntu-cloud-prep hook: fix debug helper to not inappropriately fail
Bug found by Vincent Ladeuil <vila+ci@canonical.com>
Fix suggested by Scott Moser <smoser@ubuntu.com>

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-09 13:03:56 -05:00
Scott Moser
cb0c6c0203 hooks/ubuntu-cloud-prep: add hostname to meta-data
prior to my enabling of the clone hook, the setting of the hostname
was being done by writing to /etc/hostname.  Instead of relying on that
we're now writing 'local-hostname' into the metadata for the instance.

cloud-init then reads this and sets the hostname properly.

We are also writing /etc/hostname with the new hostname explicitly.  This is
useful/necessary because on network bringup of eth0, dhclient will submit its
hosname.  The updating done by cloud-init occurs to late, and thus
the dhcp request goes out with the un-configured hostname and dns doens't
work correctly.

Signed-off-by: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-08-22 15:29:06 -05:00
Scott Moser
fb760f7054 ubuntu-cloud-prep: improve overlayfs workaround
the previous 'patch_start' can be vastly simplified now that I better
understand what the bug was.  Instead of wrapping 'start', we only
need to ensure that /etc/init exists inside the overlayfs, so that the
directory that upstart watches is guaranteed to be in the overlay, not
the underlay.

The problem is described under bug 1213925.

Signed-off-by: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-08-19 12:36:38 -05:00
Scott Moser
d24d56d7ee ubuntu-cloud-prep: patch /sbin/start for overlayfs
upstart depends on inotify, and overlayfs does not support inotify.

That means that the following results in 'tgt' not running. tgt is simply
used here as an example of a service that installs an upstart job and
starts it on package install.
 lxc-clone -s -B overlayfs -o source-precise-amd64 -n test1
 lxc-start -n test1
 ..
 apt-get install tgt

The change here is to modify /sbin/start inside the container so that when
something explicitly tries 'start', it results in an explicit call to
'initctl reload-configuration' so that upstart is aware of the newly
placed job.

Should overlayfs ever gain inotify support, this should still not cause
any harm.

Signed-off-by: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-08-16 16:05:40 -05:00
Scott Moser
79159a86dd ubuntu-cloud-prep: cleanup, fix bug with userdata
--userdata was broken, completely missing an implementation.
This adds that implementation back in, makes 'debug' logic
correct, and then also improves the doc at the top.

Signed-off-by: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-08-12 08:07:58 -05:00
Scott Moser
54e339f917 ubuntu-cloud-prep: fix bad declare of VERBOSITY
Signed-off-by: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-08-09 09:59:41 -05:00
Scott Moser
65d8ae9c4a add a clone hook for ubuntu-cloud images
This allows ability to now specify '--userdata' arguments to 'create' or
to 'clone'. So now, the following means very fast start of instances with
different user-data.

$ sudo lxc-create -t ubuntu-cloud -n precise -- \
   -r precise --arch amd64

$ sudo lxc-clone -B overlayfs -o precise -s -n ephem1 \
   --userdata="my.userdata1"
$ sudo lxc-clone -B overlayfs -o precise -s -n ephem2 \
   --userdata="my.userdata2"

Also present here is
 * an improvement to the static list of Ubuntu releases. It uses
   ubuntu-distro-info if available degrades back to a static list on failure.
 * moving of the replacement variables to the top of the create template This
   is just to make it more obvious what is being replaced and put them in a
   single location.

Signed-off-by: Scott Moser <smoser@ubuntu.com>
2013-08-09 08:40:25 -05:00