Adds neutron-server to neutron container-set

Adds neutron-server components of the neutron container set.

Partially Implements: blueprint compute-operation-neutron

Change-Id: I63525ae85f4ead4e010cdb9b6bc8059bb9d252e7
This commit is contained in:
Daneyon Hansen 2015-03-26 19:47:56 +00:00
parent 0b671ad58d
commit 2f2bb366e0
9 changed files with 145 additions and 58 deletions

View File

@ -0,0 +1,7 @@
neutronserver:
image: kollaglue/centos-rdo-neutron-server:latest
name: neutron-server
net: "host"
restart: always
env_file:
- openstack.env

View File

@ -5,4 +5,3 @@ RUN yum -y install openstack-neutron-ml2 && yum clean all
RUN mkdir -p /opt/kolla
COPY config-neutron.sh /opt/kolla/config-neutron.sh

View File

@ -4,28 +4,33 @@ set -e
. /opt/kolla/kolla-common.sh
: ${ADMIN_TENANT_NAME:=admin}
# Database
: ${NEUTRON_DB_NAME:=neutron}
: ${NEUTRON_DB_USER:=neutron}
: ${NEUTRON_DB_PASSWORD:=password}
# Keystone
: ${ADMIN_TENANT_NAME:=admin}
: ${NEUTRON_KEYSTONE_USER:=neutron}
: ${NEUTRON_KEYSTONE_PASSWORD:=password}
: ${KEYSTONE_AUTH_PROTOCOL:=http}
: ${KEYSTONE_ADMIN_SERVICE_HOST:=127.0.0.1}
: ${KEYSTONE_PUBLIC_SERVICE_HOST:=127.0.0.1}
: ${KEYSTONE_ADMIN_SERVICE_PORT:=35357}
: ${KEYSTONE_PUBLIC_SERVICE_PORT:=5000}
: ${KEYSTONE_REGION:=RegionOne}
# RabbitMQ
: ${RABBIT_HOST:=$RABBITMQ_SERVICE_HOST}
: ${RABBIT_USER:=guest}
: ${RABBIT_PASSWORD:=guest}
# Logging
: ${VERBOSE_LOGGING:=true}
: ${DEBUG_LOGGING:=false}
# Networking
: ${NEUTRON_FLAT_NETWORK_NAME:=physnet1}
check_required_vars NEUTRON_KEYSTONE_PASSWORD NEUTRON_LOG_DIR \
KEYSTONE_PUBLIC_SERVICE_HOST RABBITMQ_SERVICE_HOST
dump_vars
cat > /openrc <<EOF
export OS_AUTH_URL="http://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/v2.0"
export OS_USERNAME="${NEUTRON_KEYSTONE_USER}"
export OS_PASSWORD="${NEUTRON_KEYSTONE_PASSWORD}"
export OS_TENANT_NAME="${ADMIN_TENANT_NAME}"
EOF
KEYSTONE_PUBLIC_SERVICE_HOST RABBITMQ_SERVICE_HOST \
NEUTRON_API_PASTE_CONFIG
core_cfg=/etc/neutron/neutron.conf
ml2_cfg=/etc/neutron/plugins/ml2/ml2_conf.ini
@ -44,6 +49,12 @@ crudini --set $core_cfg \
debug \
"${DEBUG_LOGGING}"
# Paste config
crudini --set $core_cfg \
DEFAULT \
api_paste_config \
"${NEUTRON_API_PASTE_CONFIG}"
# Rabbit
crudini --set $core_cfg \
DEFAULT \
@ -58,27 +69,25 @@ crudini --set $core_cfg \
rabbit_password \
"${RABBIT_PASSWORD}"
# Locking
crudini --set $core_cfg \
DEFAULT \
lock_path \
"/var/lock/neutron"
# Keystone
crudini --set $core_cfg \
DEFAULT \
auth_strategy \
"keystone"
crudini --set $core_cfg \
keystone_authtoken \
auth_protocol \
"${KEYSTONE_AUTH_PROTOCOL}"
crudini --set $core_cfg \
keystone_authtoken \
auth_host \
"${KEYSTONE_ADMIN_SERVICE_HOST}"
crudini --set $core_cfg \
keystone_authtoken \
auth_port \
"${KEYSTONE_ADMIN_SERVICE_PORT}"
crudini --set $core_cfg \
keystone_authtoken \
auth_uri \
"${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/"
"${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_PUBLIC_SERVICE_HOST}:${KEYSTONE_PUBLIC_SERVICE_PORT}/v2.0"
crudini --set $core_cfg \
keystone_authtoken \
identity_uri \
"${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}"
crudini --set $core_cfg \
keystone_authtoken \
admin_tenant_name \
@ -96,15 +105,19 @@ crudini --set $core_cfg \
crudini --set $core_cfg \
DEFAULT \
core_plugin \
"ml2"
"neutron.plugins.ml2.plugin.Ml2Plugin"
crudini --set $core_cfg \
DEFAULT \
service_plugins \
"router"
"neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.firewall.fwaas_plugin.FirewallPlugin"
crudini --set $core_cfg \
DEFAULT \
allow_overlapping_ips \
"False"
"True"
crudini --set $core_cfg \
DEFAULT \
network_device_mtu \
"1450"
# Configure ml2_conf.ini
crudini --set $ml2_cfg \
@ -114,11 +127,15 @@ crudini --set $ml2_cfg \
crudini --set $ml2_cfg \
ml2 \
tenant_network_types \
"vxlan"
"vxlan,flat"
crudini --set $ml2_cfg \
ml2 \
mechanism_drivers \
"linuxbridge,l2population"
crudini --set $ml2_cfg \
ml2_type_flat \
flat_networks \
${NEUTRON_FLAT_NETWORK_NAME}
crudini --set $ml2_cfg \
ml2_type_vxlan \
vxlan_group \
@ -155,7 +172,18 @@ crudini --set $ml2_cfg \
securitygroup \
enable_security_group \
"True"
crudini --set $ml2_cfg \
securitygroup \
enable_ipset \
"True"
crudini --set $ml2_cfg \
securitygroup \
firewall_driver \
"neutron.agent.linux.iptables_firewall.IptablesFirewallDriver"
cat > /openrc <<EOF
export OS_AUTH_URL="http://${KEYSTONE_PUBLIC_SERVICE_HOST}:${KEYSTONE_PUBLIC_SERVICE_PORT}/v2.0"
export OS_USERNAME="${NEUTRON_KEYSTONE_USER}"
export OS_PASSWORD="${NEUTRON_KEYSTONE_PASSWORD}"
export OS_TENANT_NAME="${ADMIN_TENANT_NAME}"
EOF

