[Lxc-users] Internal IP address not always assigned

Mertz, Jean jean at mertz.fm
Mon Apr 15 19:56:10 UTC 2013


Hello,

I've been trying to set up an EC2 hosted network of LXC containers to use
with
our company's Jenkins CI infrastructure. I've been successful at creating
and
running lxc containers, but it appears that assigning IP addresses behaves
radically.

I tested this on *EC2 Ubuntu 12.04, 12.10 and 13.04*. All three gave
somewhat
equal results, meaning IP addresses aren't always assigned to the
containers,
but they do work sometimes, so the setup seems correct.

Here are the steps I tried:

   - Boot up EC2 instance
   - sudo -i
   - apt-get update
   - apt-get upgrade
   - apt-get install xlc
   - Create container, I tried several ways:
      - lxc-create -n worker -t ubuntu
      - lxc-create -n worker -t ubuntu-cloud
      - lxc-create -n worker -t ubuntu-cloud -- -C
    - lxc-start -n worker -d

After this, I've always managed to get into the worker instance using lxc-
console -n worker, however, ssh'ing has been hit-or-miss for the past
several
days that I've worked with lxc and tried getting it to work correctly.

On *< ubuntu 13.04* I've been using cat /var/lib/misc/dnsmasq.leases.
Sometimes, this gave me back the name of the container and its ip address,
but
often times, the file stayed empty and no address was assigned. I also
checked
ifconfig but it too gave me back no ip4 address.

On *ubuntu 13.04* I used lxc-ls --fancy to show the ip address, but it too
often times only showed a dash, and no assigned ip address for a running
container.

Using ps aux | grep dns shows dnsmasq running:

dnsmasq -u lxc-dnsmasq --strict-order --bind-interfaces
--pid-file=/var/run/lxc/dnsmasq.pid --conf-file= --listen-address
10.0.3.1 --dhcp-range 10.0.3.2,10.0.3.254 --dhcp-lease-max=253
--dhcp-no-override --except-interface=lo --interface=lxcbr0

I've scoured the web, but haven't found any other sources explaining this
situation, and given the widespread use of lxc, I can hardly believe this
is a
known non-fixed bug.

I haven't set up any special networking other than the ones installed with
the
lxc package. Any thoughts on how to solve this?
-- 
Jean Mertz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130415/f23db491/attachment.html>


More information about the lxc-users mailing list