Activity log for bug #1007483

Date Who What changed Old value New value Message
2012-06-01 15:37:54 Jean-Baptiste Lallement bug added bug
2012-06-01 16:19:52 Clint Byrum lxc (Ubuntu): status New Triaged
2012-06-01 16:19:56 Clint Byrum lxc (Ubuntu): importance Undecided Medium
2012-06-01 16:24:23 Serge Hallyn lxc (Ubuntu): status Triaged Confirmed
2012-06-01 16:24:41 Serge Hallyn lxc (Ubuntu): importance Medium Low
2012-06-11 14:15:33 Serge Hallyn lxc (Ubuntu): assignee Serge Hallyn (serge-hallyn)
2012-06-11 14:17:14 Serge Hallyn lxc (Ubuntu): status Confirmed In Progress
2012-06-11 19:10:35 Launchpad Janitor lxc (Ubuntu): status In Progress Fix Released
2012-06-11 19:41:20 Launchpad Janitor branch linked lp:ubuntu/lxc
2012-06-11 21:40:02 Serge Hallyn nominated for series Ubuntu Precise
2012-06-11 21:40:02 Serge Hallyn bug task added lxc (Ubuntu Precise)
2012-06-11 22:06:59 Serge Hallyn description When multiple containers (template ubuntu) are created simultaneously only the first container is successfully created, others fail with "failed to execute template 'ubuntu'" This is a very common scenario in automated tests. TEST CASE: Run the following script with sudo """ #!/bin/sh MAX=3 echo "Destroying existing containers" for x in $(seq 1 $MAX); do sudo lxc-destroy -f -n test-lxc-$x & done sleep 10 sudo lxc-list echo "Creating $MAX ubuntu containers" for x in $(seq 1 $MAX); do echo -n "Creating $x ..." sudo lxc-create -t ubuntu -n test-lxc-$x & echo "done" done echo "Waiting 30s for test to finish" sleep 30 sudo lxc-list """ ACTUAL RESULT ================================= $ sudo sh ./lxc-create-concurrent Destroying existing containers 'test-lxc-1' does not exist 'test-lxc-2' does not exist 'test-lxc-3' does not exist RUNNING FROZEN STOPPED Creating 3 ubuntu containers Creating 1 ...done Creating 2 ...done Creating 3 ...done Waiting 30s for test to finish No config file specified, using the default config No config file specified, using the default config No config file specified, using the default config debootstrap is /usr/sbin/debootstrap debootstrap is /usr/sbin/debootstrap Checking cache download in /var/cache/lxc/quantal/rootfs-amd64 ... Copy /var/cache/lxc/quantal/rootfs-amd64 to /var/lib/lxc/test-lxc-1/rootfs ... Copying rootfs to /var/lib/lxc/test-lxc-1/rootfs ... failed to execute template 'ubuntu' debootstrap is /usr/sbin/debootstrap failed to execute template 'ubuntu' aborted aborted ## # The default user is 'ubuntu' with password 'ubuntu'! # Use the 'sudo' command to run tasks as root in the container. ## 'ubuntu' template installed 'test-lxc-1' created RUNNING FROZEN STOPPED test-lxc-1 ================================= ProblemType: Bug DistroRelease: Ubuntu 12.10 Package: lxc 0.8.0~rc1-4ubuntu10 ProcVersionSignature: Ubuntu 3.4.0-3.8-generic 3.4.0 Uname: Linux 3.4.0-3-generic x86_64 ApportVersion: 2.1.1-0ubuntu1 Architecture: amd64 Date: Fri Jun 1 17:32:06 2012 ProcEnviron: TERM=xterm PATH=(custom, user) LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: lxc UpgradeStatus: Upgraded to quantal on 2012-01-31 (121 days ago) ========== SRU justification ============== 1. Impact: parallel creations of containers with the same template will result in all but one failing. They should instead run in parallel without racing in their critical section. 2. Development fix: don't add '-n' to the flock arguments, which causes flock to fail instead of waiting. 3. Stable fix: same as development fix. 4 Test case: for i in `seq 10 12`; do screen -d -m sudo lxc-create -t ubuntu -n p$i done ret=0 while [ $ret -eq 0 ]; do sleep 1 pidof bash > /dev/null 2>&1 ret=$? done while [ `pidof lxc-create > /dev/null 2>&1` ]; do sleep 1 done lxc-ls # make sure p10, p11, and p12 exist 5. Regression potential: none ============================== When multiple containers (template ubuntu) are created simultaneously only the first container is successfully created, others fail with "failed to execute template 'ubuntu'" This is a very common scenario in automated tests. TEST CASE: Run the following script with sudo """ #!/bin/sh MAX=3 echo "Destroying existing containers" for x in $(seq 1 $MAX); do     sudo lxc-destroy -f -n test-lxc-$x & done sleep 10 sudo lxc-list echo "Creating $MAX ubuntu containers" for x in $(seq 1 $MAX); do     echo -n "Creating $x ..."     sudo lxc-create -t ubuntu -n test-lxc-$x &     echo "done" done echo "Waiting 30s for test to finish" sleep 30 sudo lxc-list """ ACTUAL RESULT ================================= $ sudo sh ./lxc-create-concurrent Destroying existing containers 'test-lxc-1' does not exist 'test-lxc-2' does not exist 'test-lxc-3' does not exist RUNNING FROZEN STOPPED Creating 3 ubuntu containers Creating 1 ...done Creating 2 ...done Creating 3 ...done Waiting 30s for test to finish No config file specified, using the default config No config file specified, using the default config No config file specified, using the default config debootstrap is /usr/sbin/debootstrap debootstrap is /usr/sbin/debootstrap Checking cache download in /var/cache/lxc/quantal/rootfs-amd64 ... Copy /var/cache/lxc/quantal/rootfs-amd64 to /var/lib/lxc/test-lxc-1/rootfs ... Copying rootfs to /var/lib/lxc/test-lxc-1/rootfs ... failed to execute template 'ubuntu' debootstrap is /usr/sbin/debootstrap failed to execute template 'ubuntu' aborted aborted ## # The default user is 'ubuntu' with password 'ubuntu'! # Use the 'sudo' command to run tasks as root in the container. ## 'ubuntu' template installed 'test-lxc-1' created RUNNING FROZEN STOPPED   test-lxc-1 ================================= ProblemType: Bug DistroRelease: Ubuntu 12.10 Package: lxc 0.8.0~rc1-4ubuntu10 ProcVersionSignature: Ubuntu 3.4.0-3.8-generic 3.4.0 Uname: Linux 3.4.0-3-generic x86_64 ApportVersion: 2.1.1-0ubuntu1 Architecture: amd64 Date: Fri Jun 1 17:32:06 2012 ProcEnviron:  TERM=xterm  PATH=(custom, user)  LANG=en_US.UTF-8  SHELL=/bin/bash SourcePackage: lxc UpgradeStatus: Upgraded to quantal on 2012-01-31 (121 days ago)
2012-06-11 22:11:49 Serge Hallyn bug added subscriber Ubuntu Stable Release Updates Team
2012-06-14 16:15:53 Brian Murray lxc (Ubuntu Precise): status New Fix Committed
2012-06-14 16:15:57 Brian Murray bug added subscriber SRU Verification
2012-06-14 16:16:03 Brian Murray tags amd64 apport-bug qa-manual-testing quantal running-unity amd64 apport-bug qa-manual-testing quantal running-unity verification-needed
2012-06-14 16:40:37 Launchpad Janitor branch linked lp:ubuntu/precise-proposed/lxc
2012-06-25 22:04:28 Stéphane Graber tags amd64 apport-bug qa-manual-testing quantal running-unity verification-needed amd64 apport-bug qa-manual-testing quantal running-unity verification-done
2012-06-26 03:14:11 Launchpad Janitor lxc (Ubuntu Precise): status Fix Committed Fix Released