I use lxc with physical eth1.
I can start the container, connect to it, etc. Everything looks ok. But
when I stop the container and try to restart it, eth1 is no more availble.
Looks lxc "eats" this interface. How can I free it (without rebooting the
host (zoo))?


root@zoo:/lxc# cat ubuntu.cfg
lxc.utsname = LXC
lxc.tty = 4
lxc.pts = 1024
#lxc.network.type = veth
#lxc.network.link = br0
lxc.network.type = phys
lxc.network.link = eth1
lxc.network.flags = up
#lxc.network.hwaddr = 00:50:56:00:00:01
lxc.network.name = eth0
lxc.network.mtu = 1500
lxc.network.ipv4 = 129.69.1.219/24
lxc.rootfs = /lxc/ubuntu
lxc.mount = /lxc/ubuntu.fstab
# which CPUs
lxc.cgroup.cpuset.cpus = 0
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm
# restrict capabilities, see: man capabilities
lxc.cap.drop = sys_module
lxc.cap.drop = mac_override
lxc.cap.drop = sys_admin


root@zoo:/lxc# ethtool eth1
Settings for eth1:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Link partner advertised link modes:  Not reported
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: No
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: yes


root@zoo:/lxc# lxc-start -f /lxc/ubuntu.cfg -n ubuntu &
[1] 1679
init: rc-sysinit main process (30) killed by TERM signal
 * Starting NTP server ntpd
   ...done.

root@zoo:/lxc# lxc-console -n ubuntu

Type <Ctrl+a q> to exit the console

root@ubuntu:~# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:50:56:8e:00:22
          inet addr:129.69.1.219  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fe8e:22/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:115 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7695 (7.6 KB)  TX bytes:1344 (1.3 KB)

root@ubuntu:~#

root@zoo:/lxc# lxc-stop -n ubuntu
[1]+  Exit 137                lxc-start -f /lxc/ubuntu.cfg -n ubuntu

root@zoo:/lxc# lxc-start -f /lxc/ubuntu.cfg -n ubuntu
lxc-start: failed to retrieve the index for eth1
lxc-start: failed to create netdev
lxc-start: failed to create the network
lxc-start: failed to spawn '/sbin/init'
lxc-start: No such file or directory - failed to remove cgroup '/cgroup/ubuntu'

root@zoo:/lxc# ethtool eth1
Settings for eth1:
Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
No data available

-- 
Ullrich Horlacher              Server- und Arbeitsplatzsysteme
Rechenzentrum                  E-Mail: horlac...@rus.uni-stuttgart.de
Universitaet Stuttgart         Tel:    ++49-711-685-65868
Allmandring 30                 Fax:    ++49-711-682357
70550 Stuttgart (Germany)      WWW:    http://www.rus.uni-stuttgart.de/

------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to