View File

@ -4,11 +4,9 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
#Install required packages
RUN yum install -y openstack-neutron \
python-neutronclient \
mariadb \
which \
&& yum clean all
VOLUME /var/lib/neutron
ADD ./start.sh /start.sh
ADD ./check.sh /check.sh

View File

@ -2,15 +2,16 @@
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-neutron.sh
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_AUTH_PROTOCOL NOVA_API_SERVICE_HOST \
NOVA_ADMIN_PASSWORD NEUTRON_DB_NAME NEUTRON_DB_USER \
NOVA_KEYSTONE_USER NOVA_KEYSTONE_PASSWORD \
NEUTRON_DB_NAME NEUTRON_DB_USER NEUTRON_DB_PASSWORD \
NEUTRON_KEYSTONE_USER NEUTRON_KEYSTONE_PASSWORD \
ADMIN_TENANT_NAME NEUTRON_SERVER_SERVICE_HOST \
PUBLIC_IP NEUTRON_DB_PASSWORD NEUTRON_SERVER_LOG_FILE
fail_unless_os_service_running keystone
fail_unless_db
@ -22,7 +23,7 @@ GRANT ALL PRIVILEGES ON ${NEUTRON_DB_NAME}.* TO
EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
# Configure Keystone Service Catalog
crux user-create -n "${NEUTRON_KEYSTONE_USER}" \
@ -31,9 +32,12 @@ crux user-create -n "${NEUTRON_KEYSTONE_USER}" \
-r admin
crux endpoint-create -n neutron -t network \
-I "${KEYSTONE_AUTH_PROTOCOL}://${NEUTRON_SERVER_SERVICE_HOST}:9696" \
-P "${KEYSTONE_AUTH_PROTOCOL}://${PUBLIC_IP}:9696" \
-A "${KEYSTONE_AUTH_PROTOCOL}://${NEUTRON_SERVER_SERVICE_HOST}:9696"
-I "${KEYSTONE_AUTH_PROTOCOL}://${NEUTRON_SERVER_SERVICE_HOST}:${NEUTRON_SERVER_SERVICE_PORT}" \
-P "${KEYSTONE_AUTH_PROTOCOL}://${NEUTRON_SERVER_SERVICE_HOST}:${NEUTRON_SERVER_SERVICE_PORT}" \
-A "${KEYSTONE_AUTH_PROTOCOL}://${NEUTRON_SERVER_SERVICE_HOST}:${NEUTRON_SERVER_SERVICE_PORT}"
core_cfg=/etc/neutron/neutron.conf
ml2_cfg=/etc/neutron/plugins/ml2/ml2_conf.ini
# Logging
crudini --set /etc/neutron/neutron.conf \
@ -42,45 +46,44 @@ crudini --set /etc/neutron/neutron.conf \
"${NEUTRON_SERVER_LOG_FILE}"
# Database
crudini --set /etc/neutron/neutron.conf \
crudini --set $core_cfg \
database \
connection \
"mysql://${NEUTRON_DB_USER}:${NEUTRON_DB_PASSWORD}@${MARIADB_SERVICE_HOST}/${NEUTRON_DB_NAME}"
# Nova
crudini --set /etc/neutron/neutron.conf \
crudini --set $core_cfg \
DEFAULT \
notify_nova_on_port_status_changes \
"True"
crudini --set /etc/neutron/neutron.conf \
crudini --set $core_cfg \
DEFAULT \
notify_nova_on_port_data_changes \
"True"
crudini --set /etc/neutron/neutron.conf \
crudini --set $core_cfg \
DEFAULT \
nova_url \
"http://${NOVA_API_SERVICE_HOST}:8774/v2"
crudini --set /etc/neutron/neutron.conf \
"http://${NOVA_API_SERVICE_HOST}:${NOVA_API_SERVICE_PORT}/v2"
crudini --set $core_cfg \
DEFAULT \
nova_admin_auth_url \
"http://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
crudini --set /etc/neutron/neutron.conf \
"${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
crudini --set $core_cfg \
DEFAULT \
nova_region_name \
"RegionOne"
crudini --set /etc/neutron/neutron.conf \
"${KEYSTONE_REGION}"
crudini --set $core_cfg \
DEFAULT \
nova_admin_username \
"nova"
crudini --set /etc/neutron/neutron.conf \
"${NOVA_KEYSTONE_USER}"
crudini --set $core_cfg \
DEFAULT \
nova_admin_tenant_id \
"$(keystone tenant-list | grep $ADMIN_TENANT_NAME | awk '{print $2;}')"
crudini --set /etc/neutron/neutron.conf \
crudini --set $core_cfg \
DEFAULT \
nova_admin_password \
"${NOVA_ADMIN_PASSWORD}"
"${NOVA_KEYSTONE_PASSWORD}"
/usr/bin/ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade juno" neutron
exec /usr/bin/neutron-server
exec /usr/bin/neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini

