[systemd-devel] nspawn networkd could not find udev device

kennedy kennedyhan at 163.com
Thu Mar 3 02:09:24 UTC 2016


Hello


I run `systemd-nspawn -bD ~/debian-tree/ --network-bridge=br-containers --network-veth -M t1`
and my host side systemctl version is v215 +PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR


and this is my log
# bridge monitor
9: vb-t1 state DOWN : <BROADCAST,MULTICAST> mtu 1500 
9: vb-t1 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 
9: vb-t1 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-containers 
9: vb-t1 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-containers 
3: br-containers state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 
86:ed:e9:90:5d:21 dev vb-t1 vlan 0 master br-containers permanent
9: vb-t1 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-containers state disabled priority 32 cost 2 
9: vb-t1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2 
9: vb-t1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2 
9: vb-t1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2 
9: vb-t1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers 
3: br-containers state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 
26:59:be:71:c4:6c dev vb-t1 vlan 0 master br-containers 
dev br-containers port vb-t1 grp ff02::1:ff71:c46c temp
dev br-containers port vb-t1 grp ff02::1:3 temp
9: vb-t1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2


and
when I use ctrl+] with 3 times, or use `shutdown now` command


Deleted 26:59:be:71:c4:6c dev if9 vlan 0 master br-containers 
9: vb-t1 state DOWN : <BROADCAST,MULTICAST> mtu 1500 master br-containers state disabled priority 32 cost 2 
9: vb-t1 state DOWN : <BROADCAST,MULTICAST> mtu 1500 master br-containers 
9: vb-t1 state DOWN : <BROADCAST,MULTICAST> mtu 1500 master br-containers state disabled priority 32 cost 2 
Deleted 9: vb-t1 state DOWN : <BROADCAST,MULTICAST> mtu 1500 master br-containers 
Deleted 86:ed:e9:90:5d:21 dev if9 vlan 0 master br-containers permanent
9: vb-t1 state DOWN : <BROADCAST,MULTICAST> mtu 1500 
3: br-containers state UP : <BROADCAST,MULTICAST,UP> mtu 1500 
Deleted 9: vb-t1 state DOWN : <BROADCAST,MULTICAST> mtu 1500 
3: br-containers state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 


and re-run that nspawn command:


10: vb-t1 state DOWN : <BROADCAST,MULTICAST> mtu 1500 
10: vb-t1 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 
10: vb-t1 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-containers 
10: vb-t1 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-containers 
3: br-containers state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 
7a:01:45:44:03:30 dev vb-t1 vlan 0 master br-containers permanent
10: vb-t1 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-containers state disabled priority 32 cost 2 
10: vb-t1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2 
10: vb-t1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2 
10: vb-t1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2 
10: vb-t1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers 
3: br-containers state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 
26:59:be:71:c4:6c dev vb-t1 vlan 0 master br-containers 
dev br-containers port vb-t1 grp ff02::1:ff71:c46c temp
dev br-containers port vb-t1 grp ff02::1:3 temp
10: vb-t1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2


then in my container's networkd log as talked before, can't find the network bridge network with 10.0.0.x


# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     2048   0        0 host0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 host0


--

Yours Sincerely
Han



