lxc containers do not retain configured ip on container reboot

Bug #931229 reported by Ben Howard
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

LXC Containers that have their IP address configured in the LXC container configuration (i.e. not set inside the container), in-container rebooting does not retained the configured IP address.

Steps to Repo:
1. Set static IP address in lx configuration file:
    lxc.network.ipv4 = 192.168.254.254/24
2. Start container
3. In container run "reboot"
4. Container comes up with with a DHCP assigned address

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: lxc 0.7.5-3ubuntu24
ProcVersionSignature: Ubuntu 3.2.0-15.24-generic 3.2.5
Uname: Linux 3.2.0-15-generic x86_64
ApportVersion: 1.91-0ubuntu1
Architecture: amd64
Date: Sun Feb 12 19:17:26 2012
ProcEnviron:
 LC_CTYPE=en_US.UTF-8
 LC_COLLATE=en_US.UTF-8
 LANG=en_US.UTF-8
 LC_MESSAGES=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.default.lxc: 2012-02-11T22:28:31.216549

Revision history for this message
Ben Howard (darkmuggle-deactivatedaccount) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug. If you check ifconfig you'll notice the hwaddr also changes. You can specify an hwaddr in the config file with

lxc.network.hwaddr=16:73:40:b3:ef:f5

Should we simply auto-generate an hwaddr (if none is specified in the optional user-provided config file)?

Changed in lxc (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Ben Howard (darkmuggle-deactivatedaccount) wrote :

Yes, I would think that we shoudl auto-generate the hwaddr. With out one, it is kind of pointless. I'll submit a patch against LXC here.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.7.5-3ubuntu26

---------------
lxc (0.7.5-3ubuntu26) precise; urgency=low

  [ Ben Howard ]
  * 0043-tweak-templates.patch:
    - Add a macaddr to configs created by ubuntu-cloud template
    - Add ssh key injection, locales, and tarball specification support to
      ubuntu-cloud template.

  [ Serge Hallyn ]
  * (also in 0043-tweak-templates.patch) Add a macaddr to configs created by
    ubuntu template (LP: #931229) and allow an ssh key to be injected.
  * debian/control: add openssl as Recommends as it's now used by the
      templates.
  * 0044-lxc-destroy-rm-autos: remove autostart symlinks when deleting a
    container. (LP: #930525)
 -- Serge Hallyn <email address hidden> Wed, 15 Feb 2012 23:33:12 -0600

Changed in lxc (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.