shettyg / ovn-docker

Provide network virtualization to Docker via OVN.
Apache License 2.0
20 stars 9 forks source link

ovn-controller missing? #8

Closed vijayendrabvs closed 9 years ago

vijayendrabvs commented 9 years ago

Taking a look at the overlay.md documentation, and for this step - ovn-controller --pidfile --detach -vconsole:off --log-file I don't find an ovn-controller file in the source - been missed when checking in the repo?

shettyg commented 9 years ago

ovn-controller comes as part of the openvswitch installation (from the openvswitch master branch). It is probably easier to start from the vagrant_overlay/Readme.md

vijayendrabvs commented 9 years ago

Thanks for the info @shettyg . I installed stock ovs (v 2.0.2) on Ubuntu 14.04 and it doesn't seem to be packaged with ovn-controller.

I tried bringing the vagrant VMs as per the Readme.md in vagrant_overlay/ but the docker daemon didn't come up because "localhost" was missing in the /etc/hosts of the vagrant VM -

vagrant@node1 ~ $ sudo sh /vagrant/test1.sh
ovs-vsctl: no key "ipam" in Open_vSwitch record "." column external_ids
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
usage: neutron net-create [-h] [-f {shell,table,value}] [-c COLUMN]
                          [--max-width <integer>] [--prefix PREFIX]
                          [--request-format {json,xml}]
                          [--tenant-id TENANT_ID] [--admin-state-down]
                          [--shared] [--router:external]
                          [--provider:network_type <network_type>]
                          [--provider:physical_network <physical_network_name>]
                          [--provider:segmentation_id <segmentation_id>]
                          [--vlan-transparent {True,False}]
                          NAME
neutron net-create: error: too few arguments
Connection to neutron failed: Failed to connect Neutron server
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
test failed with no network seen
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
vagrant@node1 ~ $

From the docker log -

vagrant@node1 ~ $ sudo tail /var/log/upstart/docker.log
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
INFO[0000] [graphdriver] using prior storage driver "aufs"
INFO[0000] Option DefaultDriver: bridge
INFO[0000] Option DefaultNetwork: bridge
INFO[0000] Option OptionKVProvider: consul
INFO[0000] Option OptionKVProviderURL: localhost:8500
WARN[0000] Running modprobe bridge nf_nat br_netfilter failed with message: modprobe: WARNING: Module br_netfilter not found.
, error: exit status 1
INFO[0000] Firewalld running: false
FATA[0000] Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to initialize vxlan id manager: failed to initialize bit sequence handler: Get http://localhost:8500/v1/kv/docker/libnetwork/idm/vxlan-id/?consistent=: dial tcp: lookup localhost: no such host
vagrant@node1 ~ $

After localhost was added to /etc/hosts, the docker daemon came up -

vagrant@node1 ~ $ sudo docker -d --kv-store=consul:localhost:8500 --label=com.docker.network.driver.overlay.bind_interface=eth1 --label=com.docker.network.driver.overlay.neighbor_ip=192.168.50.101
WARN[0000] Running experimental build
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
INFO[0000] [graphdriver] using prior storage driver "aufs"
INFO[0000] Option DefaultDriver: bridge
INFO[0000] Option DefaultNetwork: bridge
INFO[0000] Option OptionKVProvider: consul
INFO[0000] Option OptionKVProviderURL: localhost:8500
WARN[0000] Running modprobe bridge nf_nat br_netfilter failed with message: modprobe: WARNING: Module br_netfilter not found.
, error: exit status 1
INFO[0000] Firewalld running: false
2015/07/20 17:55:19 [INFO] serf: EventMemberJoin: node1 192.168.50.101
2015/07/20 17:55:19 [DEBUG] memberlist: Responding to push/pull sync with: 192.168.50.101:51843
2015/07/20 17:55:19 [DEBUG] memberlist: Initiating push/pull sync with: 192.168.50.101:7946
WARN[0000] Your kernel does not support swap memory limit.
INFO[0000] Loading containers: start.

INFO[0000] Loading containers: done.
INFO[0000] Daemon has completed initialization
INFO[0000] Docker daemon                                 commit=8c7cd78 execdriver=native-0.2 graphdriver=aufs version=1.8.0-dev

