lxc-create -t ubuntu-cloud broken on quantal images (no ubuntu user)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
Medium
|
Scott Moser | ||
Precise |
Fix Released
|
Medium
|
Stéphane Graber |
Bug Description
=== Rationale ===
The quantal cloud image doesn't ship with an existing ubuntu user, instead it uses cloud-utils to create it at boot time.
This breaks older versions of lxc-ubuntucloud which expects the user to be there.
The fix is a backport from what was pushed into quantal and basically moves the user handling code to the cloud-init config file.
=== Test case ===
1) lxc-create -t ubuntucloud -n p1 -- -r q
2) If this works, you're good (otherwise it'll fail when setting up the user saying that "ubuntu" doesn't exist.)
=== Regression potential ===
The fix is a direct port of the change that was pushed to quantal and it's been tested on 12.04 with both a precise and quantal container. In the worst case, cloud-init would fail to run, rendering the container close to useless, but the testing I've been doing would have shown anything that bad.
------ original bug report --------
'lxc-create -t ubuntu-cloud' was broken on quantal images as it assumes presense of 'ubuntu' user, and that has been removed from the images. Now, cloud-init creates the ubuntu user on first boot.
$ lxc-create -t ubuntu-cloud -n source-
No config file specified, using the default config
ubuntu-
wget is /usr/bin/wget
--2012-09-04 18:16:36-- https:/
Resolving cloud-images.
Connecting to cloud-images.
HTTP request sent, awaiting response... 302 Found
Location: https:/
--2012-09-04 18:16:36-- https:/
Reusing existing connection to cloud-images.
HTTP request sent, awaiting response... 200 OK
Length: 172848992 (165M) [application/
Saving to: `quantal-
100%[==
2012-09-04 18:16:46 (16.4 MB/s) - `quantal-
Extracting container rootfs
Configuring for running outside of a cloud environment
If you want to configure for a cloud evironment, please use '-- -C' to create the container
usermod: user 'ubuntu' does not exist
failed to execute template 'ubuntu-cloud'
aborted
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: lxc 0.8.0~rc1-4ubuntu32
ProcVersionSign
Uname: Linux 3.5.0-13-generic x86_64
Architecture: amd64
Date: Tue Sep 4 18:17:47 2012
KernLog:
ProcEnviron:
TERM=screen
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)
lxcsyslog:
Related branches
- Serge Hallyn: Approve
- Ubuntu branches: Pending requested
-
Diff: 362 lines (+226/-57)5 files modified.pc/applied-patches (+1/-0)
debian/changelog (+3/-0)
debian/patches/0207-ubuntu-cloud-fixes.patch (+159/-0)
debian/patches/series (+1/-0)
templates/lxc-ubuntu-cloud.in (+62/-57)
Changed in lxc (Ubuntu): | |
assignee: | nobody → Scott Moser (smoser) |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in lxc (Ubuntu): | |
status: | Triaged → Fix Committed |
Changed in lxc (Ubuntu Precise): | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in lxc (Ubuntu Precise): | |
status: | Triaged → In Progress |
assignee: | nobody → Stéphane Graber (stgraber) |
description: | updated |
This bug was fixed in the package lxc - 0.8.0~rc1-4ubuntu33
--------------- rc1-4ubuntu33) quantal; urgency=low
lxc (0.8.0~
[ Serge Hallyn ] wait-initialize -timeout: initialize timeout to -1 so lxc-wait patches/ compilecleanups /* - fix compile time warnings. net.upstart: tell iptables not to masquerate packets between getitem- utsname- segv: fix seg fault when doing get_item(utsname) conf-after- create: add ability to free a lxc_conf. Use that hooks-to- manpage: document lxc.hook in the lxc.conf manpage. destroy- rm-symlink: If rootfs is a symbolic link to a directory, premount- hook.patch: add a premount hook to support encrypted
* 0206-lxc-
will, by default, wait for the container to enter the requested state.
* debian/
* lxc.lxc-
containers. (LP: #1045947)
* 0208-fix-
on newly created container.
* 0209-reload-
after calling Container->Create() to completely reload the newly created
config.
* 0211-add-
* 0212-lxc-
remove it. (LP: #1046117)
* 0213-add-
filesystems. (LP: #1043052)
[ Scott Moser ] cloud-fixes. patch: cleanups to lxc-ubuntu-cloud.in
* 0207-ubuntu-
fix for quantal images that do not have user 'ubuntu' present
(LP: #1045955)
[ Rex Tsai ] debian- templates: Fix lxc-shutdown/ lxc-restart in Debian
* 0210-fix-
containers and fix lxc.utsname for lenny containers.
(LP: #1046684, LP: #1046696)
[ Stéphane Graber ] net.upstart: Make the iptables call more consistent (LP: #1045947)
* lxc.lxc-
-- Serge Hallyn <email address hidden> Thu, 30 Aug 2012 11:32:06 -0500