diff options
| author | Fang Fenghua <449171342@qq.com> | 2015-05-10 22:45:36 +0800 |
|---|---|---|
| committer | Sam Yaple <sam@yaple.net> | 2015-06-25 17:03:33 +0000 |
| commit | 74010ff9869cb6e1232a4aa1a3b8de971c929040 (patch) | |
| tree | cc4666f53f376512f6cfa84e41d10ae4bb38ba17 /docker/common | |
| parent | e8535fc361ab3bc925146c8b2be8e732935040cf (diff) | |
| download | kolla-74010ff9869cb6e1232a4aa1a3b8de971c929040.tar.gz kolla-74010ff9869cb6e1232a4aa1a3b8de971c929040.zip | |
Add neutron-openvswitch-agent contianer
Implements the neutron-openvswitch-agent plugin container.
Co-Authored-By: Sam Yaple <sam@yaple.net>
Partially Implements blueprint: openvswitch-container
Change-Id: Ie0fa318541e16d730b7007d3620c7873e898ed4a
Diffstat (limited to 'docker/common')
| -rwxr-xr-x | docker/common/neutron/neutron-openvswitch-agent/check.sh | 13 | ||||
| -rwxr-xr-x | docker/common/neutron/neutron-openvswitch-agent/start.sh | 45 |
2 files changed, 58 insertions, 0 deletions
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 000000000..087bf4fdb --- /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 000000000..8c4d1a037 --- /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 |
