lxc-create fails with errors that it is unable to access archive.ubuntu.com
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Incomplete
|
Medium
|
Unassigned |
Bug Description
I encountered this problem when trying to create lxc containers after my first one. The host had full access to archive.ubuntu.com, as verified by Serge Hallyn and Robert Collins via various diagnostics.
After trying more careful approaches to a solution, Serge Hallyn recommended that we just wipe out the lxc cache. "rm -rf /var/cache/lxc/*". This solved the problem.
I noticed that switching networks seems to trigger the problem. If I create a container at home, and then go to a co-working spot and try to make a new one, I get this error. Then I clear out the cache as Serge described, and I can create a new container. A subsequent attempt, also at the co-working spot, also succeeds.
However, when I go back home, and then try to make a container, I get this error again. I clear out the cache, and I can make a new container, and then another one.
Maybe the network correlation is coincidental, but it seems to be valid in my experiences so far.
This is on an Oneiric host, making Lucid containers.
description: | updated |
Changed in lxc (Ubuntu): | |
importance: | Undecided → Medium |
Hi Gary,
Could you try adding
chroot $rootfs apt-get
to the top of the post-process() function in /usr/lib/ lxc/templates/ lxc-ubuntu?
Something like the following patch:
--- lxc-ubuntu 2011-12-22 08:59:02.550638249 -0600
+++ lxc-ubuntu.new 2011-12-22 08:59:22.954637905 -0600
@@ -318,6 +318,7 @@
if [ $trim_container -eq 1 ]; then
trim $rootfs $release
else
+ chroot $rootfs apt-get update
# for lucid and maverick, if not trimming, then add the ubuntu-virt
# ppa and install lxcguest
if [ $release = "lucid" -o $release = "maverick" ]; then