[Bug 1183354] Re: lxc-clone makes unbootable clone when using lvm backing store

Serge Hallyn 1183354 at bugs.launchpad.net
Thu May 30 22:01:16 UTC 2013


** Description changed:

+ *******************************
+ 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://ru.archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages
          100 /var/lib/dpkg/status
  
  
  Steps to reproduce:
  root at lxc-host:~# lxc-create -n ubuntu -t ubuntu -B lvm --fssize 5gb
  
  lxc-create: No config file specified, using the default config /etc/lxc/default.conf
    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/lxc/raring/rootfs-amd64 ...
  Copy /var/cache/lxc/raring/rootfs-amd64 to /var/lib/lxc/ubuntu/rootfs ...
  Copying rootfs to /var/lib/lxc/ubuntu/rootfs ...
  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 at lxc-host:~#
  root at lxc-host:~# lxc-clone -o ubuntu -n ubuntu_clone
  Tweaking configuration
  Copying rootfs...
    Logical volume "ubuntu_clone_snapshot" created
  mkdir: cannot create directory ‘/dev/lxc/ubuntu_clone_snapshot’: File exists
  
  root at lxc-host:~# diff /var/lib/lxc/ubuntu/config /var/lib/lxc/ubuntu_clone/config
  9d8
  < lxc.mount = /var/lib/lxc/ubuntu/fstab
  16d14
  < lxc.utsname = ubuntu
  52c50,51
  < lxc.rootfs = /dev/lxc/ubuntu
  ---
  > lxc.utsname = ubuntu_clone
  > lxc.mount = /var/lib/lxc/ubuntu_clone/fstab
  
  If I manually add lxc.rootfs=/dev/lxc/ubuntu_clone_snapshot to
  /var/lib/lxc/ubuntu_clone/config, container starts normally.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1183354

Title:
  lxc-clone makes unbootable clone when using lvm backing store

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1183354/+subscriptions



More information about the Ubuntu-server-bugs mailing list