View File

@ -14,6 +14,7 @@
: ${PUBLIC_NETWORK:=eth0}
: ${ENABLED_APIS:=ec2,osapi_compute,metadata}
: ${METADATA_HOST:=$PUBLIC_IP}
: ${NEUTRON_SHARED_SECRET:=sharedsecret}
check_required_vars KEYSTONE_ADMIN_TOKEN NOVA_DB_PASSWORD \
RABBITMQ_SERVICE_HOST GLANCE_API_SERVICE_HOST \
@ -89,7 +90,15 @@ elif [ "${NETWORK_MANAGER}" == "neutron" ] ; then
crudini --set $cfg DEFAULT neutron_default_tenant_id default
crudini --set $cfg DEFAULT network_api_class nova.network.neutronv2.api.API
crudini --set $cfg DEFAULT security_group_api neutron
crudini --set $cfg DEFAULT linuxnet_interface_driver nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
crudini --set $cfg DEFAULT libvirt_vif_driver nova.virt.libvirt.vif.LibvirtGenericVIFDriver
crudini --set $cfg DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
crudini --set $cfg neutron url http://${NEUTRON_SERVER_SERVICE_HOST}:${NEUTRON_SERVER_SERVICE_PORT}
crudini --set $cfg neutron auth_strategy keystone
crudini --set $cfg neutron admin_auth_url ${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0
crudini --set $cfg neutron admin_tenant_name ${ADMIN_TENANT_NAME}
crudini --set $cfg neutron admin_username ${NEUTRON_KEYSTONE_USER}
crudini --set $cfg neutron admin_password ${NEUTRON_KEYSTONE_PASSWORD}
else
echo "Incorrect NETWORK_MANAGER ${NETWORK_MANAGER}. Supported options are nova and neutron."
exit 1

View File

@ -84,6 +84,14 @@ all containers. This allows a simple method of ensuring every type of node
NOVA_EC2_SERVICE_HOST=<IP> _ The IP Address where the Nova EC2 service is hosted
NOVA_KEYSTONE_PASSWORD=<password> - The Nova keystone password
NOVA_KEYSTONE_USER=<nova> - The Nova keystone username
NEUTRON_DB_NAME=<neutron> - The name of the Neutron database
NEUTRON_DB_USER=<neutron> - The name used by Neutron to access the Neutron database
NEUTRON_DB_PASSWORD=<password> The password used by Neutron to access the Neutron database
NEUTRON_KEYSTONE_USER=<neutron> - The name used by Neutron to communicate with Keystone
NEUTRON_KEYSTONE_PASSWORD=<neutron> - The password used by Neutron to communicate with Keystone
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
HEAT_DB_NAME=<heat> - The heat DB name
HEAT_DB_PASSWORD=<kolla> - The heat db password
HEAT_KEYSTONE_PASSWORD=<heat> - The keystone password for the heat user

View File

@ -231,3 +231,17 @@ In order for each service to function, there is a minimum set of required variab
NOVA_EC2_NETWORK_SERVICE_HOST
NOVA_EC2_SERVICE_HOST
PUBLIC_IP
# Neutron/Nova
NEUTRON_SHARED_SECRET
# Neutron Server
NEUTRON_DB_NAME
NEUTRON_DB_USER
NEUTRON_DB_PASSWORD
NEUTRON_KEYSTONE_USER
NEUTRON_KEYSTONE_PASSWORD
NEUTRON_SERVER_SERVICE_HOST
NEUTRON_API_PASTE_CONFIG

View File

@ -50,6 +50,9 @@ RABBITMQ_SERVICE_HOST=$HOST_IP
RABBIT_USER=guest
RABBIT_PASSWORD=guest
# Networking Options are nova or neutron
NETWORK_MANAGER=neutron
# Keystone
KEYSTONE_ADMIN_TOKEN=$PASSWORD
KEYSTONE_DB_PASSWORD=kolla
@ -77,7 +80,6 @@ NOVA_API_SERVICE_HOST=$HOST_IP
NOVA_EC2_SERVICE_HOST=$HOST_IP
NOVA_PUBLIC_INTERFACE=$MY_DEV
NOVA_FLAT_INTERFACE=eth1
CONFIG_NETWORK=True
ENABLED_APIS=ec2,osapi_compute,metadata
METADATA_HOST=$HOST_IP
@ -85,6 +87,18 @@ METADATA_HOST=$HOST_IP
NEUTRON_FLAT_NETWORK_NAME=physnet1
NEUTRON_FLAT_NETWORK_INTERFACE=eth1
# Neutron
NEUTRON_DB_NAME=neutron
NEUTRON_DB_USER=neutron
NEUTRON_DB_PASSWORD=password
NEUTRON_KEYSTONE_USER=neutron
NEUTRON_KEYSTONE_PASSWORD=neutron
NEUTRON_SERVER_SERVICE_HOST=$HOST_IP
NEUTRON_API_PASTE_CONFIG=/usr/share/neutron/api-paste.ini
# Nova/Neutron
NEUTRON_SHARED_SECRET=sharedsecret
# Heat
HEAT_DB_NAME=heat
HEAT_DB_PASSWORD=kolla
@ -114,7 +128,6 @@ NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE=$NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE
NEUTRON_METADATA_AGENT_LOG_FILE=$NEUTRON_METADATA_AGENT_LOG_FILE
ADMIN_USER_PASSWORD=$ADMIN_USER_PASSWORD
ADMIN_TENANT_NAME=$ADMIN_TENANT_NAME
CONFIG_NETWORK=$CONFIG_NETWORK
DB_ROOT_PASSWORD=$MARIADB_ROOT_PASSWORD
FLAT_INTERFACE=$NOVA_FLAT_INTERFACE
GLANCE_API_SERVICE_HOST=$GLANCE_API_SERVICE_HOST
@ -133,7 +146,7 @@ KEYSTONE_DB_PASSWORD=$KEYSTONE_DB_PASSWORD
KEYSTONE_PUBLIC_SERVICE_HOST=$KEYSTONE_PUBLIC_SERVICE_HOST
MARIADB_SERVICE_HOST=$HOST_IP
MARIADB_ROOT_PASSWORD=$MARIADB_ROOT_PASSWORD
NETWORK_MANAGER=nova
NETWORK_MANAGER=$NETWORK_MANAGER
NOVA_API_SERVICE_HOST=$NOVA_API_SERVICE_HOST
ENABLED_APIS=$ENABLED_APIS
METADATA_HOST=$METADATA_HOST
@ -144,6 +157,14 @@ NOVA_EC2_API_SERVICE_HOST=$NOVA_EC2_SERVICE_HOST
NOVA_EC2_SERVICE_HOST=$NOVA_EC2_SERVICE_HOST
NOVA_KEYSTONE_PASSWORD=$NOVA_KEYSTONE_PASSWORD
NOVA_KEYSTONE_USER=$NOVA_KEYSTONE_USER
NEUTRON_SHARED_SECRET:=$NEUTRON_SHARED_SECRET
NEUTRON_DB_NAME=$NEUTRON_DB_NAME
NEUTRON_DB_USER=$NEUTRON_DB_USER
NEUTRON_DB_PASSWORD=$NEUTRON_DB_PASSWORD
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
HEAT_DB_NAME=$HEAT_DB_NAME
HEAT_DB_PASSWORD=$HEAT_DB_PASSWORD
HEAT_KEYSTONE_PASSWORD=$HEAT_KEYSTONE_PASSWORD