lxc-clone makes unbootable clone when using lvm backing store
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
High
|
Serge Hallyn | ||
Raring |
Fix Released
|
High
|
Unassigned | ||
Saucy |
Fix Released
|
High
|
Serge Hallyn |
Bug Description
*******
1. Impact: lxc-clone for lvm-backed containers is broken
2. Development fix: saucy fixed the use of wrong pathnames in the
lxc-clone script.
3. Stable fix: same as development fix
4. Test case:
* Create an lvm backed container, clone it, and try to start the
clones. (note this requires a LVM vg called 'lxc')
sudo lxc-create -t ubuntu -B lvm -n c1
sudo lxc-clone -s -o c1 -n c2
sudo lxc-clone -o c1 -n c3
sudo lxc-start -n c2
sudo lxc-start -n c3
5. Regression potential: none, only the lxc-clone script is updated.
*******
Container clones made by lxc-clone is not bootable.
New container config misses lxc.rootfs.
lxc.network.hwaddr is the same as in original container.
# lsb_release -rd
Description: Ubuntu 13.04
Release: 13.04
# apt-cache policy lxc
lxc:
Installed: 0.9.0-0ubuntu3
Candidate: 0.9.0-0ubuntu3
Version table:
*** 0.9.0-0ubuntu3 0
500 http://
100 /var/lib/
Steps to reproduce:
root@lxc-host:~# lxc-create -n ubuntu -t ubuntu -B lvm --fssize 5gb
lxc-create: No config file specified, using the default config /etc/lxc/
Logical volume "ubuntu" created
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
Checking cache download in /var/cache/
Copy /var/cache/
Copying rootfs to /var/lib/
Generating locales...
en_US.UTF-8... up-to-date
Generation complete.
##
# The default user is 'ubuntu' with password 'ubuntu'!
# Use the 'sudo' command to run tasks as root in the container.
##
'ubuntu' template installed
Unmounting LVM
'ubuntu' created
root@lxc-host:~#
root@lxc-host:~# lxc-clone -o ubuntu -n ubuntu_clone
Tweaking configuration
Copying rootfs...
Logical volume "ubuntu_
mkdir: cannot create directory ‘/dev/lxc/
root@lxc-host:~# diff /var/lib/
9d8
< lxc.mount = /var/lib/
16d14
< lxc.utsname = ubuntu
52c50,51
< lxc.rootfs = /dev/lxc/ubuntu
---
> lxc.utsname = ubuntu_clone
> lxc.mount = /var/lib/
If I manually add lxc.rootfs=
tags: | added: lvm |
description: | updated |
Changed in lxc (Ubuntu Saucy): | |
assignee: | nobody → Serge Hallyn (serge-hallyn) |
description: | updated |
Thanks for submitting this bug. Note that snapshots do seem to work (sudo lxc-clone -s -o r1 -n r2), but non-snapshot ones do indeed hang.