diff --git a/docker/centos/binary/neutron/neutron-openvswitch-agent/Dockerfile b/docker/centos/binary/neutron/neutron-openvswitch-agent/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3dc05bd2d4c03c0df9feec7280ccca1fd34fbfd1 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-openvswitch-agent/Dockerfile @@ -0,0 +1,11 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +# Install required packages +RUN yum install -y openstack-neutron-openvswitch \ + openvswitch \ + && yum clean all + +COPY check.sh start.sh / + +CMD ["/start.sh"] diff --git a/docker/centos/binary/neutron/neutron-openvswitch-agent/build b/docker/centos/binary/neutron/neutron-openvswitch-agent/build new file mode 120000 index 0000000000000000000000000000000000000000..ec19138031a79efca08ea540f84f25ef77ed2f22 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-openvswitch-agent/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-openvswitch-agent/check.sh b/docker/centos/binary/neutron/neutron-openvswitch-agent/check.sh new file mode 120000 index 0000000000000000000000000000000000000000..1a664032e652f3440f6603a3a5963b3b4241de9d --- /dev/null +++ b/docker/centos/binary/neutron/neutron-openvswitch-agent/check.sh @@ -0,0 +1 @@ +../../../../common/neutron/neutron-openvswitch-agent/check.sh \ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-openvswitch-agent/start.sh b/docker/centos/binary/neutron/neutron-openvswitch-agent/start.sh new file mode 120000 index 0000000000000000000000000000000000000000..c14edb0adf75e9795e2c65df3cd77d367e1dfe14 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-openvswitch-agent/start.sh @@ -0,0 +1 @@ +../../../../common/neutron/neutron-openvswitch-agent/start.sh \ No newline at end of file diff --git a/docker/common/neutron/neutron-openvswitch-agent/check.sh b/docker/common/neutron/neutron-openvswitch-agent/check.sh new file mode 100755 index 0000000000000000000000000000000000000000..087bf4fdbf19742f8e20682760211caf07caa55d --- /dev/null +++ b/docker/common/neutron/neutron-openvswitch-agent/check.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +RES=0 + +check=$(/usr/bin/neutron agent-list | awk '/ vSwitch / {print $10}') +error="ERROR: Neutron OpenvSwitch agent is not alive." + +if [[ $check != ":-)" ]]; then + echo $error >&2 + RES=1 +fi + +exit $RES diff --git a/docker/common/neutron/neutron-openvswitch-agent/start.sh b/docker/common/neutron/neutron-openvswitch-agent/start.sh new file mode 100755 index 0000000000000000000000000000000000000000..8c4d1a0371be3d116a4e4f7cef2b3934ec73630b --- /dev/null +++ b/docker/common/neutron/neutron-openvswitch-agent/start.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-neutron.sh +. /opt/kolla/config-sudoers.sh + +: ${NEUTRON_FLAT_NETWORK_NAME:=physnet1} +: ${NEUTRON_FLAT_NETWORK_INTERFACE:=eth1} + +check_required_vars PUBLIC_IP NEUTRON_FLAT_NETWORK_NAME \ + NEUTRON_FLAT_NETWORK_INTERFACE + +if ! ovs-vsctl show |grep ${NEUTRON_FLAT_NETWORK_INTERFACE} > /dev/null; then + ovs-vsctl add-br ${NEUTRON_FLAT_NETWORK_INTERFACE} +fi + +cfg=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini + +# Configure ml2_conf.ini +if [[ ${TYPE_DRIVERS} =~ vxlan ]]; then + crudini --set $cfg \ + vxlan \ + local_ip \ + "${PUBLIC_IP}" +fi + +crudini --set $cfg \ + ovs \ + bridge_mappings \ + "${NEUTRON_FLAT_NETWORK_NAME}:${NEUTRON_FLAT_NETWORK_INTERFACE}" + +crudini --set $cfg \ + ovs \ + tenant_network_type \ + "${TENANT_NETWORK_TYPES}" + +if [[ ${TENANT_NETWORK_TYPES} =~ "vlan" ]];then + crudini --set $cfg \ + ovs \ + network_vlan_ranges \ + "${NEUTRON_VLAN_NETWORK_NAME}:${NEUTRON_NETWORK_VLAN_RANGES}" +fi + +exec /usr/bin/neutron-openvswitch-agent --config-file /etc/neutron/neutron.conf --config-file $cfg diff --git a/docs/integration-guide.md b/docs/integration-guide.md index 0deb75dda1eb42b756100b7acf71ff6fb200d850..c2bfe3c612d376c76f13630a29e32b6792735ba5 100755 --- a/docs/integration-guide.md +++ b/docs/integration-guide.md @@ -102,6 +102,8 @@ all containers. This allows a simple method of ensuring every type of node NEUTRON_SERVER_SERVICE_HOST=<$HOST_IP> - The IP address/hostname used to commuicate with the Neutron API NEUTRON_SHARED_SECRET=<sharedsecret> - The shared secret used between Neutron/Nova to secure metadata communication NEUTRON_API_PASTE_CONFIG=</usr/share/neutron/api-paste.ini> - Location of Neutron's API paste config file + NEUTRON_VLAN_NETWORK_NAME=<physnet1> - List of physical_network names with which vlan networks can be created + NEUTRON_NETWORK_VLAN_RANGES=<1:1> - Colon seperated range of addresses TYPE_DRIVERS=<flat,vxlan> - List of network type driver entrypoints to be loaded TENANT_NETWORK_TYPES=<flat,vxlan> - List of network_types to allocate as tenant networks MECHANISM_DRIVERS=<linuxbridge,l2population> - List of networking mechanism driver entrypoints to be loaded