However, sudo sh /vagrant/test1/.sh still failed thus -

vagrant@node1 ~ $ sudo sh /vagrant/test1.sh
ovs-vsctl: no key "ipam" in Open_vSwitch record "." column external_ids
Error response from daemon: Plugin not found
usage: neutron net-create [-h] [-f {shell,table,value}] [-c COLUMN]
                          [--max-width <integer>] [--prefix PREFIX]
                          [--request-format {json,xml}]
                          [--tenant-id TENANT_ID] [--admin-state-down]
                          [--shared] [--router:external]
                          [--provider:network_type <network_type>]
                          [--provider:physical_network <physical_network_name>]
                          [--provider:segmentation_id <segmentation_id>]
                          [--vlan-transparent {True,False}]
                          NAME
neutron net-create: error: too few arguments
Connection to neutron failed: Failed to connect Neutron server
test failed with no network seen
resource not found foo
vagrant@node1 ~ $

Looks like there isn't an IPAM key configured in ovs -

vagrant@node1 ~ $ sudo ovs-vsctl get Open-vSwitch . external_ids
{system-id="93083887-b3c7-49bf-b408-e979361c8d31"}
vagrant@node1 ~ $

I infer that I will need to run the other steps detailed in https://github.com/shettyg/ovn-docker/blob/master/docs/overlay.md , but is the vagrant VM supposed to bring these up during bootstrapping?

shettyg commented 9 years ago

If you look at the Vagrantfile, you will see it run different scripts on node1. The script, run-ovn.sh is supposed to set the ipam in external_ids.

So it looks like "vagrant" is not able to provide a replicable environment. I do a "vagrant up" on a mac. Where do you do it?

vijayendrabvs commented 9 years ago

I too am running vagrant on a mac (mac version 10.10.3, vagrant version 1.7.2). I however haven't run the run-ovn.sh script - I see that the test1.sh script doesn't run any of those. Would you be able to give me the scripts I need to run before I run the /vagrant/test1.sh script?

vijayendrabvs commented 9 years ago

Sorry, I missed the part about looking in the Vagrantfile. I'll run those scripts and get back to you on how it goes.

vijayendrabvs commented 9 years ago

@shettyg I ran the scripts in the Vagrant file that hadn't seemed to run (run-ipam.sh and run-ovn.sh <ip_host1(since vagrant, same as 192.168.50.101>) , so all required processes came up -

vagrant@node1 ~ $ ps -ef | grep ovn
root     27796 27165  0 19:02 ?        00:00:00 ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --remote=ptcp:6640:0.0.0.0 --pidfile --detach conf.db ovnsb.db ovnnb.db
root     27806 27165  0 19:02 ?        00:00:00 ovn-northd --pidfile --detach -vconsole:off --log-file
root     28141     1  0 19:08 ?        00:00:00 ovn-controller --pidfile --detach -vconsole:off --log-file
root     28148     1  0 19:08 ?        00:00:00 /usr/bin/python /usr/local/bin/ovn-docker-driver --overlay-mode --detach
vagrant  28586 28272  0 19:19 pts/0    00:00:00 grep --color=auto ovn
vagrant@node1 ~ $

pip/python-neturonclient are installed.

Then ran the following -

ovn-docker-driver --overlay-mode --detach

then -

vagrant@node1 ~ $ sudo docker network create -d openvswitch foo
Error response from daemon: Plugin not found
vagrant@node1 ~ $

vagrant@node1 ~ $ ls /usr/share/docker/plugins
vagrant@node1 ~ $

Why doesn't the docker daemon pick up the openvswitch plugin? Where is this plugin configured ( is it during ovn-docker-driver --overlay-mode --detach ?) Am I missing some config?

shettyg commented 9 years ago

All I have to do at my end is "vagrant up" and everything is automatically setup.

All I can think of in your above setup is that you are running the plugin driver twice.

shettyg commented 9 years ago

I changed 'localhost' to 127.0.0.1. Latest Docker from experimental repo has changed the plugin directory, so I updated that too.

Another person noted that the vagrant does not work on Windows. So the Vagrantfile is clearly not written in a portable way. So I can imagine how it possibly fails in your environment.