From ed107a5e26f35351a178c12eed5cd38c086409db Mon Sep 17 00:00:00 2001 From: Daneyon Hansen Date: Tue, 7 Apr 2015 19:34:40 +0000 Subject: [PATCH] Adds Neutron Agents Support Previously, the agents ran in seperate containers. Since some of the agents create and use network namespaces, runnning them in seperate containers has become a challenge. This patch adds neutron agent support in a single container. Partially Implements: blueprint compute-operation-neutron Change-Id: If4f893abd50d90b58e8435ec2659870dce36951c --- compose/linux-bridge.yml | 7 -- compose/neutron-agents.yml | 11 ++ compose/nova-compute.yml | 38 ++++++ docker/neutron/agents/dhcp/Dockerfile | 13 --- docker/neutron/agents/dhcp/build | 1 - docker/neutron/agents/dhcp/start.sh | 46 -------- docker/neutron/agents/l3/Dockerfile | 13 --- docker/neutron/agents/l3/build | 1 - docker/neutron/agents/l3/start.sh | 61 ---------- docker/neutron/agents/l3/sudoers.sh | 12 -- docker/neutron/agents/linux-bridge/Dockerfile | 14 --- docker/neutron/agents/linux-bridge/build | 1 - docker/neutron/agents/linux-bridge/check.sh | 10 -- docker/neutron/agents/linux-bridge/start.sh | 36 ------ docker/neutron/agents/linux-bridge/sudoers.sh | 12 -- docker/neutron/agents/metadata/Dockerfile | 13 --- docker/neutron/agents/metadata/build | 1 - docker/neutron/agents/metadata/sudoers.sh | 12 -- docker/neutron/neutron-agents/Dockerfile | 33 ++++++ docker/neutron/neutron-agents/build | 1 + .../check-scripts/check-dhcp-agent.sh} | 0 .../check-scripts/check-l3-agent.sh} | 0 .../check-scripts/check-linuxbridge-agent.sh | 13 +++ .../check-scripts/check-metadata-agent.sh} | 0 .../config-scripts/config-dhcp-agent.sh | 73 ++++++++++++ .../config-scripts/config-l3-agent.sh | 80 +++++++++++++ .../config-linuxbridge-agent.sh | 29 +++++ .../config-scripts/config-metadata-agent.sh} | 22 +++- .../config-scripts/config-sudoers.sh} | 0 .../neutron/neutron-agents/supervisord.conf | 53 +++++++++ docker/neutron/neutron-base/config-neutron.sh | 110 +++++++++++------- docker/neutron/neutron-server/start.sh | 10 ++ docker/nova-base/config-nova.sh | 6 +- docs/integration-guide.md | 5 + docs/minimal-environment-vars.md | 12 ++ tools/genenv | 21 +++- 36 files changed, 461 insertions(+), 309 deletions(-) delete mode 100644 compose/linux-bridge.yml create mode 100644 compose/neutron-agents.yml create mode 100644 compose/nova-compute.yml delete mode 100644 docker/neutron/agents/dhcp/Dockerfile delete mode 120000 docker/neutron/agents/dhcp/build delete mode 100755 docker/neutron/agents/dhcp/start.sh delete mode 100644 docker/neutron/agents/l3/Dockerfile delete mode 120000 docker/neutron/agents/l3/build delete mode 100755 docker/neutron/agents/l3/start.sh delete mode 100644 docker/neutron/agents/l3/sudoers.sh delete mode 100644 docker/neutron/agents/linux-bridge/Dockerfile delete mode 120000 docker/neutron/agents/linux-bridge/build delete mode 100755 docker/neutron/agents/linux-bridge/check.sh delete mode 100755 docker/neutron/agents/linux-bridge/start.sh delete mode 100644 docker/neutron/agents/linux-bridge/sudoers.sh delete mode 100644 docker/neutron/agents/metadata/Dockerfile delete mode 120000 docker/neutron/agents/metadata/build delete mode 100644 docker/neutron/agents/metadata/sudoers.sh create mode 100644 docker/neutron/neutron-agents/Dockerfile create mode 120000 docker/neutron/neutron-agents/build rename docker/neutron/{agents/dhcp/check.sh => neutron-agents/check-scripts/check-dhcp-agent.sh} (100%) rename docker/neutron/{agents/l3/check.sh => neutron-agents/check-scripts/check-l3-agent.sh} (100%) create mode 100755 docker/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh rename docker/neutron/{agents/metadata/check.sh => neutron-agents/check-scripts/check-metadata-agent.sh} (100%) create mode 100755 docker/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh create mode 100755 docker/neutron/neutron-agents/config-scripts/config-l3-agent.sh create mode 100755 docker/neutron/neutron-agents/config-scripts/config-linuxbridge-agent.sh rename docker/neutron/{agents/metadata/start.sh => neutron-agents/config-scripts/config-metadata-agent.sh} (68%) rename docker/neutron/{agents/dhcp/sudoers.sh => neutron-agents/config-scripts/config-sudoers.sh} (100%) mode change 100644 => 100755 create mode 100644 docker/neutron/neutron-agents/supervisord.conf diff --git a/compose/linux-bridge.yml b/compose/linux-bridge.yml deleted file mode 100644 index 75f27f8df8..0000000000 --- a/compose/linux-bridge.yml +++ /dev/null @@ -1,7 +0,0 @@ -linuxbridge: - image: kollaglue/centos-rdo-linux-bridge - name: neutron-linuxbridge-agent - net: "host" - restart: always - env_file: - - openstack.env diff --git a/compose/neutron-agents.yml b/compose/neutron-agents.yml new file mode 100644 index 0000000000..971dad7205 --- /dev/null +++ b/compose/neutron-agents.yml @@ -0,0 +1,11 @@ +neutronagents: + image: kollaglue/centos-rdo-neutron-agents:latest + name: neutron-agents + net: "host" + privileged: true + restart: always + volumes: + - /var/run/netns/:/var/run/netns/ + - /lib/modules:/lib/modules:ro + env_file: + - openstack.env diff --git a/compose/nova-compute.yml b/compose/nova-compute.yml new file mode 100644 index 0000000000..87e7e4ad6c --- /dev/null +++ b/compose/nova-compute.yml @@ -0,0 +1,38 @@ +computedata: + image: kollaglue/centos-rdo-nova-compute-data + name: computedata + +libvirt: + image: kollaglue/centos-rdo-nova-libvirt + name: libvirt + net: host + pid: host + privileged: true + restart: always + env_file: + - openstack.env + volumes: + - /run:/run + - /sys/fs/cgroup:/sys/fs/cgroup + - /var/lib/nova:/var/lib/nova + - /var/lib/libvirt:/var/lib/libvirt + - /etc/libvirt/qemu:/etc/libvirt/qemu + volumes_from: + - computedata + +novacompute: + image: kollaglue/centos-rdo-nova-compute + name: nova-compute + net: host + privileged: true + restart: always + env_file: + - openstack.env + volumes: + - /run:/run + - /sys/fs/cgroup:/sys/fs/cgroup + - /var/lib/nova:/var/lib/nova + - /var/lib/libvirt:/var/lib/libvirt + - /etc/libvirt/qemu:/etc/libvirt/qemu + volumes_from: + - computedata diff --git a/docker/neutron/agents/dhcp/Dockerfile b/docker/neutron/agents/dhcp/Dockerfile deleted file mode 100644 index 261d4f40df..0000000000 --- a/docker/neutron/agents/dhcp/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base -MAINTAINER Kolla Project (https://launchpad.net/kolla) - -# Install required packages -RUN yum install -y openstack-neutron && yum clean all - -# Add required scripts -ADD ./start.sh /start.sh -ADD ./check.sh /check.sh -ADD ./sudoers.sh /sudoers.sh - -# Configure and run the service -CMD ["/start.sh"] diff --git a/docker/neutron/agents/dhcp/build b/docker/neutron/agents/dhcp/build deleted file mode 120000 index 8d652f7ee2..0000000000 --- a/docker/neutron/agents/dhcp/build +++ /dev/null @@ -1 +0,0 @@ -../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/neutron/agents/dhcp/start.sh b/docker/neutron/agents/dhcp/start.sh deleted file mode 100755 index 70c8465265..0000000000 --- a/docker/neutron/agents/dhcp/start.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -set -e - -. /opt/kolla/config-neutron.sh -. /sudoers.sh - -: ${INTERFACE_DRIVER:=neutron.agent.linux.interface.BridgeInterfaceDriver} -: ${DHCP_DRIVER:=neutron.agent.linux.dhcp.Dnsmasq} -: ${USE_NAMESPACES:=false} - -check_required_vars VERBOSE_LOGGING DEBUG_LOGGING NEUTRON_DHCP_AGENT_LOG_FILE - -cfg=/etc/neutron/dhcp_agent.ini -neutron_conf=/etc/neutron/neutron.conf - -# Logging -crudini --set $neutron_conf \ - DEFAULT \ - log_file \ - "${NEUTRON_DHCP_AGENT_LOG_FILE}" - -# Configure dhcp_agent.ini -crudini --set $cfg \ - DEFAULT \ - verbose \ - "${VERBOSE_LOGGING}" -crudini --set $cfg \ - DEFAULT \ - debug \ - "${DEBUG_LOGGING}" -crudini --set $cfg \ - DEFAULT \ - interface_driver \ - "${INTERFACE_DRIVER}" -crudini --set $cfg \ - DEFAULT \ - dhcp_driver \ - "${DHCP_DRIVER}" -crudini --set $cfg \ - DEFAULT \ - use_namespaces \ - "${USE_NAMESPACES}" - -# Start DHCP Agent -exec /usr/bin/neutron-dhcp-agent diff --git a/docker/neutron/agents/l3/Dockerfile b/docker/neutron/agents/l3/Dockerfile deleted file mode 100644 index 261d4f40df..0000000000 --- a/docker/neutron/agents/l3/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base -MAINTAINER Kolla Project (https://launchpad.net/kolla) - -# Install required packages -RUN yum install -y openstack-neutron && yum clean all - -# Add required scripts -ADD ./start.sh /start.sh -ADD ./check.sh /check.sh -ADD ./sudoers.sh /sudoers.sh - -# Configure and run the service -CMD ["/start.sh"] diff --git a/docker/neutron/agents/l3/build b/docker/neutron/agents/l3/build deleted file mode 120000 index 8d652f7ee2..0000000000 --- a/docker/neutron/agents/l3/build +++ /dev/null @@ -1 +0,0 @@ -../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/neutron/agents/l3/start.sh b/docker/neutron/agents/l3/start.sh deleted file mode 100755 index 0ad1121659..0000000000 --- a/docker/neutron/agents/l3/start.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -set -e - -. /opt/kolla/config-neutron.sh -. /sudoers.sh - -: ${INTERFACE_DRIVER:=neutron.agent.linux.interface.BridgeInterfaceDriver} -: ${USE_NAMESPACES:=false} - -check_required_vars VERBOSE_LOGGING DEBUG_LOGGING NEUTRON_L3_AGENT_LOG_FILE - -cfg=/etc/neutron/l3_agent.ini -neutron_conf=/etc/neutron/neutron.conf - -# Logging -crudini --set $neutron_conf \ - DEFAULT \ - log_file \ - "${NEUTRON_L3_AGENT_LOG_FILE}" - -# Configure l3_agent.ini -crudini --set $cfg \ - DEFAULT \ - verbose \ - "${VERBOSE_LOGGING}" -crudini --set $cfg \ - DEFAULT \ - debug \ - "${DEBUG_LOGGING}" -crudini --set $cfg \ - DEFAULT \ - interface_driver \ - "${INTERFACE_DRIVER}" -crudini --set $cfg \ - DEFAULT \ - gateway_external_network_id \ - "" -crudini --set $cfg \ - DEFAULT \ - external_network_bridge \ - "" -crudini --set $cfg \ - DEFAULT \ - use_namespaces \ - "${USE_NAMESPACES}" - -if [ "${USE_NAMESPACES}" == "false" ] || [ "${USE_NAMESPACES}" == "False" ] ; then - # source Keystone credential file - source /openrc - # Create router if it does not exist - /usr/bin/neutron router-list | grep admin-router || /usr/bin/neutron router-create admin-router - # Set router-id - crudini --set $cfg \ - DEFAULT \ - router_id \ - "$(/usr/bin/neutron router-list | awk '/ admin-router / {print $2}')" -fi - -# Start L3 Agent -exec /usr/bin/neutron-l3-agent --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini diff --git a/docker/neutron/agents/l3/sudoers.sh b/docker/neutron/agents/l3/sudoers.sh deleted file mode 100644 index 1984200268..0000000000 --- a/docker/neutron/agents/l3/sudoers.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Neutron uses rootwrap which requires a tty for sudo. -# Since the container is running in daemon mode, a tty -# is not present and requiretty must be commented out. -if [ ! -f /var/run/sudo-modified ]; then - chmod 0640 /etc/sudoers - sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers - chmod 0440 /etc/sudoers -fi - -touch /var/run/sudo-modified diff --git a/docker/neutron/agents/linux-bridge/Dockerfile b/docker/neutron/agents/linux-bridge/Dockerfile deleted file mode 100644 index b53c30a4f5..0000000000 --- a/docker/neutron/agents/linux-bridge/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base -MAINTAINER Kolla Project (https://launchpad.net/kolla) - -# Install required packages -RUN yum install -y openstack-neutron \ - openstack-neutron-linuxbridge && yum clean all - -# Add required scripts -ADD ./start.sh /start.sh -ADD ./check.sh /check.sh -ADD ./sudoers.sh /sudoers.sh - -# Configure and run the service -CMD ["/start.sh"] diff --git a/docker/neutron/agents/linux-bridge/build b/docker/neutron/agents/linux-bridge/build deleted file mode 120000 index 8d652f7ee2..0000000000 --- a/docker/neutron/agents/linux-bridge/build +++ /dev/null @@ -1 +0,0 @@ -../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/neutron/agents/linux-bridge/check.sh b/docker/neutron/agents/linux-bridge/check.sh deleted file mode 100755 index 6b7db95e7e..0000000000 --- a/docker/neutron/agents/linux-bridge/check.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -RES=0 - -if ! /usr/sbin/brctl show; then - echo "ERROR: brctl show failed" >&2 - RES=1 -fi - -exit $RES diff --git a/docker/neutron/agents/linux-bridge/start.sh b/docker/neutron/agents/linux-bridge/start.sh deleted file mode 100755 index 2ff5a05ede..0000000000 --- a/docker/neutron/agents/linux-bridge/start.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -set -e - -. /opt/kolla/config-neutron.sh -. /sudoers.sh - -: ${NEUTRON_FLAT_NETWORK_NAME:=physnet1} -: ${NEUTRON_FLAT_NETWORK_INTERFACE:=eth1} - -check_required_vars PUBLIC_IP NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE - -cfg=/etc/neutron/plugins/ml2/ml2_conf.ini -neutron_conf=/etc/neutron/neutron.conf - -# Logging -crudini --set $neutron_conf \ - DEFAULT \ - log_file \ - "${NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE}" - -# Configure ml2_conf.ini -crudini --set $cfg \ - vxlan \ - local_ip \ - "${PUBLIC_IP}" -crudini --set $cfg \ - linux_bridge \ - physical_interface_mappings \ - "${NEUTRON_FLAT_NETWORK_NAME}:${NEUTRON_FLAT_NETWORK_INTERFACE}" - -#Initialization scripts expect a symbolic link -/usr/bin/ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini - -# Start the linux bridge agent. -exec /usr/bin/neutron-linuxbridge-agent diff --git a/docker/neutron/agents/linux-bridge/sudoers.sh b/docker/neutron/agents/linux-bridge/sudoers.sh deleted file mode 100644 index 1984200268..0000000000 --- a/docker/neutron/agents/linux-bridge/sudoers.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Neutron uses rootwrap which requires a tty for sudo. -# Since the container is running in daemon mode, a tty -# is not present and requiretty must be commented out. -if [ ! -f /var/run/sudo-modified ]; then - chmod 0640 /etc/sudoers - sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers - chmod 0440 /etc/sudoers -fi - -touch /var/run/sudo-modified diff --git a/docker/neutron/agents/metadata/Dockerfile b/docker/neutron/agents/metadata/Dockerfile deleted file mode 100644 index 261d4f40df..0000000000 --- a/docker/neutron/agents/metadata/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base -MAINTAINER Kolla Project (https://launchpad.net/kolla) - -# Install required packages -RUN yum install -y openstack-neutron && yum clean all - -# Add required scripts -ADD ./start.sh /start.sh -ADD ./check.sh /check.sh -ADD ./sudoers.sh /sudoers.sh - -# Configure and run the service -CMD ["/start.sh"] diff --git a/docker/neutron/agents/metadata/build b/docker/neutron/agents/metadata/build deleted file mode 120000 index 8d652f7ee2..0000000000 --- a/docker/neutron/agents/metadata/build +++ /dev/null @@ -1 +0,0 @@ -../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/neutron/agents/metadata/sudoers.sh b/docker/neutron/agents/metadata/sudoers.sh deleted file mode 100644 index 1984200268..0000000000 --- a/docker/neutron/agents/metadata/sudoers.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Neutron uses rootwrap which requires a tty for sudo. -# Since the container is running in daemon mode, a tty -# is not present and requiretty must be commented out. -if [ ! -f /var/run/sudo-modified ]; then - chmod 0640 /etc/sudoers - sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers - chmod 0440 /etc/sudoers -fi - -touch /var/run/sudo-modified diff --git a/docker/neutron/neutron-agents/Dockerfile b/docker/neutron/neutron-agents/Dockerfile new file mode 100644 index 0000000000..e083aa9b87 --- /dev/null +++ b/docker/neutron/neutron-agents/Dockerfile @@ -0,0 +1,33 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +# Install supervisor +RUN easy_install supervisor + +# Install supervisor-stdout +RUN pip install supervisor-stdout + +# Install required packages +RUN yum install -y openstack-neutron-linuxbridge \ + net-tools \ + && yum clean all + +# Add config scripts +ADD config-scripts/config-linuxbridge-agent.sh /opt/kolla/neutron/ +ADD config-scripts/config-dhcp-agent.sh /opt/kolla/neutron/ +ADD config-scripts/config-l3-agent.sh /opt/kolla/neutron/ +ADD config-scripts/config-metadata-agent.sh /opt/kolla/neutron/ +ADD config-scripts/config-sudoers.sh /opt/kolla/ + +# Add check scripts +ADD check-scripts/check-linuxbridge-agent.sh /opt/kolla/neutron/ +ADD check-scripts/check-dhcp-agent.sh /opt/kolla/neutron/ +ADD check-scripts/check-l3-agent.sh /opt/kolla/neutron/ +ADD check-scripts/check-metadata-agent.sh /opt/kolla/neutron/ + +# Configure supervisord +RUN mkdir -p /var/log/supervisor/ +ADD supervisord.conf /etc/ + +# Start supervisor +CMD ["/usr/bin/supervisord"] diff --git a/docker/neutron/neutron-agents/build b/docker/neutron/neutron-agents/build new file mode 120000 index 0000000000..43944faa00 --- /dev/null +++ b/docker/neutron/neutron-agents/build @@ -0,0 +1 @@ +../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/neutron/agents/dhcp/check.sh b/docker/neutron/neutron-agents/check-scripts/check-dhcp-agent.sh similarity index 100% rename from docker/neutron/agents/dhcp/check.sh rename to docker/neutron/neutron-agents/check-scripts/check-dhcp-agent.sh diff --git a/docker/neutron/agents/l3/check.sh b/docker/neutron/neutron-agents/check-scripts/check-l3-agent.sh similarity index 100% rename from docker/neutron/agents/l3/check.sh rename to docker/neutron/neutron-agents/check-scripts/check-l3-agent.sh diff --git a/docker/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh b/docker/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh new file mode 100755 index 0000000000..96b472490f --- /dev/null +++ b/docker/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +RES=0 + +check=$(/usr/bin/neutron agent-list | awk '/ Linux / {print $9}') +error="ERROR: Neutron Linux Bridge agent is not alive." + +if [[ $check != ":-)" ]]; then + echo $error >&2 + RES=1 +fi + +exit $RES diff --git a/docker/neutron/agents/metadata/check.sh b/docker/neutron/neutron-agents/check-scripts/check-metadata-agent.sh similarity index 100% rename from docker/neutron/agents/metadata/check.sh rename to docker/neutron/neutron-agents/check-scripts/check-metadata-agent.sh diff --git a/docker/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh b/docker/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh new file mode 100755 index 0000000000..6149fc09ed --- /dev/null +++ b/docker/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-neutron.sh +. /opt/kolla/config-sudoers.sh + +: ${DHCP_DRIVER:=neutron.agent.linux.dhcp.Dnsmasq} +: ${USE_NAMESPACES:=true} +: ${DELETE_NAMESPACES:=true} +: ${DNSMASQ_CONFIG_FILE:=/etc/neutron/dnsmasq-neutron.conf} +: ${ROOT_HELPER:=sudo neutron-rootwrap /etc/neutron/rootwrap.conf} + +check_required_vars VERBOSE_LOGGING DEBUG_LOGGING MECHANISM_DRIVERS \ + DHCP_DRIVER USE_NAMESPACES DELETE_NAMESPACES \ + NEUTRON_LOG_DIR DNSMASQ_CONFIG_FILE \ + +cfg=/etc/neutron/dhcp_agent.ini +neutron_conf=/etc/neutron/neutron.conf + +if [[ ${MECHANISM_DRIVERS} =~ .*linuxbridge.* ]]; then + interface_driver="neutron.agent.linux.interface.BridgeInterfaceDriver" +elif [[ ${MECHANISM_DRIVERS} == "openvswitch" ]]; then + interface_driver="neutron.agent.linux.interface.OVSInterfaceDriver" +fi + +# Logging +crudini --set $neutron_conf \ + DEFAULT \ + log_file \ + "${NEUTRON_DHCP_AGENT_LOG_FILE}" + +# Configure dhcp_agent.ini +crudini --set $cfg \ + DEFAULT \ + verbose \ + "${VERBOSE_LOGGING}" +crudini --set $cfg \ + DEFAULT \ + debug \ + "${DEBUG_LOGGING}" +crudini --set $cfg \ + DEFAULT \ + interface_driver \ + "$interface_driver" +crudini --set $cfg \ + DEFAULT \ + dhcp_driver \ + "${DHCP_DRIVER}" +crudini --set $cfg \ + DEFAULT \ + use_namespaces \ + "${USE_NAMESPACES}" +crudini --set $cfg \ + DEFAULT \ + delete_namespaces \ + "${DELETE_NAMESPACES}" +crudini --set $cfg \ + DEFAULT \ + dnsmasq_config_file \ + "${DNSMASQ_CONFIG_FILE}" +crudini --set $cfg \ + DEFAULT \ + root_helper \ + "${ROOT_HELPER}" + +cat > ${DNSMASQ_CONFIG_FILE} < /openrc < - The IP address/hostname used to commuicate with the Neutron API NEUTRON_SHARED_SECRET= - The shared secret used between Neutron/Nova to secure metadata communication NEUTRON_API_PASTE_CONFIG= - Location of Neutron's API paste config file + TYPE_DRIVERS= - List of network type driver entrypoints to be loaded + TENANT_NETWORK_TYPES= - List of network_types to allocate as tenant networks + MECHANISM_DRIVERS= - List of networking mechanism driver entrypoints to be loaded + NEUTRON_FLAT_NETWORK_NAME= - List of physical_network names with which flat networks can be created + NEUTRON_FLAT_NETWORK_INTERFACE= - List of physical interface names that connect to physical_networks HEAT_DB_NAME= - The heat DB name HEAT_DB_PASSWORD= - The heat db password HEAT_KEYSTONE_PASSWORD= - The keystone password for the heat user diff --git a/docs/minimal-environment-vars.md b/docs/minimal-environment-vars.md index 710ea443ac..c681baa76a 100644 --- a/docs/minimal-environment-vars.md +++ b/docs/minimal-environment-vars.md @@ -148,6 +148,7 @@ In order for each service to function, there is a minimum set of required variab NOVA_API_SERVICE_HOST NOVA_EC2_API_SERVICE_HOST NOVA_EC2_SERVICE_HOST + NOVA_METADATA_API_SERVICE_HOST PUBLIC_IP # Nova-compute @@ -245,3 +246,14 @@ In order for each service to function, there is a minimum set of required variab NEUTRON_KEYSTONE_PASSWORD NEUTRON_SERVER_SERVICE_HOST NEUTRON_API_PASTE_CONFIG + +# Neutron ML2 PLugin + + TYPE_DRIVERS + TENANT_NETWORK_TYPES + MECHANISM_DRIVERS + +# Neutron Linux Bridge Plugin + + NEUTRON_FLAT_NETWORK_NAME + NEUTRON_FLAT_NETWORK_INTERFACE diff --git a/tools/genenv b/tools/genenv index 0f32260365..c7748b2250 100755 --- a/tools/genenv +++ b/tools/genenv @@ -32,7 +32,8 @@ ADMIN_TENANT_NAME=admin PUBLIC_IP=$HOST_IP # Logging -DEBUG_LOGGING=false +#DEBUG_LOGGING=false +DEBUG_LOGGING=true VERBOSE_LOGGING=true NOVA_LOG_DIR= NEUTRON_LOG_DIR= @@ -77,16 +78,13 @@ NOVA_DB_USER=nova NOVA_KEYSTONE_USER=nova NOVA_KEYSTONE_PASSWORD=nova NOVA_API_SERVICE_HOST=$HOST_IP +NOVA_METADATA_API_SERVICE_HOST=$HOST_IP NOVA_EC2_SERVICE_HOST=$HOST_IP NOVA_PUBLIC_INTERFACE=$MY_DEV NOVA_FLAT_INTERFACE=eth1 ENABLED_APIS=ec2,osapi_compute,metadata METADATA_HOST=$HOST_IP -# Neutron Linux Bridge Agent -NEUTRON_FLAT_NETWORK_NAME=physnet1 -NEUTRON_FLAT_NETWORK_INTERFACE=eth1 - # Neutron NEUTRON_DB_NAME=neutron NEUTRON_DB_USER=neutron @@ -95,6 +93,13 @@ NEUTRON_KEYSTONE_USER=neutron NEUTRON_KEYSTONE_PASSWORD=neutron NEUTRON_SERVER_SERVICE_HOST=$HOST_IP NEUTRON_API_PASTE_CONFIG=/usr/share/neutron/api-paste.ini +# Neutron ML2 Plugin +TYPE_DRIVERS=flat,vxlan +TENANT_NETWORK_TYPES=flat,vxlan +MECHANISM_DRIVERS=linuxbridge,l2population +# Neutron Linux Bridge Agent +NEUTRON_FLAT_NETWORK_NAME=physnet1 +NEUTRON_FLAT_NETWORK_INTERFACE=eth1 # Nova/Neutron NEUTRON_SHARED_SECRET=sharedsecret @@ -126,6 +131,9 @@ NEUTRON_SERVER_LOG_FILE=$NEUTRON_SERVER_LOG_FILE NEUTRON_L3_AGENT_LOG_FILE=$NEUTRON_L3_AGENT_LOG_FILE NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE=$NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE NEUTRON_METADATA_AGENT_LOG_FILE=$NEUTRON_METADATA_AGENT_LOG_FILE +TYPE_DRIVERS=$TYPE_DRIVERS +TENANT_NETWORK_TYPES=$TENANT_NETWORK_TYPES +MECHANISM_DRIVERS=$MECHANISM_DRIVERS ADMIN_USER_PASSWORD=$ADMIN_USER_PASSWORD ADMIN_TENANT_NAME=$ADMIN_TENANT_NAME DB_ROOT_PASSWORD=$MARIADB_ROOT_PASSWORD @@ -148,6 +156,7 @@ MARIADB_SERVICE_HOST=$HOST_IP MARIADB_ROOT_PASSWORD=$MARIADB_ROOT_PASSWORD NETWORK_MANAGER=$NETWORK_MANAGER NOVA_API_SERVICE_HOST=$NOVA_API_SERVICE_HOST +NOVA_METADATA_API_SERVICE_HOST=$NOVA_METADATA_API_SERVICE_HOST ENABLED_APIS=$ENABLED_APIS METADATA_HOST=$METADATA_HOST NOVA_DB_NAME=$NOVA_DB_NAME @@ -165,6 +174,8 @@ NEUTRON_KEYSTONE_USER=$NEUTRON_KEYSTONE_USER NEUTRON_KEYSTONE_PASSWORD=$NEUTRON_KEYSTONE_PASSWORD NEUTRON_SERVER_SERVICE_HOST=$NEUTRON_SERVER_SERVICE_HOST NEUTRON_API_PASTE_CONFIG=$NEUTRON_API_PASTE_CONFIG +NEUTRON_FLAT_NETWORK_NAME=$NEUTRON_FLAT_NETWORK_NAME +NEUTRON_FLAT_NETWORK_INTERFACE=$NEUTRON_FLAT_NETWORK_INTERFACE HEAT_DB_NAME=$HEAT_DB_NAME HEAT_DB_PASSWORD=$HEAT_DB_PASSWORD HEAT_KEYSTONE_PASSWORD=$HEAT_KEYSTONE_PASSWORD