At 2016-03-03 02:33:22, "Kai Krakow" <hurikhan77 at gmail.com> wrote:
>Am Wed, 2 Mar 2016 16:53:01 +0800 (CST)
>schrieb kennedy <kennedyhan at 163.com>:
>
>> Hi
>> 
>> 
>> On my first run systemd-nspawn everything that's OK.
>> When I shutdown the nspawn container, and re-run systemd-nspawn
>> again, this error comes. In container, it's only have 169.254.x.x
>> network, didn't have network bridge's network.
>> 
>> On my host, I run systemctl status systemd-networkd it show me
>> 
>> 
>> 
>> systemd-networkd[23507]: br-containers   : netdev ready
>> systemd-networkd[23507]: eth0            : gained carrier
>> systemd-networkd[23507]: lo              : gained carrier
>> systemd-networkd[23507]: br-containers   : link configured
>> systemd-networkd[23507]: br-containers   : gained carrier
>> systemd-networkd[23507]: vb-t1           : could not find udev device
>> systemd-networkd[23507]: br-containers   : lost carrier
>> systemd-networkd[23507]: br-containers   : gained carrier
>> 
>> 
>> My container's log:
>> systemd[1]: Starting Network Service...
>> systemd-networkd[41]: Enumeration completed
>> systemd[1]: Started Network Service.
>> systemd-networkd[41]: host0: Could not bring up interface: Invalid
>> argument systemd-networkd[41]: host0: Gained carrier
>> systemd-networkd[41]: host0: Gained IPv6LL
>> 
>> 
>> And I restart the host's systemd-networkd service, and re-run
>> container again, that's solved, why ?
>
>How do you run and shut down the container? Same setup [1] here works
>without problems. Which systemd version?
>
>Could you run "bridge link" before and after each step?
>
>You can also run "bridge monitor" while performing the steps. It should
>show you deleting two MACs from the bridge (both sides of the veth) if
>shutting down a machine while first deconfiguring and shutting down
>each interface just before deletion, and reverse when bringing the
>machine up. Like this (running "machinectl terminate gentoo-mysql-base"
>and "machinectl start gentoo-mysql-base" in another terminal):
>
># bridge monitor
>6: vb-gentoo-mysq state DOWN @NONE: <BROADCAST,MULTICAST> mtu 1500 master br-containers
>6: vb-gentoo-mysq state DOWN @NONE: <BROADCAST,MULTICAST> mtu 1500 master br-containers state disabled priority 32 cost 2
>Deleted 62:2c:b9:14:ed:91 dev vb-gentoo-mysq master br-containers
>6: vb-gentoo-mysq state DOWN @NONE: <BROADCAST,MULTICAST> mtu 1500 master br-containers state disabled priority 32 cost 2
>6: vb-gentoo-mysq state DOWN @NONE: <BROADCAST,MULTICAST> mtu 1500 master br-containers state disabled priority 32 cost 2
>Deleted 6: vb-gentoo-mysq state DOWN @NONE: <BROADCAST,MULTICAST> mtu 1500 master br-containers
>Deleted 3a:06:21:31:88:fa dev vb-gentoo-mysq master br-containers permanent
>Deleted 3a:06:21:31:88:fa dev vb-gentoo-mysq vlan 1 master br-containers permanent
>Deleted 6: vb-gentoo-mysq state DOWN @NONE: <BROADCAST,MULTICAST> mtu 1500
>8: vb-gentoo-mysq state DOWN @enp5s0: <BROADCAST,MULTICAST> mtu 1500
>8: vb-gentoo-mysq state UNKNOWN @enp5s0: <BROADCAST,MULTICAST,UP> mtu 1500
>8: vb-gentoo-mysq state UNKNOWN @enp5s0: <BROADCAST,MULTICAST,UP> mtu 1500
>8: vb-gentoo-mysq state UNKNOWN @enp5s0: <BROADCAST,MULTICAST,UP> mtu 1500 master br-containers
>8: vb-gentoo-mysq state UNKNOWN @enp5s0: <BROADCAST,MULTICAST,UP> mtu 1500 master br-containers
>3a:06:21:31:88:fa dev vb-gentoo-mysq master br-containers permanent
>3a:06:21:31:88:fa dev vb-gentoo-mysq vlan 1 master br-containers permanent
>8: vb-gentoo-mysq state UNKNOWN @enp5s0: <BROADCAST,MULTICAST,UP> mtu 1500 master br-containers state forwarding priority 32 cost 2
>8: vb-gentoo-mysq state UNKNOWN @enp5s0: <BROADCAST,MULTICAST,UP> mtu 1500 master br-containers state forwarding priority 32 cost 2
>8: vb-gentoo-mysq state UNKNOWN @enp5s0: <BROADCAST,MULTICAST,UP> mtu 1500 master br-containers state forwarding priority 32 cost 2
>8: vb-gentoo-mysq state UNKNOWN @enp5s0: <BROADCAST,MULTICAST,UP> mtu 1500 master br-containers state forwarding priority 32 cost 2
>8: vb-gentoo-mysq state UNKNOWN @enp5s0: <BROADCAST,MULTICAST,UP> mtu 1500 master br-containers
>8: vb-gentoo-mysq state LOWERLAYERDOWN @enp5s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-containers state disabled priority 32 cost 2
>8: vb-gentoo-mysq state LOWERLAYERDOWN @enp5s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-containers state disabled priority 32 cost 2
>8: vb-gentoo-mysq state LOWERLAYERDOWN @enp5s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 master br-containers
>8: vb-gentoo-mysq state UP @enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2
>8: vb-gentoo-mysq state UP @enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2
>8: vb-gentoo-mysq state UP @enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2
>8: vb-gentoo-mysq state UP @enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers
>62:2c:b9:14:ed:91 dev vb-gentoo-mysq master br-containers
>dev br-containers port vb-gentoo-mysq grp ff02::1:ff14:ed91 temp
>8: vb-gentoo-mysq state UP @enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-containers state forwarding priority 32 cost 2
>
>
>[1]: Host-side bridge, container veth (host-side) joined to bridge
>The bridge acts as a virtual switch, veth is a virtual ethernet cable
>
>-- 
>Regards,
>Kai
>
>Replies to list-only preferred.
>
>_______________________________________________
>systemd-devel mailing list
>systemd-devel at lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160303/f90e0a00/attachment-0001.html>


More information about the systemd-devel mailing list