Open nerdalert opened 9 years ago
@nerdalert yeah I will check but I remember having to create it by hand. And indeed docker0 bridge gets created anyway. I tried passing docker run -d -b=ovsbr-docker0 but that did not work…
I will test again and send the error message.
Thanks @runseb , I think I recreated the issue on vivid with 4.1.1. Its seems like some delay in the netlink bridge getting created after the OVS bridge is created. I am going to stick a retry for the time being on the netlink.GetLinkByName
to give OVS and netlink enough time to synchronize if that makes sense to you all. Still curious what changed. Pasting the logs in case anything jumps out for you.
uname -a
Linux ub-1504 4.1.1-040101-generic #201507030635 SMP Fri Jul 3 10:38:27 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Error:
Jul 19 17:25:27 ub-1504 kernel: [ 3526.631825] openvswitch: netlink: Key type 62 is out of range max 22
Jul 19 17:25:27 ub-1504 systemd-udevd[4488]: conflicting device node '/dev/mapper/docker-8:1-536425-9a3611b06a46825c41fd8ef73a21d84d9dbad827416bb3f473c973668fd1977a' found, link to '/dev/dm-3' will not be created
Jul 19 17:25:27 ub-1504 systemd-udevd[4488]: Could not generate persistent MAC address for ovsbr: No such file or directory
Jul 19 17:25:27 ub-1504 kernel: [ 3526.634692] device ovsbr entered promiscuous mode
Jul 19 17:25:27 ub-1504 systemd[1]: message repeated 3 times: [ Device dev-disk-by\x2duuid-34986662\x2da6cf\x2d4cba\x2dbf15\x2d700ec2bf7b65.device appeared twice with different sysfs paths /sys/devices/virtual/block/loop0 and /sys/devices/virtual/block/dm-3]
Jul 19 17:25:27 ub-1504 systemd[1]: Started ifup for ovsbr.
Jul 19 17:25:27 ub-1504 systemd[1]: Starting ifup for ovsbr...
Jul 19 17:25:27 ub-1504 sh[4542]: Unknown interface ovsbr
Adding a retry:
iface, err := netlink.LinkByName(name)
if err != nil {
log.Debugf("error retrieving the new OVS bridge link [ %s ], retrying in 1 second..", bridgeName)
time.Sleep(1 * time.Second)
iface, err = netlink.LinkByName(name)
if err != nil {
log.Errorf("Error retrieving the new OVS bridge from netlink: %s", err)
return err
}
}
Hey @runseb can you double check your OVS bridge isn't created by default. I think I saw a readme update that has it being created manually. There is a br create method in ovs_bridge.go
func (driver *driver) setupBridge()
that should create it. If you could double check that was or wasn't working that would be awesome. Below are before and afters and output.OVS config
Start the plugin with defaults, ovsbr-docker0 with an ip of 172.18.40.1/24 (containers land in that network)
or from source
Start Docker (note, docker0 still gets created. I am not sure how to disable that yet. @dave-tucker might know. Since we are passing what we want as the default bridge, it would make sense to not create another default bridge that is unused or worse overlapping. Whatever the name passed to the default-network should be what is setup in OVS.
Start a container
After a container starts, the network create is called and the default bridge for the plugin (ovsbr-docker0) is created and assigned an L3 ip addr. (Note: we need to add a masquerade option there to enable a NAT.)