update for name change to Neutron
Note: Nova and Horizon are not updated until those projects have
migrated.
Change-Id: I256ef20e7caadd9c96e6dd908c5d8b69ca5c4aeb
diff --git a/HACKING.rst b/HACKING.rst
index 3fef950..dd665a2 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -110,7 +110,7 @@
* Global service configuration like ``ENABLED_SERVICES``
* Variables used by multiple services that do not have a clear owner, i.e.
``VOLUME_BACKING_FILE_SIZE`` (nova-volumes and cinder) or ``PUBLIC_NETWORK_NAME``
- (nova-network and quantum)
+ (nova-network and neutron)
* Variables that can not be cleanly declared in a project file due to
dependency ordering, i.e. the order of sourcing the project files can
not be changed for other reasons but the earlier file needs to dereference a
diff --git a/README.md b/README.md
index 905a54d..6fcd01d 100644
--- a/README.md
+++ b/README.md
@@ -104,11 +104,11 @@
Only Swift proxy server is launched in the screen session all other services are started in background and managed by `swift-init` tool.
-# Quantum
+# Neutron
Basic Setup
-In order to enable Quantum a single node setup, you'll need the following settings in your `localrc` :
+In order to enable Neutron a single node setup, you'll need the following settings in your `localrc` :
disable_service n-net
enable_service q-svc
@@ -116,13 +116,13 @@
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
- enable_service quantum
+ enable_service neutron
# Optional, to enable tempest configuration as part of devstack
enable_service tempest
Then run `stack.sh` as normal.
-devstack supports adding specific Quantum configuration flags to both the Open vSwitch and LinuxBridge plugin configuration files. To make use of this feature, the following variables are defined and can be configured in your `localrc` file:
+devstack supports adding specific Neutron configuration flags to both the Open vSwitch and LinuxBridge plugin configuration files. To make use of this feature, the following variables are defined and can be configured in your `localrc` file:
Variable Name Plugin Config File Section Modified
-------------------------------------------------------------------------------------
@@ -144,7 +144,7 @@
# Multi-Node Setup
-A more interesting setup involves running multiple compute nodes, with Quantum networks connecting VMs on different compute nodes.
+A more interesting setup involves running multiple compute nodes, with Neutron networks connecting VMs on different compute nodes.
You should run at least one "controller node", which should have a `stackrc` that includes at least:
disable_service n-net
@@ -153,7 +153,7 @@
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
- enable_service quantum
+ enable_service neutron
You likely want to change your `localrc` to run a scheduler that will balance VMs across hosts:
@@ -161,7 +161,7 @@
You can then run many compute nodes, each of which should have a `stackrc` which includes the following, with the IP address of the above controller node:
- ENABLED_SERVICES=n-cpu,rabbit,g-api,quantum,q-agt
+ ENABLED_SERVICES=n-cpu,rabbit,g-api,neutron,q-agt
SERVICE_HOST=[IP of controller node]
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
diff --git a/clean.sh b/clean.sh
index 758947a..493c449 100755
--- a/clean.sh
+++ b/clean.sh
@@ -42,7 +42,7 @@
source $TOP_DIR/lib/swift
source $TOP_DIR/lib/ceilometer
source $TOP_DIR/lib/heat
-source $TOP_DIR/lib/quantum
+source $TOP_DIR/lib/neutron
source $TOP_DIR/lib/baremetal
source $TOP_DIR/lib/ldap
@@ -60,7 +60,7 @@
cleanup_glance
cleanup_keystone
cleanup_nova
-cleanup_quantum
+cleanup_neutron
cleanup_swift
# cinder doesn't always clean up the volume group as it might be used elsewhere...
diff --git a/exercises/boot_from_volume.sh b/exercises/boot_from_volume.sh
index 358b3d2..1814732 100755
--- a/exercises/boot_from_volume.sh
+++ b/exercises/boot_from_volume.sh
@@ -32,9 +32,9 @@
# Import configuration
source $TOP_DIR/openrc
-# Import quantum functions if needed
-if is_service_enabled quantum; then
- source $TOP_DIR/lib/quantum
+# Import neutron functions if needed
+if is_service_enabled neutron; then
+ source $TOP_DIR/lib/neutron
fi
# Import exercise configuration
diff --git a/exercises/euca.sh b/exercises/euca.sh
index ac21b6b..eec8636 100755
--- a/exercises/euca.sh
+++ b/exercises/euca.sh
@@ -33,9 +33,9 @@
# Import EC2 configuration
source $TOP_DIR/eucarc
-# Import quantum functions if needed
-if is_service_enabled quantum; then
- source $TOP_DIR/lib/quantum
+# Import neutron functions if needed
+if is_service_enabled neutron; then
+ source $TOP_DIR/lib/neutron
fi
# Import exercise configuration
diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh
index b741efb..b22ef11 100755
--- a/exercises/floating_ips.sh
+++ b/exercises/floating_ips.sh
@@ -30,9 +30,9 @@
# Import configuration
source $TOP_DIR/openrc
-# Import quantum functions if needed
-if is_service_enabled quantum; then
- source $TOP_DIR/lib/quantum
+# Import neutron functions if needed
+if is_service_enabled neutron; then
+ source $TOP_DIR/lib/neutron
fi
# Import exercise configuration
@@ -155,7 +155,7 @@
# Test we can ping our floating IP within ASSOCIATE_TIMEOUT seconds
ping_check "$PUBLIC_NETWORK_NAME" $FLOATING_IP $ASSOCIATE_TIMEOUT
-if ! is_service_enabled quantum; then
+if ! is_service_enabled neutron; then
# Allocate an IP from second floating pool
TEST_FLOATING_IP=$(nova floating-ip-create $TEST_FLOATING_POOL | grep $TEST_FLOATING_POOL | get_field 1)
die_if_not_set $LINENO TEST_FLOATING_IP "Failure creating floating IP in $TEST_FLOATING_POOL"
@@ -179,7 +179,7 @@
# Clean up
# --------
-if ! is_service_enabled quantum; then
+if ! is_service_enabled neutron; then
# Delete second floating IP
nova floating-ip-delete $TEST_FLOATING_IP || \
die $LINENO "Failure deleting floating IP $TEST_FLOATING_IP"
diff --git a/exercises/quantum-adv-test.sh b/exercises/quantum-adv-test.sh
index abec5e4..4367e2e 100755
--- a/exercises/quantum-adv-test.sh
+++ b/exercises/quantum-adv-test.sh
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
#
-# **quantum-adv-test.sh**
+# **neutron-adv-test.sh**
-# Perform integration testing of Nova and other components with Quantum.
+# Perform integration testing of Nova and other components with Neutron.
echo "*********************************************************************"
echo "Begin DevStack Exercise: $0"
@@ -43,16 +43,16 @@
# Import configuration
source $TOP_DIR/openrc
-# Import quantum functions
-source $TOP_DIR/lib/quantum
+# Import neutron functions
+source $TOP_DIR/lib/neutron
-# If quantum is not enabled we exit with exitcode 55, which means exercise is skipped.
-quantum_plugin_check_adv_test_requirements || exit 55
+# If neutron is not enabled we exit with exitcode 55, which means exercise is skipped.
+neutron_plugin_check_adv_test_requirements || exit 55
# Import exercise configuration
source $TOP_DIR/exerciserc
-# Quantum Settings
+# Neutron Settings
# ----------------
TENANTS="DEMO1"
@@ -161,7 +161,7 @@
function get_network_id {
local NETWORK_NAME="$1"
- local NETWORK_ID=`quantum net-list -F id -- --name=$NETWORK_NAME | awk "NR==4" | awk '{print $2}'`
+ local NETWORK_ID=`neutron net-list -F id -- --name=$NETWORK_NAME | awk "NR==4" | awk '{print $2}'`
echo $NETWORK_ID
}
@@ -232,9 +232,9 @@
source $TOP_DIR/openrc admin admin
local TENANT_ID=$(get_tenant_id $TENANT)
source $TOP_DIR/openrc $TENANT $TENANT
- local NET_ID=$(quantum net-create --tenant_id $TENANT_ID $NET_NAME $EXTRA| grep ' id ' | awk '{print $4}' )
- quantum subnet-create --ip_version 4 --tenant_id $TENANT_ID --gateway $GATEWAY $NET_ID $CIDR
- quantum-debug probe-create --device-owner compute $NET_ID
+ local NET_ID=$(neutron net-create --tenant_id $TENANT_ID $NET_NAME $EXTRA| grep ' id ' | awk '{print $4}' )
+ neutron subnet-create --ip_version 4 --tenant_id $TENANT_ID --gateway $GATEWAY $NET_ID $CIDR
+ neutron-debug probe-create --device-owner compute $NET_ID
source $TOP_DIR/openrc demo demo
}
@@ -320,10 +320,10 @@
local TENANT_ID=$(get_tenant_id $TENANT)
#TODO(nati) comment out until l3-agent merged
#for res in port subnet net router;do
- for net_id in `quantum net-list -c id -c name | grep $NET_NAME | awk '{print $2}'`;do
+ for net_id in `neutron net-list -c id -c name | grep $NET_NAME | awk '{print $2}'`;do
delete_probe $net_id
- quantum subnet-list | grep $net_id | awk '{print $2}' | xargs -I% quantum subnet-delete %
- quantum net-delete $net_id
+ neutron subnet-list | grep $net_id | awk '{print $2}' | xargs -I% neutron subnet-delete %
+ neutron net-delete $net_id
done
source $TOP_DIR/openrc demo demo
}
diff --git a/exercises/volumes.sh b/exercises/volumes.sh
index 7913641..f574bb3 100755
--- a/exercises/volumes.sh
+++ b/exercises/volumes.sh
@@ -30,9 +30,9 @@
# Import configuration
source $TOP_DIR/openrc
-# Import quantum functions if needed
-if is_service_enabled quantum; then
- source $TOP_DIR/lib/quantum
+# Import neutron functions if needed
+if is_service_enabled neutron; then
+ source $TOP_DIR/lib/neutron
fi
# Import exercise configuration
diff --git a/functions b/functions
index 06d7e7b..c461ca2 100644
--- a/functions
+++ b/functions
@@ -262,8 +262,8 @@
file_to_parse="${file_to_parse} keystone"
fi
elif [[ $service == q-* ]]; then
- if [[ ! $file_to_parse =~ quantum ]]; then
- file_to_parse="${file_to_parse} quantum"
+ if [[ ! $file_to_parse =~ neutron ]]; then
+ file_to_parse="${file_to_parse} neutron"
fi
fi
done
@@ -717,7 +717,7 @@
# **cinder** returns true if any service enabled start with **c-**
# **ceilometer** returns true if any service enabled start with **ceilometer**
# **glance** returns true if any service enabled start with **g-**
-# **quantum** returns true if any service enabled start with **q-**
+# **neutron** returns true if any service enabled start with **q-**
# **swift** returns true if any service enabled start with **s-**
# For backward compatibility if we have **swift** in ENABLED_SERVICES all the
# **s-** services will be enabled. This will be deprecated in the future.
@@ -732,7 +732,7 @@
[[ ${service} == "cinder" && ${ENABLED_SERVICES} =~ "c-" ]] && return 0
[[ ${service} == "ceilometer" && ${ENABLED_SERVICES} =~ "ceilometer-" ]] && return 0
[[ ${service} == "glance" && ${ENABLED_SERVICES} =~ "g-" ]] && return 0
- [[ ${service} == "quantum" && ${ENABLED_SERVICES} =~ "q-" ]] && return 0
+ [[ ${service} == "neutron" && ${ENABLED_SERVICES} =~ "q-" ]] && return 0
[[ ${service} == "swift" && ${ENABLED_SERVICES} =~ "s-" ]] && return 0
[[ ${service} == s-* && ${ENABLED_SERVICES} =~ "swift" ]] && return 0
done
@@ -758,7 +758,7 @@
# enable_service qpid
#
# This function does not know about the special cases
-# for nova, glance, and quantum built into is_service_enabled().
+# for nova, glance, and neutron built into is_service_enabled().
# Uses global ``ENABLED_SERVICES``
# enable_service service [service ...]
function enable_service() {
@@ -780,7 +780,7 @@
# disable_service rabbit
#
# This function does not know about the special cases
-# for nova, glance, and quantum built into is_service_enabled().
+# for nova, glance, and neutron built into is_service_enabled().
# Uses global ``ENABLED_SERVICES``
# disable_service service [service ...]
function disable_service() {
@@ -1330,8 +1330,8 @@
# Uses globals ``ENABLED_SERVICES``
# ping_check from-net ip boot-timeout expected
function ping_check() {
- if is_service_enabled quantum; then
- _ping_check_quantum "$1" $2 $3 $4
+ if is_service_enabled neutron; then
+ _ping_check_neutron "$1" $2 $3 $4
return
fi
_ping_check_novanet "$1" $2 $3 $4
@@ -1370,8 +1370,8 @@
# ssh_check net-name key-file floating-ip default-user active-timeout
function ssh_check() {
- if is_service_enabled quantum; then
- _ssh_check_quantum "$1" $2 $3 $4 $5
+ if is_service_enabled neutron; then
+ _ssh_check_neutron "$1" $2 $3 $4 $5
return
fi
_ssh_check_novanet "$1" $2 $3 $4 $5
diff --git a/lib/keystone b/lib/keystone
index 2edd137..4b93992 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -151,12 +151,12 @@
echo "catalog.RegionOne.object_store.name = Swift Service" >> $KEYSTONE_CATALOG
fi
- # Add quantum endpoints to service catalog if quantum is enabled
- if is_service_enabled quantum; then
+ # Add neutron endpoints to service catalog if neutron is enabled
+ if is_service_enabled neutron; then
echo "catalog.RegionOne.network.publicURL = http://%SERVICE_HOST%:$Q_PORT/" >> $KEYSTONE_CATALOG
echo "catalog.RegionOne.network.adminURL = http://%SERVICE_HOST%:$Q_PORT/" >> $KEYSTONE_CATALOG
echo "catalog.RegionOne.network.internalURL = http://%SERVICE_HOST%:$Q_PORT/" >> $KEYSTONE_CATALOG
- echo "catalog.RegionOne.network.name = Quantum Service" >> $KEYSTONE_CATALOG
+ echo "catalog.RegionOne.network.name = Neutron Service" >> $KEYSTONE_CATALOG
fi
sed -e "
diff --git a/lib/neutron b/lib/neutron
new file mode 100644
index 0000000..c28bd28
--- /dev/null
+++ b/lib/neutron
@@ -0,0 +1,815 @@
+# lib/neutron
+# functions - funstions specific to neutron
+
+# Dependencies:
+# ``functions`` file
+# ``DEST`` must be defined
+
+# ``stack.sh`` calls the entry points in this order:
+#
+# install_neutron
+# install_neutronclient
+# install_neutron_agent_packages
+# install_neutron_third_party
+# configure_neutron
+# init_neutron
+# configure_neutron_third_party
+# init_neutron_third_party
+# start_neutron_third_party
+# create_nova_conf_neutron
+# start_neutron_service_and_check
+# create_neutron_initial_network
+# setup_neutron_debug
+# start_neutron_agents
+#
+# ``unstack.sh`` calls the entry points in this order:
+#
+# stop_neutron
+
+# Functions in lib/neutron are classified into the following categories:
+#
+# - entry points (called from stack.sh or unstack.sh)
+# - internal functions
+# - neutron exercises
+# - 3rd party programs
+
+
+# Neutron Networking
+# ------------------
+
+# Make sure that neutron is enabled in ``ENABLED_SERVICES``. If you want
+# to run Neutron on this host, make sure that q-svc is also in
+# ``ENABLED_SERVICES``.
+#
+# If you're planning to use the Neutron openvswitch plugin, set
+# ``Q_PLUGIN`` to "openvswitch" and make sure the q-agt service is enabled
+# in ``ENABLED_SERVICES``. If you're planning to use the Neutron
+# linuxbridge plugin, set ``Q_PLUGIN`` to "linuxbridge" and make sure the
+# q-agt service is enabled in ``ENABLED_SERVICES``.
+#
+# See "Neutron Network Configuration" below for additional variables
+# that must be set in localrc for connectivity across hosts with
+# Neutron.
+#
+# With Neutron networking the NETWORK_MANAGER variable is ignored.
+#
+# To enable specific configuration options for either the Open vSwitch or
+# LinuxBridge plugin, please see the top level README file under the
+# Neutron section.
+
+# Save trace setting
+XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+
+# Neutron Network Configuration
+# -----------------------------
+
+# Gateway and subnet defaults, in case they are not customized in localrc
+NETWORK_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
+PUBLIC_NETWORK_GATEWAY=${PUBLIC_NETWORK_GATEWAY:-172.24.4.225}
+PRIVATE_SUBNET_NAME=${PRIVATE_SUBNET_NAME:-"private-subnet"}
+PUBLIC_SUBNET_NAME=${PUBLIC_SUBNET_NAME:-"public-subnet"}
+
+# Set up default directories
+NEUTRON_DIR=$DEST/neutron
+NEUTRONCLIENT_DIR=$DEST/python-neutronclient
+NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron}
+
+# Support entry points installation of console scripts
+if [[ -d $NEUTRON_DIR/bin/neutron-server ]]; then
+ NEUTRON_BIN_DIR=$NEUTRON_DIR/bin
+ else
+NEUTRON_BIN_DIR=$(get_python_exec_prefix)
+fi
+
+NEUTRON_CONF_DIR=/etc/neutron
+NEUTRON_CONF=$NEUTRON_CONF_DIR/neutron.conf
+export NEUTRON_TEST_CONFIG_FILE=${NEUTRON_TEST_CONFIG_FILE:-"$NEUTRON_CONF_DIR/debug.ini"}
+
+# Default Neutron Plugin
+Q_PLUGIN=${Q_PLUGIN:-openvswitch}
+# Default Neutron Port
+Q_PORT=${Q_PORT:-9696}
+# Default Neutron Host
+Q_HOST=${Q_HOST:-$SERVICE_HOST}
+# Default admin username
+Q_ADMIN_USERNAME=${Q_ADMIN_USERNAME:-neutron}
+# Default auth strategy
+Q_AUTH_STRATEGY=${Q_AUTH_STRATEGY:-keystone}
+# Use namespace or not
+Q_USE_NAMESPACE=${Q_USE_NAMESPACE:-True}
+# RHEL's support for namespaces requires using veths with ovs
+Q_OVS_USE_VETH=${Q_OVS_USE_VETH:-False}
+Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP:-True}
+# Meta data IP
+Q_META_DATA_IP=${Q_META_DATA_IP:-$SERVICE_HOST}
+# Allow Overlapping IP among subnets
+Q_ALLOW_OVERLAPPING_IP=${Q_ALLOW_OVERLAPPING_IP:-True}
+# Use neutron-debug command
+Q_USE_DEBUG_COMMAND=${Q_USE_DEBUG_COMMAND:-False}
+# The name of the default q-l3 router
+Q_ROUTER_NAME=${Q_ROUTER_NAME:-router1}
+# List of config file names in addition to the main plugin config file
+# See _configure_neutron_common() for details about setting it up
+declare -a Q_PLUGIN_EXTRA_CONF_FILES
+
+if is_service_enabled neutron; then
+ Q_RR_CONF_FILE=$NEUTRON_CONF_DIR/rootwrap.conf
+ if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
+ Q_RR_COMMAND="sudo"
+ else
+ NEUTRON_ROOTWRAP=$(get_rootwrap_location neutron)
+ Q_RR_COMMAND="sudo $NEUTRON_ROOTWRAP $Q_RR_CONF_FILE"
+ fi
+
+ # Provider Network Configurations
+ # --------------------------------
+
+ # The following variables control the Neutron openvswitch and
+ # linuxbridge plugins' allocation of tenant networks and
+ # availability of provider networks. If these are not configured
+ # in ``localrc``, tenant networks will be local to the host (with no
+ # remote connectivity), and no physical resources will be
+ # available for the allocation of provider networks.
+
+ # To use GRE tunnels for tenant networks, set to True in
+ # ``localrc``. GRE tunnels are only supported by the openvswitch
+ # plugin, and currently only on Ubuntu.
+ ENABLE_TENANT_TUNNELS=${ENABLE_TENANT_TUNNELS:-False}
+
+ # If using GRE tunnels for tenant networks, specify the range of
+ # tunnel IDs from which tenant networks are allocated. Can be
+ # overriden in ``localrc`` in necesssary.
+ TENANT_TUNNEL_RANGES=${TENANT_TUNNEL_RANGE:-1:1000}
+
+ # To use VLANs for tenant networks, set to True in localrc. VLANs
+ # are supported by the openvswitch and linuxbridge plugins, each
+ # requiring additional configuration described below.
+ ENABLE_TENANT_VLANS=${ENABLE_TENANT_VLANS:-False}
+
+ # If using VLANs for tenant networks, set in ``localrc`` to specify
+ # the range of VLAN VIDs from which tenant networks are
+ # allocated. An external network switch must be configured to
+ # trunk these VLANs between hosts for multi-host connectivity.
+ #
+ # Example: ``TENANT_VLAN_RANGE=1000:1999``
+ TENANT_VLAN_RANGE=${TENANT_VLAN_RANGE:-}
+
+ # If using VLANs for tenant networks, or if using flat or VLAN
+ # provider networks, set in ``localrc`` to the name of the physical
+ # network, and also configure ``OVS_PHYSICAL_BRIDGE`` for the
+ # openvswitch agent or ``LB_PHYSICAL_INTERFACE`` for the linuxbridge
+ # agent, as described below.
+ #
+ # Example: ``PHYSICAL_NETWORK=default``
+ PHYSICAL_NETWORK=${PHYSICAL_NETWORK:-}
+
+ # With the openvswitch plugin, if using VLANs for tenant networks,
+ # or if using flat or VLAN provider networks, set in ``localrc`` to
+ # the name of the OVS bridge to use for the physical network. The
+ # bridge will be created if it does not already exist, but a
+ # physical interface must be manually added to the bridge as a
+ # port for external connectivity.
+ #
+ # Example: ``OVS_PHYSICAL_BRIDGE=br-eth1``
+ OVS_PHYSICAL_BRIDGE=${OVS_PHYSICAL_BRIDGE:-}
+
+ # With the linuxbridge plugin, if using VLANs for tenant networks,
+ # or if using flat or VLAN provider networks, set in ``localrc`` to
+ # the name of the network interface to use for the physical
+ # network.
+ #
+ # Example: ``LB_PHYSICAL_INTERFACE=eth1``
+ LB_PHYSICAL_INTERFACE=${LB_PHYSICAL_INTERFACE:-}
+
+ # With the openvswitch plugin, set to True in ``localrc`` to enable
+ # provider GRE tunnels when ``ENABLE_TENANT_TUNNELS`` is False.
+ #
+ # Example: ``OVS_ENABLE_TUNNELING=True``
+ OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-$ENABLE_TENANT_TUNNELS}
+fi
+
+# Neutron plugin specific functions
+# ---------------------------------
+
+# Please refer to ``lib/neutron_plugins/README.md`` for details.
+source $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN
+
+# Agent loadbalancer service plugin functions
+# -------------------------------------------
+
+# Hardcoding for 1 service plugin for now
+source $TOP_DIR/lib/neutron_plugins/services/loadbalancer
+
+# Use security group or not
+if has_neutron_plugin_security_group; then
+ Q_USE_SECGROUP=${Q_USE_SECGROUP:-True}
+else
+ Q_USE_SECGROUP=False
+fi
+
+# Functions
+# ---------
+
+# configure_neutron()
+# Set common config for all neutron server and agents.
+function configure_neutron() {
+ _configure_neutron_common
+ iniset_rpc_backend neutron $NEUTRON_CONF DEFAULT
+
+ # goes before q-svc to init Q_SERVICE_PLUGIN_CLASSES
+ if is_service_enabled q-lbaas; then
+ _configure_neutron_lbaas
+ fi
+ if is_service_enabled q-svc; then
+ _configure_neutron_service
+ fi
+ if is_service_enabled q-agt; then
+ _configure_neutron_plugin_agent
+ fi
+ if is_service_enabled q-dhcp; then
+ _configure_neutron_dhcp_agent
+ fi
+ if is_service_enabled q-l3; then
+ _configure_neutron_l3_agent
+ fi
+ if is_service_enabled q-meta; then
+ _configure_neutron_metadata_agent
+ fi
+
+ _configure_neutron_debug_command
+}
+
+function create_nova_conf_neutron() {
+ iniset $NOVA_CONF DEFAULT network_api_class "nova.network.quantumv2.api.API"
+ iniset $NOVA_CONF DEFAULT quantum_admin_username "$Q_ADMIN_USERNAME"
+ iniset $NOVA_CONF DEFAULT quantum_admin_password "$SERVICE_PASSWORD"
+ iniset $NOVA_CONF DEFAULT quantum_admin_auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0"
+ iniset $NOVA_CONF DEFAULT quantum_auth_strategy "$Q_AUTH_STRATEGY"
+ iniset $NOVA_CONF DEFAULT quantum_admin_tenant_name "$SERVICE_TENANT_NAME"
+ iniset $NOVA_CONF DEFAULT quantum_url "http://$Q_HOST:$Q_PORT"
+
+ if [[ "$Q_USE_SECGROUP" == "True" ]]; then
+ LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver
+ iniset $NOVA_CONF DEFAULT security_group_api quantum
+ fi
+
+ # set NOVA_VIF_DRIVER and optionally set options in nova_conf
+ neutron_plugin_create_nova_conf
+
+ iniset $NOVA_CONF DEFAULT libvirt_vif_driver "$NOVA_VIF_DRIVER"
+ iniset $NOVA_CONF DEFAULT linuxnet_interface_driver "$LINUXNET_VIF_DRIVER"
+ if is_service_enabled q-meta; then
+ iniset $NOVA_CONF DEFAULT service_quantum_metadata_proxy "True"
+ fi
+}
+
+# create_neutron_accounts() - Set up common required neutron accounts
+
+# Tenant User Roles
+# ------------------------------------------------------------------
+# service neutron admin # if enabled
+
+# Migrated from keystone_data.sh
+function create_neutron_accounts() {
+
+ SERVICE_TENANT=$(keystone tenant-list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
+ ADMIN_ROLE=$(keystone role-list | awk "/ admin / { print \$2 }")
+
+ if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then
+ NEUTRON_USER=$(keystone user-create \
+ --name=neutron \
+ --pass="$SERVICE_PASSWORD" \
+ --tenant_id $SERVICE_TENANT \
+ --email=neutron@example.com \
+ | grep " id " | get_field 2)
+ keystone user-role-add \
+ --tenant_id $SERVICE_TENANT \
+ --user_id $NEUTRON_USER \
+ --role_id $ADMIN_ROLE
+ if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
+ NEUTRON_SERVICE=$(keystone service-create \
+ --name=neutron \
+ --type=network \
+ --description="Neutron Service" \
+ | grep " id " | get_field 2)
+ keystone endpoint-create \
+ --region RegionOne \
+ --service_id $NEUTRON_SERVICE \
+ --publicurl "http://$SERVICE_HOST:9696/" \
+ --adminurl "http://$SERVICE_HOST:9696/" \
+ --internalurl "http://$SERVICE_HOST:9696/"
+ fi
+ fi
+}
+
+function create_neutron_initial_network() {
+ TENANT_ID=$(keystone tenant-list | grep " demo " | get_field 1)
+
+ # Create a small network
+ # Since neutron command is executed in admin context at this point,
+ # ``--tenant_id`` needs to be specified.
+ if is_baremetal; then
+ sudo ovs-vsctl add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE
+ for IP in $(ip addr show dev $PUBLIC_INTERFACE | grep ' inet ' | awk '{print $2}'); do
+ sudo ip addr del $IP dev $PUBLIC_INTERFACE
+ sudo ip addr add $IP dev $OVS_PHYSICAL_BRIDGE
+ done
+ NET_ID=$(neutron net-create $PHYSICAL_NETWORK --tenant_id $TENANT_ID --provider:network_type flat --provider:physical_network "$PHYSICAL_NETWORK" | grep ' id ' | get_field 2)
+ SUBNET_ID=$(neutron subnet-create --tenant_id $TENANT_ID --ip_version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} --gateway $NETWORK_GATEWAY --name $PRIVATE_SUBNET_NAME $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
+ sudo ifconfig $OVS_PHYSICAL_BRIDGE up
+ else
+ NET_ID=$(neutron net-create --tenant_id $TENANT_ID "$PRIVATE_NETWORK_NAME" | grep ' id ' | get_field 2)
+ SUBNET_ID=$(neutron subnet-create --tenant_id $TENANT_ID --ip_version 4 --gateway $NETWORK_GATEWAY --name $PRIVATE_SUBNET_NAME $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
+ fi
+
+ if [[ "$Q_L3_ENABLED" == "True" ]]; then
+ # Create a router, and add the private subnet as one of its interfaces
+ if [[ "$Q_L3_ROUTER_PER_TENANT" == "True" ]]; then
+ # create a tenant-owned router.
+ ROUTER_ID=$(neutron router-create --tenant_id $TENANT_ID $Q_ROUTER_NAME | grep ' id ' | get_field 2)
+ else
+ # Plugin only supports creating a single router, which should be admin owned.
+ ROUTER_ID=$(neutron router-create $Q_ROUTER_NAME | grep ' id ' | get_field 2)
+ fi
+ neutron router-interface-add $ROUTER_ID $SUBNET_ID
+ # Create an external network, and a subnet. Configure the external network as router gw
+ EXT_NET_ID=$(neutron net-create "$PUBLIC_NETWORK_NAME" -- --router:external=True | grep ' id ' | get_field 2)
+ EXT_GW_IP=$(neutron subnet-create --ip_version 4 ${Q_FLOATING_ALLOCATION_POOL:+--allocation-pool $Q_FLOATING_ALLOCATION_POOL} --gateway $PUBLIC_NETWORK_GATEWAY --name $PUBLIC_SUBNET_NAME $EXT_NET_ID $FLOATING_RANGE -- --enable_dhcp=False | grep 'gateway_ip' | get_field 2)
+ neutron router-gateway-set $ROUTER_ID $EXT_NET_ID
+
+ if is_service_enabled q-l3; then
+ # logic is specific to using the l3-agent for l3
+ if is_neutron_ovs_base_plugin && [[ "$Q_USE_NAMESPACE" = "True" ]]; then
+ CIDR_LEN=${FLOATING_RANGE#*/}
+ sudo ip addr add $EXT_GW_IP/$CIDR_LEN dev $PUBLIC_BRIDGE
+ sudo ip link set $PUBLIC_BRIDGE up
+ ROUTER_GW_IP=`neutron port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F '"' '{ print $8; }'`
+ sudo route add -net $FIXED_RANGE gw $ROUTER_GW_IP
+ fi
+ if [[ "$Q_USE_NAMESPACE" == "False" ]]; then
+ # Explicitly set router id in l3 agent configuration
+ iniset $Q_L3_CONF_FILE DEFAULT router_id $ROUTER_ID
+ fi
+ fi
+ fi
+}
+
+# init_neutron() - Initialize databases, etc.
+function init_neutron() {
+ :
+}
+
+# install_neutron() - Collect source and prepare
+function install_neutron() {
+ git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH
+ setup_develop $NEUTRON_DIR
+}
+
+# install_neutronclient() - Collect source and prepare
+function install_neutronclient() {
+ git_clone $NEUTRONCLIENT_REPO $NEUTRONCLIENT_DIR $NEUTRONCLIENT_BRANCH
+ setup_develop $NEUTRONCLIENT_DIR
+}
+
+# install_neutron_agent_packages() - Collect source and prepare
+function install_neutron_agent_packages() {
+ # install packages that are specific to plugin agent(s)
+ if is_service_enabled q-agt q-dhcp q-l3; then
+ neutron_plugin_install_agent_packages
+ fi
+
+ if is_service_enabled q-lbaas; then
+ neutron_agent_lbaas_install_agent_packages
+ fi
+}
+
+# Start running processes, including screen
+function start_neutron_service_and_check() {
+ # build config-file options
+ local cfg_file
+ local CFG_FILE_OPTIONS="--config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE"
+ for cfg_file in ${Q_PLUGIN_EXTRA_CONF_FILES[@]}; do
+ CFG_FILE_OPTIONS+=" --config-file /$cfg_file"
+ done
+ # Start the Neutron service
+ screen_it q-svc "cd $NEUTRON_DIR && python $NEUTRON_BIN_DIR/neutron-server $CFG_FILE_OPTIONS"
+ echo "Waiting for Neutron to start..."
+ if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://$Q_HOST:$Q_PORT; do sleep 1; done"; then
+ die $LINENO "Neutron did not start"
+ fi
+}
+
+# Start running processes, including screen
+function start_neutron_agents() {
+ # Start up the neutron agents if enabled
+ screen_it q-agt "cd $NEUTRON_DIR && python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE"
+ screen_it q-dhcp "cd $NEUTRON_DIR && python $AGENT_DHCP_BINARY --config-file $NEUTRON_CONF --config-file=$Q_DHCP_CONF_FILE"
+ screen_it q-l3 "cd $NEUTRON_DIR && python $AGENT_L3_BINARY --config-file $NEUTRON_CONF --config-file=$Q_L3_CONF_FILE"
+ screen_it q-meta "cd $NEUTRON_DIR && python $AGENT_META_BINARY --config-file $NEUTRON_CONF --config-file=$Q_META_CONF_FILE"
+
+ if [ "$VIRT_DRIVER" = 'xenserver' ]; then
+ # For XenServer, start an agent for the domU openvswitch
+ screen_it q-domua "cd $NEUTRON_DIR && python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE.domU"
+ fi
+
+ if is_service_enabled q-lbaas; then
+ screen_it q-lbaas "cd $NEUTRON_DIR && python $AGENT_LBAAS_BINARY --config-file $NEUTRON_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME"
+ fi
+}
+
+# stop_neutron() - Stop running processes (non-screen)
+function stop_neutron() {
+ if is_service_enabled q-dhcp; then
+ pid=$(ps aux | awk '/[d]nsmasq.+interface=(tap|ns-)/ { print $2 }')
+ [ ! -z "$pid" ] && sudo kill -9 $pid
+ fi
+ if is_service_enabled q-meta; then
+ pid=$(ps aux | awk '/neutron-ns-metadata-proxy/ { print $2 }')
+ [ ! -z "$pid" ] && sudo kill -9 $pid
+ fi
+}
+
+# cleanup_neutron() - Remove residual data files, anything left over from previous
+# runs that a clean run would need to clean up
+function cleanup_neutron() {
+ if is_neutron_ovs_base_plugin; then
+ neutron_ovs_base_cleanup
+ fi
+
+ # delete all namespaces created by neutron
+ for ns in $(sudo ip netns list | grep -o -e qdhcp-[0-9a-f\-]* -e qrouter-[0-9a-f\-]*); do
+ sudo ip netns delete ${ns}
+ done
+}
+
+# _configure_neutron_common()
+# Set common config for all neutron server and agents.
+# This MUST be called before other ``_configure_neutron_*`` functions.
+function _configure_neutron_common() {
+ # Put config files in ``NEUTRON_CONF_DIR`` for everyone to find
+ if [[ ! -d $NEUTRON_CONF_DIR ]]; then
+ sudo mkdir -p $NEUTRON_CONF_DIR
+ fi
+ sudo chown $STACK_USER $NEUTRON_CONF_DIR
+
+ cp $NEUTRON_DIR/etc/neutron.conf $NEUTRON_CONF
+
+ # Set plugin-specific variables ``Q_DB_NAME``, ``Q_PLUGIN_CLASS``.
+ # For main plugin config file, set ``Q_PLUGIN_CONF_PATH``, ``Q_PLUGIN_CONF_FILENAME``.
+ # For addition plugin config files, set ``Q_PLUGIN_EXTRA_CONF_PATH``,
+ # ``Q_PLUGIN_EXTRA_CONF_FILES``. For example:
+ # ``Q_PLUGIN_EXTRA_CONF_FILES=(file1, file2)``
+ neutron_plugin_configure_common
+
+ if [[ $Q_PLUGIN_CONF_PATH == '' || $Q_PLUGIN_CONF_FILENAME == '' || $Q_PLUGIN_CLASS == '' ]]; then
+ die $LINENO "Neutron plugin not set.. exiting"
+ fi
+
+ # If needed, move config file from ``$NEUTRON_DIR/etc/neutron`` to ``NEUTRON_CONF_DIR``
+ mkdir -p /$Q_PLUGIN_CONF_PATH
+ Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME
+ cp $NEUTRON_DIR/$Q_PLUGIN_CONF_FILE /$Q_PLUGIN_CONF_FILE
+
+ iniset /$Q_PLUGIN_CONF_FILE database connection `database_connection_url $Q_DB_NAME`
+ iniset $NEUTRON_CONF DEFAULT state_path $DATA_DIR/neutron
+
+ # If addition config files are set, make sure their path name is set as well
+ if [[ ${#Q_PLUGIN_EXTRA_CONF_FILES[@]} > 0 && $Q_PLUGIN_EXTRA_CONF_PATH == '' ]]; then
+ die $LINENO "Neutron additional plugin config not set.. exiting"
+ fi
+
+ # If additional config files exist, copy them over to neutron configuration
+ # directory
+ if [[ $Q_PLUGIN_EXTRA_CONF_PATH != '' ]]; then
+ mkdir -p /$Q_PLUGIN_EXTRA_CONF_PATH
+ local f
+ for (( f=0; $f < ${#Q_PLUGIN_EXTRA_CONF_FILES[@]}; f+=1 )); do
+ Q_PLUGIN_EXTRA_CONF_FILES[$f]=$Q_PLUGIN_EXTRA_CONF_PATH/${Q_PLUGIN_EXTRA_CONF_FILES[$f]}
+ cp $NEUTRON_DIR/${Q_PLUGIN_EXTRA_CONF_FILES[$f]} /${Q_PLUGIN_EXTRA_CONF_FILES[$f]}
+ done
+ fi
+
+ _neutron_setup_rootwrap
+}
+
+function _configure_neutron_debug_command() {
+ if [[ "$Q_USE_DEBUG_COMMAND" != "True" ]]; then
+ return
+ fi
+
+ cp $NEUTRON_DIR/etc/l3_agent.ini $NEUTRON_TEST_CONFIG_FILE
+
+ iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT verbose False
+ iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT debug False
+ iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
+ iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT root_helper "$Q_RR_COMMAND"
+ # Intermediate fix until Neutron patch lands and then line above will
+ # be cleaned.
+ iniset $NEUTRON_TEST_CONFIG_FILE agent root_helper "$Q_RR_COMMAND"
+
+ _neutron_setup_keystone $NEUTRON_TEST_CONFIG_FILE DEFAULT set_auth_url
+ _neutron_setup_interface_driver $NEUTRON_TEST_CONFIG_FILE
+
+ neutron_plugin_configure_debug_command
+}
+
+function _configure_neutron_dhcp_agent() {
+ AGENT_DHCP_BINARY="$NEUTRON_BIN_DIR/neutron-dhcp-agent"
+ Q_DHCP_CONF_FILE=$NEUTRON_CONF_DIR/dhcp_agent.ini
+
+ cp $NEUTRON_DIR/etc/dhcp_agent.ini $Q_DHCP_CONF_FILE
+
+ iniset $Q_DHCP_CONF_FILE DEFAULT verbose True
+ iniset $Q_DHCP_CONF_FILE DEFAULT debug True
+ iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
+ iniset $Q_DHCP_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
+
+ _neutron_setup_keystone $Q_DHCP_CONF_FILE DEFAULT set_auth_url
+ _neutron_setup_interface_driver $Q_DHCP_CONF_FILE
+
+ neutron_plugin_configure_dhcp_agent
+}
+
+function _configure_neutron_l3_agent() {
+ Q_L3_ENABLED=True
+ # for l3-agent, only use per tenant router if we have namespaces
+ Q_L3_ROUTER_PER_TENANT=$Q_USE_NAMESPACE
+ AGENT_L3_BINARY="$NEUTRON_BIN_DIR/neutron-l3-agent"
+ Q_L3_CONF_FILE=$NEUTRON_CONF_DIR/l3_agent.ini
+
+ cp $NEUTRON_DIR/etc/l3_agent.ini $Q_L3_CONF_FILE
+
+ iniset $Q_L3_CONF_FILE DEFAULT verbose True
+ iniset $Q_L3_CONF_FILE DEFAULT debug True
+ iniset $Q_L3_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
+ iniset $Q_L3_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
+
+ _neutron_setup_keystone $Q_L3_CONF_FILE DEFAULT set_auth_url
+ _neutron_setup_interface_driver $Q_L3_CONF_FILE
+
+ neutron_plugin_configure_l3_agent
+}
+
+function _configure_neutron_metadata_agent() {
+ AGENT_META_BINARY="$NEUTRON_BIN_DIR/neutron-metadata-agent"
+ Q_META_CONF_FILE=$NEUTRON_CONF_DIR/metadata_agent.ini
+
+ cp $NEUTRON_DIR/etc/metadata_agent.ini $Q_META_CONF_FILE
+
+ iniset $Q_META_CONF_FILE DEFAULT verbose True
+ iniset $Q_META_CONF_FILE DEFAULT debug True
+ iniset $Q_META_CONF_FILE DEFAULT nova_metadata_ip $Q_META_DATA_IP
+ iniset $Q_META_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
+
+ _neutron_setup_keystone $Q_META_CONF_FILE DEFAULT set_auth_url
+}
+
+function _configure_neutron_lbaas() {
+ neutron_agent_lbaas_configure_common
+ neutron_agent_lbaas_configure_agent
+}
+
+# _configure_neutron_plugin_agent() - Set config files for neutron plugin agent
+# It is called when q-agt is enabled.
+function _configure_neutron_plugin_agent() {
+ # Specify the default root helper prior to agent configuration to
+ # ensure that an agent's configuration can override the default
+ iniset /$Q_PLUGIN_CONF_FILE agent root_helper "$Q_RR_COMMAND"
+ iniset $NEUTRON_CONF DEFAULT verbose True
+ iniset $NEUTRON_CONF DEFAULT debug True
+
+ # Configure agent for plugin
+ neutron_plugin_configure_plugin_agent
+}
+
+# _configure_neutron_service() - Set config files for neutron service
+# It is called when q-svc is enabled.
+function _configure_neutron_service() {
+ Q_API_PASTE_FILE=$NEUTRON_CONF_DIR/api-paste.ini
+ Q_POLICY_FILE=$NEUTRON_CONF_DIR/policy.json
+
+ cp $NEUTRON_DIR/etc/api-paste.ini $Q_API_PASTE_FILE
+ cp $NEUTRON_DIR/etc/policy.json $Q_POLICY_FILE
+
+ if is_service_enabled $DATABASE_BACKENDS; then
+ recreate_database $Q_DB_NAME utf8
+ else
+ die $LINENO "A database must be enabled in order to use the $Q_PLUGIN Neutron plugin."
+ fi
+
+ # Update either configuration file with plugin
+ iniset $NEUTRON_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS
+
+ if [[ $Q_SERVICE_PLUGIN_CLASSES != '' ]]; then
+ iniset $NEUTRON_CONF DEFAULT service_plugins $Q_SERVICE_PLUGIN_CLASSES
+ fi
+
+ iniset $NEUTRON_CONF DEFAULT verbose True
+ iniset $NEUTRON_CONF DEFAULT debug True
+ iniset $NEUTRON_CONF DEFAULT policy_file $Q_POLICY_FILE
+ iniset $NEUTRON_CONF DEFAULT allow_overlapping_ips $Q_ALLOW_OVERLAPPING_IP
+
+ iniset $NEUTRON_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY
+ _neutron_setup_keystone $NEUTRON_CONF keystone_authtoken
+
+ # Configure plugin
+ neutron_plugin_configure_service
+}
+
+# Utility Functions
+#------------------
+
+# _neutron_setup_rootwrap() - configure Neutron's rootwrap
+function _neutron_setup_rootwrap() {
+ if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
+ return
+ fi
+ # Deploy new rootwrap filters files (owned by root).
+ # Wipe any existing ``rootwrap.d`` files first
+ Q_CONF_ROOTWRAP_D=$NEUTRON_CONF_DIR/rootwrap.d
+ if [[ -d $Q_CONF_ROOTWRAP_D ]]; then
+ sudo rm -rf $Q_CONF_ROOTWRAP_D
+ fi
+ # Deploy filters to ``$NEUTRON_CONF_DIR/rootwrap.d``
+ mkdir -p -m 755 $Q_CONF_ROOTWRAP_D
+ cp -pr $NEUTRON_DIR/etc/neutron/rootwrap.d/* $Q_CONF_ROOTWRAP_D/
+ sudo chown -R root:root $Q_CONF_ROOTWRAP_D
+ sudo chmod 644 $Q_CONF_ROOTWRAP_D/*
+ # Set up ``rootwrap.conf``, pointing to ``$NEUTRON_CONF_DIR/rootwrap.d``
+ # location moved in newer versions, prefer new location
+ if test -r $NEUTRON_DIR/etc/neutron/rootwrap.conf; then
+ sudo cp -p $NEUTRON_DIR/etc/neutron/rootwrap.conf $Q_RR_CONF_FILE
+ else
+ sudo cp -p $NEUTRON_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE
+ fi
+ sudo sed -e "s:^filters_path=.*$:filters_path=$Q_CONF_ROOTWRAP_D:" -i $Q_RR_CONF_FILE
+ sudo chown root:root $Q_RR_CONF_FILE
+ sudo chmod 0644 $Q_RR_CONF_FILE
+ # Specify ``rootwrap.conf`` as first parameter to neutron-rootwrap
+ ROOTWRAP_SUDOER_CMD="$NEUTRON_ROOTWRAP $Q_RR_CONF_FILE *"
+
+ # Set up the rootwrap sudoers for neutron
+ TEMPFILE=`mktemp`
+ echo "$USER ALL=(root) NOPASSWD: $ROOTWRAP_SUDOER_CMD" >$TEMPFILE
+ chmod 0440 $TEMPFILE
+ sudo chown root:root $TEMPFILE
+ sudo mv $TEMPFILE /etc/sudoers.d/neutron-rootwrap
+
+ # Update the root_helper
+ iniset $NEUTRON_CONF agent root_helper "$Q_RR_COMMAND"
+}
+
+# Configures keystone integration for neutron service and agents
+function _neutron_setup_keystone() {
+ local conf_file=$1
+ local section=$2
+ local use_auth_url=$3
+ if [[ -n $use_auth_url ]]; then
+ iniset $conf_file $section auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v2.0"
+ else
+ iniset $conf_file $section auth_host $KEYSTONE_SERVICE_HOST
+ iniset $conf_file $section auth_port $KEYSTONE_AUTH_PORT
+ iniset $conf_file $section auth_protocol $KEYSTONE_SERVICE_PROTOCOL
+ fi
+ iniset $conf_file $section admin_tenant_name $SERVICE_TENANT_NAME
+ iniset $conf_file $section admin_user $Q_ADMIN_USERNAME
+ iniset $conf_file $section admin_password $SERVICE_PASSWORD
+ iniset $conf_file $section signing_dir $NEUTRON_AUTH_CACHE_DIR
+ # Create cache dir
+ sudo mkdir -p $NEUTRON_AUTH_CACHE_DIR
+ sudo chown $STACK_USER $NEUTRON_AUTH_CACHE_DIR
+ rm -f $NEUTRON_AUTH_CACHE_DIR/*
+}
+
+function _neutron_setup_interface_driver() {
+
+ # ovs_use_veth needs to be set before the plugin configuration
+ # occurs to allow plugins to override the setting.
+ iniset $1 DEFAULT ovs_use_veth $Q_OVS_USE_VETH
+
+ neutron_plugin_setup_interface_driver $1
+}
+
+# Functions for Neutron Exercises
+#--------------------------------
+
+function delete_probe() {
+ local from_net="$1"
+ net_id=`_get_net_id $from_net`
+ probe_id=`neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}'`
+ neutron-debug --os-tenant-name admin --os-username admin probe-delete $probe_id
+}
+
+function setup_neutron_debug() {
+ if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
+ public_net_id=`_get_net_id $PUBLIC_NETWORK_NAME`
+ neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $public_net_id
+ private_net_id=`_get_net_id $PRIVATE_NETWORK_NAME`
+ neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $private_net_id
+ fi
+}
+
+function teardown_neutron_debug() {
+ delete_probe $PUBLIC_NETWORK_NAME
+ delete_probe $PRIVATE_NETWORK_NAME
+}
+
+function _get_net_id() {
+ neutron --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD net-list | grep $1 | awk '{print $2}'
+}
+
+function _get_probe_cmd_prefix() {
+ local from_net="$1"
+ net_id=`_get_net_id $from_net`
+ probe_id=`neutron-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}' | head -n 1`
+ echo "$Q_RR_COMMAND ip netns exec qprobe-$probe_id"
+}
+
+function _ping_check_neutron() {
+ local from_net=$1
+ local ip=$2
+ local timeout_sec=$3
+ local expected=${4:-"True"}
+ local check_command=""
+ probe_cmd=`_get_probe_cmd_prefix $from_net`
+ if [[ "$expected" = "True" ]]; then
+ check_command="while ! $probe_cmd ping -w 1 -c 1 $ip; do sleep 1; done"
+ else
+ check_command="while $probe_cmd ping -w 1 -c 1 $ip; do sleep 1; done"
+ fi
+ if ! timeout $timeout_sec sh -c "$check_command"; then
+ if [[ "$expected" = "True" ]]; then
+ die $LINENO "[Fail] Couldn't ping server"
+ else
+ die $LINENO "[Fail] Could ping server"
+ fi
+ fi
+}
+
+# ssh check
+function _ssh_check_neutron() {
+ local from_net=$1
+ local key_file=$2
+ local ip=$3
+ local user=$4
+ local timeout_sec=$5
+ local probe_cmd = ""
+ probe_cmd=`_get_probe_cmd_prefix $from_net`
+ if ! timeout $timeout_sec sh -c "while ! $probe_cmd ssh -o StrictHostKeyChecking=no -i $key_file ${user}@$ip echo success; do sleep 1; done"; then
+ die $LINENO "server didn't become ssh-able!"
+ fi
+}
+
+# Neutron 3rd party programs
+#---------------------------
+
+# please refer to ``lib/neutron_thirdparty/README.md`` for details
+NEUTRON_THIRD_PARTIES=""
+for f in $TOP_DIR/lib/neutron_thirdparty/*; do
+ third_party=$(basename $f)
+ if is_service_enabled $third_party; then
+ source $TOP_DIR/lib/neutron_thirdparty/$third_party
+ NEUTRON_THIRD_PARTIES="$NEUTRON_THIRD_PARTIES,$third_party"
+ fi
+done
+
+function _neutron_third_party_do() {
+ for third_party in ${NEUTRON_THIRD_PARTIES//,/ }; do
+ ${1}_${third_party}
+ done
+}
+
+# configure_neutron_third_party() - Set config files, create data dirs, etc
+function configure_neutron_third_party() {
+ _neutron_third_party_do configure
+}
+
+# init_neutron_third_party() - Initialize databases, etc.
+function init_neutron_third_party() {
+ _neutron_third_party_do init
+}
+
+# install_neutron_third_party() - Collect source and prepare
+function install_neutron_third_party() {
+ _neutron_third_party_do install
+}
+
+# start_neutron_third_party() - Start running processes, including screen
+function start_neutron_third_party() {
+ _neutron_third_party_do start
+}
+
+# stop_neutron_third_party - Stop running processes (non-screen)
+function stop_neutron_third_party() {
+ _neutron_third_party_do stop
+}
+
+
+# Restore xtrace
+$XTRACE
+
+# Local variables:
+# mode: shell-script
+# End:
diff --git a/lib/neutron_plugins/README.md b/lib/neutron_plugins/README.md
new file mode 100644
index 0000000..be8fd96
--- /dev/null
+++ b/lib/neutron_plugins/README.md
@@ -0,0 +1,38 @@
+Neutron plugin specific files
+=============================
+Neutron plugins require plugin specific behavior.
+The files under the directory, ``lib/neutron_plugins/``, will be used
+when their service is enabled.
+Each plugin has ``lib/neutron_plugins/$Q_PLUGIN`` and define the following
+functions.
+Plugin specific configuration variables should be in this file.
+
+* filename: ``$Q_PLUGIN``
+ * The corresponding file name MUST be the same to plugin name ``$Q_PLUGIN``.
+ Plugin specific configuration variables should be in this file.
+
+functions
+---------
+``lib/neutron`` calls the following functions when the ``$Q_PLUGIN`` is enabled
+
+* ``neutron_plugin_create_nova_conf`` :
+ set ``NOVA_VIF_DRIVER`` and optionally set options in nova_conf
+ e.g.
+ NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
+* ``neutron_plugin_install_agent_packages`` :
+ install packages that is specific to plugin agent
+ e.g.
+ install_package bridge-utils
+* ``neutron_plugin_configure_common`` :
+ set plugin-specific variables, ``Q_PLUGIN_CONF_PATH``, ``Q_PLUGIN_CONF_FILENAME``,
+ ``Q_DB_NAME``, ``Q_PLUGIN_CLASS``
+* ``neutron_plugin_configure_debug_command``
+* ``neutron_plugin_configure_dhcp_agent``
+* ``neutron_plugin_configure_l3_agent``
+* ``neutron_plugin_configure_plugin_agent``
+* ``neutron_plugin_configure_service``
+* ``neutron_plugin_setup_interface_driver``
+* ``has_neutron_plugin_security_group``:
+ return 0 if the plugin support neutron security group otherwise return 1
+* ``neutron_plugin_check_adv_test_requirements``:
+ return 0 if requirements are satisfied otherwise return 1
diff --git a/lib/neutron_plugins/bigswitch_floodlight b/lib/neutron_plugins/bigswitch_floodlight
new file mode 100644
index 0000000..2450731
--- /dev/null
+++ b/lib/neutron_plugins/bigswitch_floodlight
@@ -0,0 +1,74 @@
+# Neuton Big Switch/FloodLight plugin
+# ------------------------------------
+
+# Save trace setting
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+source $TOP_DIR/lib/neutron_plugins/ovs_base
+source $TOP_DIR/lib/neutron_thirdparty/bigswitch_floodlight # for third party service specific configuration values
+
+function neutron_plugin_create_nova_conf() {
+ NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
+}
+
+function neutron_plugin_install_agent_packages() {
+ _neutron_ovs_base_install_agent_packages
+}
+
+function neutron_plugin_configure_common() {
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/bigswitch
+ Q_PLUGIN_CONF_FILENAME=restproxy.ini
+ Q_DB_NAME="restproxy_neutron"
+ Q_PLUGIN_CLASS="neutron.plugins.bigswitch.plugin.NeutronRestProxyV2"
+ BS_FL_CONTROLLERS_PORT=${BS_FL_CONTROLLERS_PORT:-localhost:80}
+ BS_FL_CONTROLLER_TIMEOUT=${BS_FL_CONTROLLER_TIMEOUT:-10}
+}
+
+function neutron_plugin_configure_debug_command() {
+ _neutron_ovs_base_configure_debug_command
+}
+
+function neutron_plugin_configure_dhcp_agent() {
+ :
+}
+
+function neutron_plugin_configure_l3_agent() {
+ _neutron_ovs_base_configure_l3_agent
+}
+
+function neutron_plugin_configure_plugin_agent() {
+ :
+}
+
+function neutron_plugin_configure_service() {
+ iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT
+ iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT
+ if [ "$BS_FL_VIF_DRIVER" = "ivs" ]
+ then
+ iniset /$Q_PLUGIN_CONF_FILE nova vif_type ivs
+ fi
+}
+
+function neutron_plugin_setup_interface_driver() {
+ local conf_file=$1
+ if [ "$BS_FL_VIF_DRIVER" = "ivs" ]
+ then
+ iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.IVSInterfaceDriver
+ else
+ iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
+ fi
+}
+
+
+function has_neutron_plugin_security_group() {
+ # 1 means False here
+ return 1
+}
+
+function neutron_plugin_check_adv_test_requirements() {
+ is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
+}
+
+# Restore xtrace
+$MY_XTRACE
diff --git a/lib/neutron_plugins/brocade b/lib/neutron_plugins/brocade
new file mode 100644
index 0000000..f9275ca
--- /dev/null
+++ b/lib/neutron_plugins/brocade
@@ -0,0 +1,59 @@
+# Brocade Neutron Plugin
+# ----------------------
+
+# Save trace setting
+BRCD_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+function is_neutron_ovs_base_plugin() {
+ return 1
+}
+
+function neutron_plugin_create_nova_conf() {
+ NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
+}
+
+function neutron_plugin_install_agent_packages() {
+ install_package bridge-utils
+}
+
+function neutron_plugin_configure_common() {
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/brocade
+ Q_PLUGIN_CONF_FILENAME=brocade.ini
+ Q_DB_NAME="brcd_neutron"
+ Q_PLUGIN_CLASS="neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2"
+}
+
+function neutron_plugin_configure_debug_command() {
+ iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge
+}
+
+function neutron_plugin_configure_dhcp_agent() {
+ iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
+}
+
+function neutron_plugin_configure_l3_agent() {
+ iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
+ iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
+}
+
+function neutron_plugin_configure_plugin_agent() {
+ AGENT_BINARY="$NEUTON_BIN_DIR/neutron-linuxbridge-agent"
+}
+
+function neutron_plugin_setup_interface_driver() {
+ local conf_file=$1
+ iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
+}
+
+function has_neutron_plugin_security_group() {
+ # 0 means True here
+ return 0
+}
+
+function neutron_plugin_check_adv_test_requirements() {
+ is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
+}
+
+# Restore xtrace
+$BRCD_XTRACE
diff --git a/lib/quantum_plugins/cisco b/lib/neutron_plugins/cisco
similarity index 78%
rename from lib/quantum_plugins/cisco
rename to lib/neutron_plugins/cisco
index 92b91e4..8948be6 100644
--- a/lib/quantum_plugins/cisco
+++ b/lib/neutron_plugins/cisco
@@ -1,4 +1,4 @@
-# Quantum Cisco plugin
+# Neutron Cisco plugin
# ---------------------------
# Save trace setting
@@ -86,17 +86,17 @@
# Prefix openvswitch plugin routines with "ovs" in order to differentiate from
# cisco plugin routines. This means, ovs plugin routines will coexist with cisco
# plugin routines in this script.
-source $TOP_DIR/lib/quantum_plugins/openvswitch
-_prefix_function quantum_plugin_create_nova_conf ovs
-_prefix_function quantum_plugin_install_agent_packages ovs
-_prefix_function quantum_plugin_configure_common ovs
-_prefix_function quantum_plugin_configure_debug_command ovs
-_prefix_function quantum_plugin_configure_dhcp_agent ovs
-_prefix_function quantum_plugin_configure_l3_agent ovs
-_prefix_function quantum_plugin_configure_plugin_agent ovs
-_prefix_function quantum_plugin_configure_service ovs
-_prefix_function quantum_plugin_setup_interface_driver ovs
-_prefix_function has_quantum_plugin_security_group ovs
+source $TOP_DIR/lib/neutron_plugins/openvswitch
+_prefix_function neutron_plugin_create_nova_conf ovs
+_prefix_function neutron_plugin_install_agent_packages ovs
+_prefix_function neutron_plugin_configure_common ovs
+_prefix_function neutron_plugin_configure_debug_command ovs
+_prefix_function neutron_plugin_configure_dhcp_agent ovs
+_prefix_function neutron_plugin_configure_l3_agent ovs
+_prefix_function neutron_plugin_configure_plugin_agent ovs
+_prefix_function neutron_plugin_configure_service ovs
+_prefix_function neutron_plugin_setup_interface_driver ovs
+_prefix_function has_neutron_plugin_security_group ovs
# Check the version of the installed ncclient package
function check_ncclient_version() {
@@ -144,66 +144,66 @@
return 0
}
-function has_quantum_plugin_security_group() {
+function has_neutron_plugin_security_group() {
if _has_ovs_subplugin; then
- ovs_has_quantum_plugin_security_group
+ ovs_has_neutron_plugin_security_group
else
return 1
fi
}
-function is_quantum_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin() {
# Cisco uses OVS if openvswitch subplugin is deployed
_has_ovs_subplugin
return
}
# populate required nova configuration parameters
-function quantum_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf() {
if _has_ovs_subplugin; then
- ovs_quantum_plugin_create_nova_conf
+ ovs_neutron_plugin_create_nova_conf
else
- _quantum_ovs_base_configure_nova_vif_driver
+ _neutron_ovs_base_configure_nova_vif_driver
fi
}
-function quantum_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages() {
# Cisco plugin uses openvswitch to operate in one of its configurations
- ovs_quantum_plugin_install_agent_packages
+ ovs_neutron_plugin_install_agent_packages
}
# Configure common parameters
-function quantum_plugin_configure_common() {
+function neutron_plugin_configure_common() {
# setup default subplugins
if [ ! -v Q_CISCO_PLUGIN_SUBPLUGINS ]; then
declare -ga Q_CISCO_PLUGIN_SUBPLUGINS
Q_CISCO_PLUGIN_SUBPLUGINS=(openvswitch nexus)
fi
if _has_ovs_subplugin; then
- ovs_quantum_plugin_configure_common
- Q_PLUGIN_EXTRA_CONF_PATH=etc/quantum/plugins/cisco
+ ovs_neutron_plugin_configure_common
+ Q_PLUGIN_EXTRA_CONF_PATH=etc/neutron/plugins/cisco
Q_PLUGIN_EXTRA_CONF_FILES=(cisco_plugins.ini)
else
- Q_PLUGIN_CONF_PATH=etc/quantum/plugins/cisco
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/cisco
Q_PLUGIN_CONF_FILENAME=cisco_plugins.ini
fi
- Q_PLUGIN_CLASS="quantum.plugins.cisco.network_plugin.PluginV2"
- Q_DB_NAME=cisco_quantum
+ Q_PLUGIN_CLASS="neutron.plugins.cisco.network_plugin.PluginV2"
+ Q_DB_NAME=cisco_neutron
}
-function quantum_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command() {
if _has_ovs_subplugin; then
- ovs_quantum_plugin_configure_debug_command
+ ovs_neutron_plugin_configure_debug_command
fi
}
-function quantum_plugin_configure_dhcp_agent() {
- iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager quantum.agent.dhcp_agent.DhcpAgentWithStateReport
+function neutron_plugin_configure_dhcp_agent() {
+ iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
}
-function quantum_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent() {
if _has_ovs_subplugin; then
- ovs_quantum_plugin_configure_l3_agent
+ ovs_neutron_plugin_configure_l3_agent
fi
}
@@ -230,7 +230,7 @@
HOST_NAME=$(hostname)
Q_CISCO_PLUGIN_SWITCH_INFO=([1.1.1.1]=stack:stack:22:${HOST_NAME}:1/10)
else
- iniset $cisco_cfg_file CISCO nexus_driver quantum.plugins.cisco.nexus.cisco_nexus_network_driver_v2.CiscoNEXUSDriver
+ iniset $cisco_cfg_file CISCO nexus_driver neutron.plugins.cisco.nexus.cisco_nexus_network_driver_v2.CiscoNEXUSDriver
fi
# Setup the switch configurations
@@ -267,21 +267,21 @@
# Setup the integration bridge by calling the ovs_base
OVS_BRIDGE=$Q_CISCO_PLUGIN_INTEGRATION_BRIDGE
- _quantum_ovs_base_setup_bridge $OVS_BRIDGE
+ _neutron_ovs_base_setup_bridge $OVS_BRIDGE
}
-function quantum_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent() {
if _has_ovs_subplugin; then
- ovs_quantum_plugin_configure_plugin_agent
+ ovs_neutron_plugin_configure_plugin_agent
fi
}
-function quantum_plugin_configure_service() {
+function neutron_plugin_configure_service() {
local subplugin
local cisco_cfg_file
if _has_ovs_subplugin; then
- ovs_quantum_plugin_configure_service
+ ovs_neutron_plugin_configure_service
cisco_cfg_file=/${Q_PLUGIN_EXTRA_CONF_FILES[0]}
else
cisco_cfg_file=/$Q_PLUGIN_CONF_FILE
@@ -302,9 +302,9 @@
inicomment $cisco_cfg_file CISCO_TEST host
for subplugin in ${Q_CISCO_PLUGIN_SUBPLUGINS[@]}; do
case $subplugin in
- nexus) iniset $cisco_cfg_file CISCO_PLUGINS nexus_plugin quantum.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin;;
- openvswitch) iniset $cisco_cfg_file CISCO_PLUGINS vswitch_plugin quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2;;
- n1kv) iniset $cisco_cfg_file CISCO_PLUGINS vswitch_plugin quantum.plugins.cisco.n1kv.n1kv_quantum_plugin.N1kvQuantumPluginV2;;
+ nexus) iniset $cisco_cfg_file CISCO_PLUGINS nexus_plugin neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin;;
+ openvswitch) iniset $cisco_cfg_file CISCO_PLUGINS vswitch_plugin neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2;;
+ n1kv) iniset $cisco_cfg_file CISCO_PLUGINS vswitch_plugin neutron.plugins.cisco.n1kv.n1kv_neutron_plugin.N1kvNeutronPluginV2;;
*) die $LINENO "Unsupported cisco subplugin: $subplugin";;
esac
done
@@ -318,9 +318,9 @@
fi
}
-function quantum_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver() {
local conf_file=$1
- iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
+ iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
}
# Restore xtrace
diff --git a/lib/quantum_plugins/linuxbridge b/lib/neutron_plugins/linuxbridge
similarity index 78%
rename from lib/quantum_plugins/linuxbridge
rename to lib/neutron_plugins/linuxbridge
index 989b930..9aad8f3 100644
--- a/lib/quantum_plugins/linuxbridge
+++ b/lib/neutron_plugins/linuxbridge
@@ -1,18 +1,18 @@
-# Quantum Linux Bridge plugin
+# Neutron Linux Bridge plugin
# ---------------------------
# Save trace setting
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
-function quantum_plugin_configure_common() {
- Q_PLUGIN_CONF_PATH=etc/quantum/plugins/linuxbridge
+function neutron_plugin_configure_common() {
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/linuxbridge
Q_PLUGIN_CONF_FILENAME=linuxbridge_conf.ini
- Q_DB_NAME="quantum_linux_bridge"
- Q_PLUGIN_CLASS="quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2"
+ Q_DB_NAME="neutron_linux_bridge"
+ Q_PLUGIN_CLASS="neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2"
}
-function quantum_plugin_configure_service() {
+function neutron_plugin_configure_service() {
if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
iniset /$Q_PLUGIN_CONF_FILE vlans tenant_network_type vlan
else
@@ -31,9 +31,9 @@
iniset /$Q_PLUGIN_CONF_FILE vlans network_vlan_ranges $LB_VLAN_RANGES
fi
if [[ "$Q_USE_SECGROUP" == "True" ]]; then
- iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.linux.iptables_firewall.IptablesFirewallDriver
+ iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
else
- iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.firewall.NoopFirewallDriver
+ iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
fi
# Define extra "LINUX_BRIDGE" configuration options when q-svc is configured by defining
@@ -45,7 +45,7 @@
done
}
-function has_quantum_plugin_security_group() {
+function has_neutron_plugin_security_group() {
# 0 means True here
return 0
}
diff --git a/lib/quantum_plugins/linuxbridge_agent b/lib/neutron_plugins/linuxbridge_agent
similarity index 69%
rename from lib/quantum_plugins/linuxbridge_agent
rename to lib/neutron_plugins/linuxbridge_agent
index b3ca8b1..88c49c5 100644
--- a/lib/quantum_plugins/linuxbridge_agent
+++ b/lib/neutron_plugins/linuxbridge_agent
@@ -1,37 +1,37 @@
-# Quantum Linux Bridge L2 agent
+# Neutron Linux Bridge L2 agent
# -----------------------------
# Save trace setting
PLUGIN_XTRACE=$(set +o | grep xtrace)
set +o xtrace
-function is_quantum_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin() {
# linuxbridge doesn't use OVS
return 1
}
-function quantum_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf() {
NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
}
-function quantum_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages() {
install_package bridge-utils
}
-function quantum_plugin_configure_debug_command() {
- iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge
+function neutron_plugin_configure_debug_command() {
+ iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge
}
-function quantum_plugin_configure_dhcp_agent() {
- iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager quantum.agent.dhcp_agent.DhcpAgentWithStateReport
+function neutron_plugin_configure_dhcp_agent() {
+ iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
}
-function quantum_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent() {
iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
- iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager quantum.agent.l3_agent.L3NATAgentWithStateReport
+ iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
}
-function quantum_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent() {
# Setup physical network interface mappings. Override
# ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc`` for more
# complex physical network configurations.
@@ -42,11 +42,11 @@
iniset /$Q_PLUGIN_CONF_FILE linux_bridge physical_interface_mappings $LB_INTERFACE_MAPPINGS
fi
if [[ "$Q_USE_SECGROUP" == "True" ]]; then
- iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.linux.iptables_firewall.IptablesFirewallDriver
+ iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
else
- iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.firewall.NoopFirewallDriver
+ iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
fi
- AGENT_BINARY="$QUANTUM_DIR/bin/quantum-linuxbridge-agent"
+ AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-linuxbridge-agent"
# Define extra "AGENT" configuration options when q-agt is configured by defining
# the array ``Q_AGENT_EXTRA_AGENT_OPTS``.
# For Example: ``Q_AGENT_EXTRA_AGENT_OPTS=(foo=true bar=2)``
@@ -63,12 +63,12 @@
done
}
-function quantum_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver() {
local conf_file=$1
- iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver
+ iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
}
-function quantum_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements() {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
diff --git a/lib/quantum_plugins/ml2 b/lib/neutron_plugins/ml2
similarity index 78%
rename from lib/quantum_plugins/ml2
rename to lib/neutron_plugins/ml2
index ae8fe6c..fcff870 100644
--- a/lib/quantum_plugins/ml2
+++ b/lib/neutron_plugins/ml2
@@ -1,4 +1,4 @@
-# Quantum Modular Layer 2 plugin
+# Neutron Modular Layer 2 plugin
# ------------------------------
# Save trace setting
@@ -7,16 +7,16 @@
# Default openvswitch L2 agent
Q_AGENT=${Q_AGENT:-openvswitch}
-source $TOP_DIR/lib/quantum_plugins/${Q_AGENT}_agent
+source $TOP_DIR/lib/neutron_plugins/${Q_AGENT}_agent
-function quantum_plugin_configure_common() {
- Q_PLUGIN_CONF_PATH=etc/quantum/plugins/ml2
+function neutron_plugin_configure_common() {
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/ml2
Q_PLUGIN_CONF_FILENAME=ml2_conf.ini
- Q_DB_NAME="quantum_ml2"
- Q_PLUGIN_CLASS="quantum.plugins.ml2.plugin.Ml2Plugin"
+ Q_DB_NAME="neutron_ml2"
+ Q_PLUGIN_CLASS="neutron.plugins.ml2.plugin.Ml2Plugin"
}
-function quantum_plugin_configure_service() {
+function neutron_plugin_configure_service() {
if [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
iniset /$Q_PLUGIN_CONF_FILE ml2 tenant_network_types gre
iniset /$Q_PLUGIN_CONF_FILE ml2_type_gre tunnel_id_ranges $TENANT_TUNNEL_RANGES
@@ -40,21 +40,21 @@
fi
# REVISIT(rkukura): Setting firewall_driver here for
- # quantum.agent.securitygroups_rpc.is_firewall_enabled() which is
+ # neutron.agent.securitygroups_rpc.is_firewall_enabled() which is
# used in the server, in case no L2 agent is configured on the
# server's node. If an L2 agent is configured, this will get
# overridden with the correct driver. The ml2 plugin should
# instead use its own config variable to indicate whether security
# groups is enabled, and that will need to be set here instead.
if [[ "$Q_USE_SECGROUP" == "True" ]]; then
- iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver quantum.agent.not.a.real.FirewallDriver
+ iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver neutron.agent.not.a.real.FirewallDriver
else
- iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver quantum.agent.firewall.NoopFirewallDriver
+ iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver neutron.agent.firewall.NoopFirewallDriver
fi
}
-function has_quantum_plugin_security_group() {
+function has_neutron_plugin_security_group() {
return 0
}
diff --git a/lib/quantum_plugins/nec b/lib/neutron_plugins/nec
similarity index 65%
rename from lib/quantum_plugins/nec
rename to lib/neutron_plugins/nec
index 69bbe0e..79d41db 100644
--- a/lib/quantum_plugins/nec
+++ b/lib/neutron_plugins/nec
@@ -1,4 +1,4 @@
-# Quantum NEC OpenFlow plugin
+# Neutron NEC OpenFlow plugin
# ---------------------------
# Save trace setting
@@ -20,47 +20,47 @@
# Main logic
# ---------------------------
-source $TOP_DIR/lib/quantum_plugins/ovs_base
+source $TOP_DIR/lib/neutron_plugins/ovs_base
-function quantum_plugin_create_nova_conf() {
- _quantum_ovs_base_configure_nova_vif_driver
+function neutron_plugin_create_nova_conf() {
+ _neutron_ovs_base_configure_nova_vif_driver
}
-function quantum_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages() {
# SKIP_OVS_INSTALL is useful when we want to use Open vSwitch whose
# version is different from the version provided by the distribution.
if [[ "$SKIP_OVS_INSTALL" = "True" ]]; then
echo "You need to install Open vSwitch manually."
return
fi
- _quantum_ovs_base_install_agent_packages
+ _neutron_ovs_base_install_agent_packages
}
-function quantum_plugin_configure_common() {
- Q_PLUGIN_CONF_PATH=etc/quantum/plugins/nec
+function neutron_plugin_configure_common() {
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/nec
Q_PLUGIN_CONF_FILENAME=nec.ini
- Q_DB_NAME="quantum_nec"
- Q_PLUGIN_CLASS="quantum.plugins.nec.nec_plugin.NECPluginV2"
+ Q_DB_NAME="neutron_nec"
+ Q_PLUGIN_CLASS="neutron.plugins.nec.nec_plugin.NECPluginV2"
}
-function quantum_plugin_configure_debug_command() {
- _quantum_ovs_base_configure_debug_command
+function neutron_plugin_configure_debug_command() {
+ _neutron_ovs_base_configure_debug_command
}
-function quantum_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent() {
:
}
-function quantum_plugin_configure_l3_agent() {
- _quantum_ovs_base_configure_l3_agent
+function neutron_plugin_configure_l3_agent() {
+ _neutron_ovs_base_configure_l3_agent
}
-function quantum_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent() {
if [[ "$SKIP_OVS_BRIDGE_SETUP" = "True" ]]; then
return
fi
# Set up integration bridge
- _quantum_ovs_base_setup_bridge $OVS_BRIDGE
+ _neutron_ovs_base_setup_bridge $OVS_BRIDGE
sudo ovs-vsctl --no-wait set-controller $OVS_BRIDGE tcp:$OFC_OFP_HOST:$OFC_OFP_PORT
# Generate datapath ID from HOST_IP
local dpid=$(printf "0x%07d%03d%03d%03d\n" ${HOST_IP//./ })
@@ -69,26 +69,26 @@
if [ -n "$OVS_INTERFACE" ]; then
sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $OVS_INTERFACE
fi
- _quantum_setup_ovs_tunnels $OVS_BRIDGE
- AGENT_BINARY="$QUANTUM_DIR/bin/quantum-nec-agent"
+ _neutron_setup_ovs_tunnels $OVS_BRIDGE
+ AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-nec-agent"
- _quantum_ovs_base_configure_firewall_driver
+ _neutron_ovs_base_configure_firewall_driver
}
-function quantum_plugin_configure_service() {
- iniset $QUANTUM_CONF DEFAULT api_extensions_path quantum/plugins/nec/extensions/
+function neutron_plugin_configure_service() {
+ iniset $NEUTRON_CONF DEFAULT api_extensions_path neutron/plugins/nec/extensions/
iniset /$Q_PLUGIN_CONF_FILE ofc host $OFC_API_HOST
iniset /$Q_PLUGIN_CONF_FILE ofc port $OFC_API_PORT
iniset /$Q_PLUGIN_CONF_FILE ofc driver $OFC_DRIVER
iniset /$Q_PLUGIN_CONF_FILE ofc api_retry_max OFC_RETRY_MAX
iniset /$Q_PLUGIN_CONF_FILE ofc api_retry_interval OFC_RETRY_INTERVAL
- _quantum_ovs_base_configure_firewall_driver
+ _neutron_ovs_base_configure_firewall_driver
}
-function quantum_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver() {
local conf_file=$1
- iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
+ iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
iniset $conf_file DEFAULT ovs_use_veth True
}
@@ -96,7 +96,7 @@
# ---------------------------
# Setup OVS tunnel manually
-function _quantum_setup_ovs_tunnels() {
+function _neutron_setup_ovs_tunnels() {
local bridge=$1
local id=0
GRE_LOCAL_IP=${GRE_LOCAL_IP:-$HOST_IP}
@@ -113,12 +113,12 @@
fi
}
-function has_quantum_plugin_security_group() {
+function has_neutron_plugin_security_group() {
# 0 means True here
return 0
}
-function quantum_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements() {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
diff --git a/lib/quantum_plugins/nicira b/lib/neutron_plugins/nicira
similarity index 79%
rename from lib/quantum_plugins/nicira
rename to lib/neutron_plugins/nicira
index d4b3e51..7642be6 100644
--- a/lib/quantum_plugins/nicira
+++ b/lib/neutron_plugins/nicira
@@ -1,14 +1,14 @@
-# Quantum Nicira NVP plugin
+# Neutron Nicira NVP plugin
# ---------------------------
# Save trace setting
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
-source $TOP_DIR/lib/quantum_plugins/ovs_base
+source $TOP_DIR/lib/neutron_plugins/ovs_base
function setup_integration_bridge() {
- _quantum_ovs_base_setup_bridge $OVS_BRIDGE
+ _neutron_ovs_base_setup_bridge $OVS_BRIDGE
# Set manager to NVP controller (1st of list)
if [[ "$NVP_CONTROLLERS" != "" ]]; then
# Get the first controller
@@ -20,12 +20,12 @@
sudo ovs-vsctl set-manager ssl:$OVS_MGR_IP
}
-function is_quantum_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin() {
# NVP uses OVS, but not the l3-agent
return 0
}
-function quantum_plugin_create_nova_conf() {
+function neutron_plugin_create_nova_conf() {
NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtOpenVswitchDriver"}
# if n-cpu is enabled, then setup integration bridge
if is_service_enabled n-cpu; then
@@ -33,40 +33,40 @@
fi
}
-function quantum_plugin_install_agent_packages() {
+function neutron_plugin_install_agent_packages() {
# Nicira Plugin does not run q-agt, but it currently needs dhcp and metadata agents
- _quantum_ovs_base_install_agent_packages
+ _neutron_ovs_base_install_agent_packages
}
-function quantum_plugin_configure_common() {
- Q_PLUGIN_CONF_PATH=etc/quantum/plugins/nicira
+function neutron_plugin_configure_common() {
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/nicira
Q_PLUGIN_CONF_FILENAME=nvp.ini
- Q_DB_NAME="quantum_nvp"
- Q_PLUGIN_CLASS="quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2"
+ Q_DB_NAME="neutron_nvp"
+ Q_PLUGIN_CLASS="neutron.plugins.nicira.nicira_nvp_plugin.NeutronPlugin.NvpPluginV2"
}
-function quantum_plugin_configure_debug_command() {
+function neutron_plugin_configure_debug_command() {
sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE
}
-function quantum_plugin_configure_dhcp_agent() {
+function neutron_plugin_configure_dhcp_agent() {
setup_integration_bridge
iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
iniset $Q_DHCP_CONF_FILE DEFAULT enable_metadata_network True
iniset $Q_DHCP_CONF_FILE DEFAULT ovs_use_veth True
}
-function quantum_plugin_configure_l3_agent() {
+function neutron_plugin_configure_l3_agent() {
# Nicira plugin does not run L3 agent
die $LINENO "q-l3 should must not be executed with Nicira plugin!"
}
-function quantum_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent() {
# Nicira plugin does not run L2 agent
die $LINENO "q-agt must not be executed with Nicira plugin!"
}
-function quantum_plugin_configure_service() {
+function neutron_plugin_configure_service() {
if [[ "$MAX_LP_PER_BRIDGED_LS" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE nvp max_lp_per_bridged_ls $MAX_LP_PER_BRIDGED_LS
fi
@@ -120,17 +120,17 @@
fi
}
-function quantum_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver() {
local conf_file=$1
- iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
+ iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
}
-function has_quantum_plugin_security_group() {
+function has_neutron_plugin_security_group() {
# 0 means True here
return 0
}
-function quantum_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements() {
is_service_enabled q-dhcp && return 0
}
diff --git a/lib/quantum_plugins/openvswitch b/lib/neutron_plugins/openvswitch
similarity index 76%
rename from lib/quantum_plugins/openvswitch
rename to lib/neutron_plugins/openvswitch
index 4aac9f8..f99eb38 100644
--- a/lib/quantum_plugins/openvswitch
+++ b/lib/neutron_plugins/openvswitch
@@ -1,20 +1,20 @@
-# Quantum Open vSwitch plugin
+# Neutron Open vSwitch plugin
# ---------------------------
# Save trace setting
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
-source $TOP_DIR/lib/quantum_plugins/openvswitch_agent
+source $TOP_DIR/lib/neutron_plugins/openvswitch_agent
-function quantum_plugin_configure_common() {
- Q_PLUGIN_CONF_PATH=etc/quantum/plugins/openvswitch
- Q_PLUGIN_CONF_FILENAME=ovs_quantum_plugin.ini
- Q_DB_NAME="ovs_quantum"
- Q_PLUGIN_CLASS="quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2"
+function neutron_plugin_configure_common() {
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/openvswitch
+ Q_PLUGIN_CONF_FILENAME=ovs_neutron_plugin.ini
+ Q_DB_NAME="ovs_neutron"
+ Q_PLUGIN_CLASS="neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2"
}
-function quantum_plugin_configure_service() {
+function neutron_plugin_configure_service() {
if [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
iniset /$Q_PLUGIN_CONF_FILE ovs tenant_network_type gre
iniset /$Q_PLUGIN_CONF_FILE ovs tunnel_id_ranges $TENANT_TUNNEL_RANGES
@@ -41,7 +41,7 @@
iniset /$Q_PLUGIN_CONF_FILE ovs enable_tunneling True
fi
- _quantum_ovs_base_configure_firewall_driver
+ _neutron_ovs_base_configure_firewall_driver
# Define extra "OVS" configuration options when q-svc is configured by defining
# the array ``Q_SRV_EXTRA_OPTS``.
@@ -52,7 +52,7 @@
done
}
-function has_quantum_plugin_security_group() {
+function has_neutron_plugin_security_group() {
return 0
}
diff --git a/lib/quantum_plugins/openvswitch_agent b/lib/neutron_plugins/openvswitch_agent
similarity index 80%
rename from lib/quantum_plugins/openvswitch_agent
rename to lib/neutron_plugins/openvswitch_agent
index 608c3ea..46c2a5c 100644
--- a/lib/quantum_plugins/openvswitch_agent
+++ b/lib/neutron_plugins/openvswitch_agent
@@ -1,43 +1,43 @@
-# Quantum Open vSwitch L2 agent
+# Neutron Open vSwitch L2 agent
# -----------------------------
# Save trace setting
PLUGIN_XTRACE=$(set +o | grep xtrace)
set +o xtrace
-source $TOP_DIR/lib/quantum_plugins/ovs_base
+source $TOP_DIR/lib/neutron_plugins/ovs_base
-function quantum_plugin_create_nova_conf() {
- _quantum_ovs_base_configure_nova_vif_driver
+function neutron_plugin_create_nova_conf() {
+ _neutron_ovs_base_configure_nova_vif_driver
if [ "$VIRT_DRIVER" = 'xenserver' ]; then
iniset $NOVA_CONF DEFAULT xenapi_vif_driver nova.virt.xenapi.vif.XenAPIOpenVswitchDriver
iniset $NOVA_CONF DEFAULT xenapi_ovs_integration_bridge $XEN_INTEGRATION_BRIDGE
- # Disable nova's firewall so that it does not conflict with quantum
+ # Disable nova's firewall so that it does not conflict with neutron
iniset $NOVA_CONF DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
fi
}
-function quantum_plugin_install_agent_packages() {
- _quantum_ovs_base_install_agent_packages
+function neutron_plugin_install_agent_packages() {
+ _neutron_ovs_base_install_agent_packages
}
-function quantum_plugin_configure_debug_command() {
- _quantum_ovs_base_configure_debug_command
+function neutron_plugin_configure_debug_command() {
+ _neutron_ovs_base_configure_debug_command
}
-function quantum_plugin_configure_dhcp_agent() {
- iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager quantum.agent.dhcp_agent.DhcpAgentWithStateReport
+function neutron_plugin_configure_dhcp_agent() {
+ iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
}
-function quantum_plugin_configure_l3_agent() {
- _quantum_ovs_base_configure_l3_agent
- iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager quantum.agent.l3_agent.L3NATAgentWithStateReport
+function neutron_plugin_configure_l3_agent() {
+ _neutron_ovs_base_configure_l3_agent
+ iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
}
-function quantum_plugin_configure_plugin_agent() {
+function neutron_plugin_configure_plugin_agent() {
# Setup integration bridge
- _quantum_ovs_base_setup_bridge $OVS_BRIDGE
- _quantum_ovs_base_configure_firewall_driver
+ _neutron_ovs_base_setup_bridge $OVS_BRIDGE
+ _neutron_ovs_base_configure_firewall_driver
# Setup agent for tunneling
if [[ "$OVS_ENABLE_TUNNELING" = "True" ]]; then
@@ -63,14 +63,14 @@
if [[ "$OVS_BRIDGE_MAPPINGS" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE ovs bridge_mappings $OVS_BRIDGE_MAPPINGS
fi
- AGENT_BINARY="$QUANTUM_DIR/bin/quantum-openvswitch-agent"
+ AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-openvswitch-agent"
if [ "$VIRT_DRIVER" = 'xenserver' ]; then
# Make a copy of our config for domU
sudo cp /$Q_PLUGIN_CONF_FILE "/$Q_PLUGIN_CONF_FILE.domu"
# Deal with Dom0's L2 Agent:
- Q_RR_DOM0_COMMAND="$QUANTUM_DIR/bin/quantum-rootwrap-xen-dom0 $Q_RR_CONF_FILE"
+ Q_RR_DOM0_COMMAND="$NEUTRON_BIN_DIR/neutron-rootwrap-xen-dom0 $Q_RR_CONF_FILE"
# For now, duplicate the xen configuration already found in nova.conf
iniset $Q_RR_CONF_FILE xenapi xenapi_connection_url "$XENAPI_CONNECTION_URL"
@@ -118,12 +118,12 @@
done
}
-function quantum_plugin_setup_interface_driver() {
+function neutron_plugin_setup_interface_driver() {
local conf_file=$1
- iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
+ iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
}
-function quantum_plugin_check_adv_test_requirements() {
+function neutron_plugin_check_adv_test_requirements() {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
diff --git a/lib/quantum_plugins/ovs_base b/lib/neutron_plugins/ovs_base
similarity index 71%
rename from lib/quantum_plugins/ovs_base
rename to lib/neutron_plugins/ovs_base
index 646ff4a..0a2765b 100644
--- a/lib/quantum_plugins/ovs_base
+++ b/lib/neutron_plugins/ovs_base
@@ -8,34 +8,34 @@
OVS_BRIDGE=${OVS_BRIDGE:-br-int}
PUBLIC_BRIDGE=${PUBLIC_BRIDGE:-br-ex}
-function is_quantum_ovs_base_plugin() {
+function is_neutron_ovs_base_plugin() {
# Yes, we use OVS.
return 0
}
-function _quantum_ovs_base_setup_bridge() {
+function _neutron_ovs_base_setup_bridge() {
local bridge=$1
- quantum-ovs-cleanup
+ neutron-ovs-cleanup
sudo ovs-vsctl --no-wait -- --may-exist add-br $bridge
sudo ovs-vsctl --no-wait br-set-external-id $bridge bridge-id $bridge
}
-function quantum_ovs_base_cleanup() {
- # remove all OVS ports that look like Quantum created ports
+function neutron_ovs_base_cleanup() {
+ # remove all OVS ports that look like Neutron created ports
for port in $(sudo ovs-vsctl list port | grep -o -e tap[0-9a-f\-]* -e q[rg]-[0-9a-f\-]*); do
sudo ovs-vsctl del-port ${port}
done
- # remove all OVS bridges created by Quantum
+ # remove all OVS bridges created by Neutron
for bridge in $(sudo ovs-vsctl list-br | grep -o -e ${OVS_BRIDGE} -e ${PUBLIC_BRIDGE}); do
sudo ovs-vsctl del-br ${bridge}
done
}
-function _quantum_ovs_base_install_agent_packages() {
+function _neutron_ovs_base_install_agent_packages() {
local kernel_version
# Install deps
- # FIXME add to ``files/apts/quantum``, but don't install if not needed!
+ # FIXME add to ``files/apts/neutron``, but don't install if not needed!
if is_ubuntu; then
kernel_version=`cat /proc/version | cut -d " " -f3`
install_package make fakeroot dkms openvswitch-switch openvswitch-datapath-dkms linux-headers-$kernel_version
@@ -50,29 +50,29 @@
fi
}
-function _quantum_ovs_base_configure_debug_command() {
- iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
+function _neutron_ovs_base_configure_debug_command() {
+ iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
}
-function _quantum_ovs_base_configure_firewall_driver() {
+function _neutron_ovs_base_configure_firewall_driver() {
if [[ "$Q_USE_SECGROUP" == "True" ]]; then
- iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
+ iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
else
- iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.firewall.NoopFirewallDriver
+ iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
fi
}
-function _quantum_ovs_base_configure_l3_agent() {
+function _neutron_ovs_base_configure_l3_agent() {
iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
- quantum-ovs-cleanup
+ neutron-ovs-cleanup
sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE
# ensure no IP is configured on the public bridge
sudo ip addr flush dev $PUBLIC_BRIDGE
}
-function _quantum_ovs_base_configure_nova_vif_driver() {
- # The hybrid VIF driver needs to be specified when Quantum Security Group
+function _neutron_ovs_base_configure_nova_vif_driver() {
+ # The hybrid VIF driver needs to be specified when Neutron Security Group
# is enabled (until vif_security attributes are supported in VIF extension)
if [[ "$Q_USE_SECGROUP" == "True" ]]; then
NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver"}
diff --git a/lib/neutron_plugins/plumgrid b/lib/neutron_plugins/plumgrid
new file mode 100644
index 0000000..d4cc395
--- /dev/null
+++ b/lib/neutron_plugins/plumgrid
@@ -0,0 +1,42 @@
+# PLUMgrid Neutron Plugin
+# Edgar Magana emagana@plumgrid.com
+# ------------------------------------
+
+# Save trace settings
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+#source $TOP_DIR/lib/neutron_plugins/ovs_base
+
+function neutron_plugin_create_nova_conf() {
+
+ NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
+}
+
+function neutron_plugin_setup_interface_driver() {
+ :
+}
+
+function neutron_plugin_configure_common() {
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/plumgrid
+ Q_PLUGIN_CONF_FILENAME=plumgrid.ini
+ Q_DB_NAME="plumgrid_neutron"
+ Q_PLUGIN_CLASS="neutron.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2"
+}
+
+function neutron_plugin_configure_service() {
+ PLUMGRID_NOS_IP=${PLUMGRID_NOS_IP:-localhost}
+ PLUMGRID_NOS_PORT=${PLUMGRID_NOS_PORT:-7766}
+ iniset /$Q_PLUGIN_CONF_FILE plumgridnos nos_server $PLUMGRID_NOS_IP
+ iniset /$Q_PLUGIN_CONF_FILE plumgridnos nos_server_port $PLUMGRID_NOS_PORT
+}
+
+function neutron_plugin_configure_debug_command() {
+ :
+}
+
+function neutron_plugin_check_adv_test_requirements() {
+ is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
+}
+# Restore xtrace
+$MY_XTRACE
diff --git a/lib/neutron_plugins/ryu b/lib/neutron_plugins/ryu
new file mode 100644
index 0000000..334c227
--- /dev/null
+++ b/lib/neutron_plugins/ryu
@@ -0,0 +1,80 @@
+# Neutron Ryu plugin
+# ------------------
+
+# Save trace setting
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+source $TOP_DIR/lib/neutron_plugins/ovs_base
+source $TOP_DIR/lib/neutron_thirdparty/ryu # for configuration value
+
+function neutron_plugin_create_nova_conf() {
+ _neutron_ovs_base_configure_nova_vif_driver
+ iniset $NOVA_CONF DEFAULT libvirt_ovs_integration_bridge "$OVS_BRIDGE"
+}
+
+function neutron_plugin_install_agent_packages() {
+ _neutron_ovs_base_install_agent_packages
+
+ # neutron_ryu_agent requires ryu module
+ install_package $(get_packages "ryu")
+ install_ryu
+ configure_ryu
+}
+
+function neutron_plugin_configure_common() {
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/ryu
+ Q_PLUGIN_CONF_FILENAME=ryu.ini
+ Q_DB_NAME="ovs_neutron"
+ Q_PLUGIN_CLASS="neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2"
+}
+
+function neutron_plugin_configure_debug_command() {
+ _neutron_ovs_base_configure_debug_command
+ iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
+}
+
+function neutron_plugin_configure_dhcp_agent() {
+ iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
+}
+
+function neutron_plugin_configure_l3_agent() {
+ iniset $Q_L3_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
+ _neutron_ovs_base_configure_l3_agent
+}
+
+function neutron_plugin_configure_plugin_agent() {
+ # Set up integration bridge
+ _neutron_ovs_base_setup_bridge $OVS_BRIDGE
+ if [ -n "$RYU_INTERNAL_INTERFACE" ]; then
+ sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $RYU_INTERNAL_INTERFACE
+ fi
+ iniset /$Q_PLUGIN_CONF_FILE ovs integration_bridge $OVS_BRIDGE
+ AGENT_BINARY="$NEUTRON_DIR/neutron/plugins/ryu/agent/ryu_neutron_agent.py"
+
+ _neutron_ovs_base_configure_firewall_driver
+}
+
+function neutron_plugin_configure_service() {
+ iniset /$Q_PLUGIN_CONF_FILE ovs openflow_rest_api $RYU_API_HOST:$RYU_API_PORT
+
+ _neutron_ovs_base_configure_firewall_driver
+}
+
+function neutron_plugin_setup_interface_driver() {
+ local conf_file=$1
+ iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
+ iniset $conf_file DEFAULT ovs_use_veth True
+}
+
+function has_neutron_plugin_security_group() {
+ # 0 means True here
+ return 0
+}
+
+function neutron_plugin_check_adv_test_requirements() {
+ is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
+}
+
+# Restore xtrace
+$MY_XTRACE
diff --git a/lib/quantum_plugins/services/loadbalancer b/lib/neutron_plugins/services/loadbalancer
similarity index 68%
rename from lib/quantum_plugins/services/loadbalancer
rename to lib/neutron_plugins/services/loadbalancer
index ac8501f..49e286a 100644
--- a/lib/quantum_plugins/services/loadbalancer
+++ b/lib/neutron_plugins/services/loadbalancer
@@ -1,4 +1,4 @@
-# Quantum loadbalancer plugin
+# Neutron loadbalancer plugin
# ---------------------------
# Save trace setting
@@ -6,10 +6,10 @@
set +o xtrace
-AGENT_LBAAS_BINARY="$QUANTUM_DIR/bin/quantum-lbaas-agent"
-LBAAS_PLUGIN=quantum.services.loadbalancer.plugin.LoadBalancerPlugin
+AGENT_LBAAS_BINARY="$NEUTRON_BIN_DIR/neutron-lbaas-agent"
+LBAAS_PLUGIN=neutron.services.loadbalancer.plugin.LoadBalancerPlugin
-function quantum_agent_lbaas_install_agent_packages() {
+function neutron_agent_lbaas_install_agent_packages() {
if is_ubuntu || is_fedora; then
install_package haproxy
elif is_suse; then
@@ -18,7 +18,7 @@
fi
}
-function quantum_agent_lbaas_configure_common() {
+function neutron_agent_lbaas_configure_common() {
if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then
Q_SERVICE_PLUGIN_CLASSES=$LBAAS_PLUGIN
else
@@ -26,20 +26,20 @@
fi
}
-function quantum_agent_lbaas_configure_agent() {
- LBAAS_AGENT_CONF_PATH=/etc/quantum/services/loadbalancer/haproxy
+function neutron_agent_lbaas_configure_agent() {
+ LBAAS_AGENT_CONF_PATH=/etc/neutron/services/loadbalancer/haproxy
mkdir -p $LBAAS_AGENT_CONF_PATH
LBAAS_AGENT_CONF_FILENAME="$LBAAS_AGENT_CONF_PATH/lbaas_agent.ini"
- cp $QUANTUM_DIR/etc/lbaas_agent.ini $LBAAS_AGENT_CONF_FILENAME
+ cp $NEUTRON_DIR/etc/lbaas_agent.ini $LBAAS_AGENT_CONF_FILENAME
iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT use_namespaces $Q_USE_NAMESPACE
# ovs_use_veth needs to be set before the plugin configuration
# occurs to allow plugins to override the setting.
iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT ovs_use_veth $Q_OVS_USE_VETH
- quantum_plugin_setup_interface_driver $LBAAS_AGENT_CONF_FILENAME
+ neutron_plugin_setup_interface_driver $LBAAS_AGENT_CONF_FILENAME
if is_fedora; then
iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT user_group "nobody"
diff --git a/lib/quantum_thirdparty/README.md b/lib/neutron_thirdparty/README.md
similarity index 78%
rename from lib/quantum_thirdparty/README.md
rename to lib/neutron_thirdparty/README.md
index 3b5837d..b289f58 100644
--- a/lib/quantum_thirdparty/README.md
+++ b/lib/neutron_thirdparty/README.md
@@ -1,7 +1,7 @@
-Quantum third party specific files
+Neutron third party specific files
==================================
-Some Quantum plugins require third party programs to function.
-The files under the directory, ``lib/quantum_thirdparty/``, will be used
+Some Neutron plugins require third party programs to function.
+The files under the directory, ``lib/neutron_thirdparty/``, will be used
when their service are enabled.
Third party program specific configuration variables should be in this file.
@@ -10,7 +10,7 @@
functions
---------
-``lib/quantum`` calls the following functions when the ``<third_party>`` is enabled
+``lib/neutron`` calls the following functions when the ``<third_party>`` is enabled
functions to be implemented
* ``configure_<third_party>``:
diff --git a/lib/quantum_thirdparty/bigswitch_floodlight b/lib/neutron_thirdparty/bigswitch_floodlight
similarity index 96%
rename from lib/quantum_thirdparty/bigswitch_floodlight
rename to lib/neutron_thirdparty/bigswitch_floodlight
index 385bd0d..ebde067 100644
--- a/lib/quantum_thirdparty/bigswitch_floodlight
+++ b/lib/neutron_thirdparty/bigswitch_floodlight
@@ -13,7 +13,7 @@
}
function init_bigswitch_floodlight() {
- install_quantum_agent_packages
+ install_neutron_agent_packages
echo -n "Installing OVS managed by the openflow controllers:"
echo ${BS_FL_CONTROLLERS_PORT}
diff --git a/lib/quantum_thirdparty/nicira b/lib/neutron_thirdparty/nicira
similarity index 100%
rename from lib/quantum_thirdparty/nicira
rename to lib/neutron_thirdparty/nicira
diff --git a/lib/quantum_thirdparty/ryu b/lib/neutron_thirdparty/ryu
similarity index 75%
rename from lib/quantum_thirdparty/ryu
rename to lib/neutron_thirdparty/ryu
index f1e9e7c..3b825a1 100644
--- a/lib/quantum_thirdparty/ryu
+++ b/lib/neutron_thirdparty/ryu
@@ -18,8 +18,8 @@
# Ryu Applications
RYU_APPS=${RYU_APPS:-ryu.app.simple_isolation,ryu.app.rest}
-# configure_ryu can be called multiple times as quantum_pluing/ryu may call
-# this function for quantum-ryu-agent
+# configure_ryu can be called multiple times as neutron_pluing/ryu may call
+# this function for neutron-ryu-agent
_RYU_CONFIGURED=${_RYU_CONFIGURED:-False}
function configure_ryu() {
if [[ "$_RYU_CONFIGURED" == "False" ]]; then
@@ -44,19 +44,19 @@
wsapi_port=$RYU_API_PORT
ofp_listen_host=$RYU_OFP_HOST
ofp_tcp_listen_port=$RYU_OFP_PORT
-quantum_url=http://$Q_HOST:$Q_PORT
-quantum_admin_username=$Q_ADMIN_USERNAME
-quantum_admin_password=$SERVICE_PASSWORD
-quantum_admin_tenant_name=$SERVICE_TENANT_NAME
-quantum_admin_auth_url=$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0
-quantum_auth_strategy=$Q_AUTH_STRATEGY
-quantum_controller_addr=tcp:$RYU_OFP_HOST:$RYU_OFP_PORT
+neutron_url=http://$Q_HOST:$Q_PORT
+neutron_admin_username=$Q_ADMIN_USERNAME
+neutron_admin_password=$SERVICE_PASSWORD
+neutron_admin_tenant_name=$SERVICE_TENANT_NAME
+neutron_admin_auth_url=$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0
+neutron_auth_strategy=$Q_AUTH_STRATEGY
+neutron_controller_addr=tcp:$RYU_OFP_HOST:$RYU_OFP_PORT
"}
echo "${RYU_CONF_CONTENTS}" > $RYU_CONF
}
-# install_ryu can be called multiple times as quantum_pluing/ryu may call
-# this function for quantum-ryu-agent
+# install_ryu can be called multiple times as neutron_pluing/ryu may call
+# this function for neutron-ryu-agent
# Make this function idempotent and avoid cloning same repo many times
# with RECLONE=yes
_RYU_INSTALLED=${_RYU_INSTALLED:-False}
diff --git a/lib/quantum_thirdparty/trema b/lib/neutron_thirdparty/trema
similarity index 100%
rename from lib/quantum_thirdparty/trema
rename to lib/neutron_thirdparty/trema
diff --git a/lib/nova b/lib/nova
index afc540e..24d5cf9 100644
--- a/lib/nova
+++ b/lib/nova
@@ -81,7 +81,7 @@
GUEST_INTERFACE_DEFAULT=eth1
# Allow ``build_domU.sh`` to specify the flat network bridge via kernel args
FLAT_NETWORK_BRIDGE_DEFAULT=$(sed -e 's/.* flat_network_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline)
- if is_service_enabled quantum; then
+ if is_service_enabled neutron; then
XEN_INTEGRATION_BRIDGE=$(sed -e 's/.* xen_integration_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline)
fi
elif [ "$VIRT_DRIVER" = 'baremetal' ]; then
@@ -281,7 +281,7 @@
fi
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
- if is_service_enabled quantum && is_quantum_ovs_base_plugin && ! sudo grep -q '^cgroup_device_acl' $QEMU_CONF; then
+ if is_service_enabled neutron && is_neutron_ovs_base_plugin && ! sudo grep -q '^cgroup_device_acl' $QEMU_CONF; then
# Add /dev/net/tun to cgroup_device_acls, needed for type=ethernet interfaces
cat <<EOF | sudo tee -a $QEMU_CONF
cgroup_device_acl = [
diff --git a/lib/quantum b/lib/quantum
deleted file mode 100644
index a870865..0000000
--- a/lib/quantum
+++ /dev/null
@@ -1,808 +0,0 @@
-# lib/quantum
-# functions - funstions specific to quantum
-
-# Dependencies:
-# ``functions`` file
-# ``DEST`` must be defined
-
-# ``stack.sh`` calls the entry points in this order:
-#
-# install_quantum
-# install_quantumclient
-# install_quantum_agent_packages
-# install_quantum_third_party
-# configure_quantum
-# init_quantum
-# configure_quantum_third_party
-# init_quantum_third_party
-# start_quantum_third_party
-# create_nova_conf_quantum
-# start_quantum_service_and_check
-# create_quantum_initial_network
-# setup_quantum_debug
-# start_quantum_agents
-#
-# ``unstack.sh`` calls the entry points in this order:
-#
-# stop_quantum
-
-# Functions in lib/quantum are classified into the following categories:
-#
-# - entry points (called from stack.sh or unstack.sh)
-# - internal functions
-# - quantum exercises
-# - 3rd party programs
-
-
-# Quantum Networking
-# ------------------
-
-# Make sure that quantum is enabled in ``ENABLED_SERVICES``. If you want
-# to run Quantum on this host, make sure that q-svc is also in
-# ``ENABLED_SERVICES``.
-#
-# If you're planning to use the Quantum openvswitch plugin, set
-# ``Q_PLUGIN`` to "openvswitch" and make sure the q-agt service is enabled
-# in ``ENABLED_SERVICES``. If you're planning to use the Quantum
-# linuxbridge plugin, set ``Q_PLUGIN`` to "linuxbridge" and make sure the
-# q-agt service is enabled in ``ENABLED_SERVICES``.
-#
-# See "Quantum Network Configuration" below for additional variables
-# that must be set in localrc for connectivity across hosts with
-# Quantum.
-#
-# With Quantum networking the NETWORK_MANAGER variable is ignored.
-#
-# To enable specific configuration options for either the Open vSwitch or
-# LinuxBridge plugin, please see the top level README file under the
-# Quantum section.
-
-# Save trace setting
-XTRACE=$(set +o | grep xtrace)
-set +o xtrace
-
-
-# Quantum Network Configuration
-# -----------------------------
-
-# Gateway and subnet defaults, in case they are not customized in localrc
-NETWORK_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
-PUBLIC_NETWORK_GATEWAY=${PUBLIC_NETWORK_GATEWAY:-172.24.4.225}
-PRIVATE_SUBNET_NAME=${PRIVATE_SUBNET_NAME:-"private-subnet"}
-PUBLIC_SUBNET_NAME=${PUBLIC_SUBNET_NAME:-"public-subnet"}
-
-# Set up default directories
-QUANTUM_DIR=$DEST/neutron
-QUANTUMCLIENT_DIR=$DEST/python-neutronclient
-QUANTUM_AUTH_CACHE_DIR=${QUANTUM_AUTH_CACHE_DIR:-/var/cache/quantum}
-
-QUANTUM_CONF_DIR=/etc/quantum
-QUANTUM_CONF=$QUANTUM_CONF_DIR/quantum.conf
-export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"$QUANTUM_CONF_DIR/debug.ini"}
-
-# Default Quantum Plugin
-Q_PLUGIN=${Q_PLUGIN:-openvswitch}
-# Default Quantum Port
-Q_PORT=${Q_PORT:-9696}
-# Default Quantum Host
-Q_HOST=${Q_HOST:-$SERVICE_HOST}
-# Default admin username
-Q_ADMIN_USERNAME=${Q_ADMIN_USERNAME:-quantum}
-# Default auth strategy
-Q_AUTH_STRATEGY=${Q_AUTH_STRATEGY:-keystone}
-# Use namespace or not
-Q_USE_NAMESPACE=${Q_USE_NAMESPACE:-True}
-# RHEL's support for namespaces requires using veths with ovs
-Q_OVS_USE_VETH=${Q_OVS_USE_VETH:-False}
-Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP:-True}
-# Meta data IP
-Q_META_DATA_IP=${Q_META_DATA_IP:-$SERVICE_HOST}
-# Allow Overlapping IP among subnets
-Q_ALLOW_OVERLAPPING_IP=${Q_ALLOW_OVERLAPPING_IP:-True}
-# Use quantum-debug command
-Q_USE_DEBUG_COMMAND=${Q_USE_DEBUG_COMMAND:-False}
-# The name of the default q-l3 router
-Q_ROUTER_NAME=${Q_ROUTER_NAME:-router1}
-# List of config file names in addition to the main plugin config file
-# See _configure_quantum_common() for details about setting it up
-declare -a Q_PLUGIN_EXTRA_CONF_FILES
-
-if is_service_enabled quantum; then
- Q_RR_CONF_FILE=$QUANTUM_CONF_DIR/rootwrap.conf
- if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
- Q_RR_COMMAND="sudo"
- else
- QUANTUM_ROOTWRAP=$(get_rootwrap_location quantum)
- Q_RR_COMMAND="sudo $QUANTUM_ROOTWRAP $Q_RR_CONF_FILE"
- fi
-
- # Provider Network Configurations
- # --------------------------------
-
- # The following variables control the Quantum openvswitch and
- # linuxbridge plugins' allocation of tenant networks and
- # availability of provider networks. If these are not configured
- # in ``localrc``, tenant networks will be local to the host (with no
- # remote connectivity), and no physical resources will be
- # available for the allocation of provider networks.
-
- # To use GRE tunnels for tenant networks, set to True in
- # ``localrc``. GRE tunnels are only supported by the openvswitch
- # plugin, and currently only on Ubuntu.
- ENABLE_TENANT_TUNNELS=${ENABLE_TENANT_TUNNELS:-False}
-
- # If using GRE tunnels for tenant networks, specify the range of
- # tunnel IDs from which tenant networks are allocated. Can be
- # overriden in ``localrc`` in necesssary.
- TENANT_TUNNEL_RANGES=${TENANT_TUNNEL_RANGE:-1:1000}
-
- # To use VLANs for tenant networks, set to True in localrc. VLANs
- # are supported by the openvswitch and linuxbridge plugins, each
- # requiring additional configuration described below.
- ENABLE_TENANT_VLANS=${ENABLE_TENANT_VLANS:-False}
-
- # If using VLANs for tenant networks, set in ``localrc`` to specify
- # the range of VLAN VIDs from which tenant networks are
- # allocated. An external network switch must be configured to
- # trunk these VLANs between hosts for multi-host connectivity.
- #
- # Example: ``TENANT_VLAN_RANGE=1000:1999``
- TENANT_VLAN_RANGE=${TENANT_VLAN_RANGE:-}
-
- # If using VLANs for tenant networks, or if using flat or VLAN
- # provider networks, set in ``localrc`` to the name of the physical
- # network, and also configure ``OVS_PHYSICAL_BRIDGE`` for the
- # openvswitch agent or ``LB_PHYSICAL_INTERFACE`` for the linuxbridge
- # agent, as described below.
- #
- # Example: ``PHYSICAL_NETWORK=default``
- PHYSICAL_NETWORK=${PHYSICAL_NETWORK:-}
-
- # With the openvswitch plugin, if using VLANs for tenant networks,
- # or if using flat or VLAN provider networks, set in ``localrc`` to
- # the name of the OVS bridge to use for the physical network. The
- # bridge will be created if it does not already exist, but a
- # physical interface must be manually added to the bridge as a
- # port for external connectivity.
- #
- # Example: ``OVS_PHYSICAL_BRIDGE=br-eth1``
- OVS_PHYSICAL_BRIDGE=${OVS_PHYSICAL_BRIDGE:-}
-
- # With the linuxbridge plugin, if using VLANs for tenant networks,
- # or if using flat or VLAN provider networks, set in ``localrc`` to
- # the name of the network interface to use for the physical
- # network.
- #
- # Example: ``LB_PHYSICAL_INTERFACE=eth1``
- LB_PHYSICAL_INTERFACE=${LB_PHYSICAL_INTERFACE:-}
-
- # With the openvswitch plugin, set to True in ``localrc`` to enable
- # provider GRE tunnels when ``ENABLE_TENANT_TUNNELS`` is False.
- #
- # Example: ``OVS_ENABLE_TUNNELING=True``
- OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-$ENABLE_TENANT_TUNNELS}
-fi
-
-# Quantum plugin specific functions
-# ---------------------------------
-
-# Please refer to ``lib/quantum_plugins/README.md`` for details.
-source $TOP_DIR/lib/quantum_plugins/$Q_PLUGIN
-
-# Agent loadbalancer service plugin functions
-# -------------------------------------------
-
-# Hardcoding for 1 service plugin for now
-source $TOP_DIR/lib/quantum_plugins/services/loadbalancer
-
-# Use security group or not
-if has_quantum_plugin_security_group; then
- Q_USE_SECGROUP=${Q_USE_SECGROUP:-True}
-else
- Q_USE_SECGROUP=False
-fi
-
-# Functions
-# ---------
-
-# configure_quantum()
-# Set common config for all quantum server and agents.
-function configure_quantum() {
- _configure_quantum_common
- iniset_rpc_backend quantum $QUANTUM_CONF DEFAULT
-
- # goes before q-svc to init Q_SERVICE_PLUGIN_CLASSES
- if is_service_enabled q-lbaas; then
- _configure_quantum_lbaas
- fi
- if is_service_enabled q-svc; then
- _configure_quantum_service
- fi
- if is_service_enabled q-agt; then
- _configure_quantum_plugin_agent
- fi
- if is_service_enabled q-dhcp; then
- _configure_quantum_dhcp_agent
- fi
- if is_service_enabled q-l3; then
- _configure_quantum_l3_agent
- fi
- if is_service_enabled q-meta; then
- _configure_quantum_metadata_agent
- fi
-
- _configure_quantum_debug_command
-}
-
-function create_nova_conf_quantum() {
- iniset $NOVA_CONF DEFAULT network_api_class "nova.network.quantumv2.api.API"
- iniset $NOVA_CONF DEFAULT quantum_admin_username "$Q_ADMIN_USERNAME"
- iniset $NOVA_CONF DEFAULT quantum_admin_password "$SERVICE_PASSWORD"
- iniset $NOVA_CONF DEFAULT quantum_admin_auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0"
- iniset $NOVA_CONF DEFAULT quantum_auth_strategy "$Q_AUTH_STRATEGY"
- iniset $NOVA_CONF DEFAULT quantum_admin_tenant_name "$SERVICE_TENANT_NAME"
- iniset $NOVA_CONF DEFAULT quantum_url "http://$Q_HOST:$Q_PORT"
-
- if [[ "$Q_USE_SECGROUP" == "True" ]]; then
- LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver
- iniset $NOVA_CONF DEFAULT security_group_api quantum
- fi
-
- # set NOVA_VIF_DRIVER and optionally set options in nova_conf
- quantum_plugin_create_nova_conf
-
- iniset $NOVA_CONF DEFAULT libvirt_vif_driver "$NOVA_VIF_DRIVER"
- iniset $NOVA_CONF DEFAULT linuxnet_interface_driver "$LINUXNET_VIF_DRIVER"
- if is_service_enabled q-meta; then
- iniset $NOVA_CONF DEFAULT service_quantum_metadata_proxy "True"
- fi
-}
-
-# create_quantum_accounts() - Set up common required quantum accounts
-
-# Tenant User Roles
-# ------------------------------------------------------------------
-# service quantum admin # if enabled
-
-# Migrated from keystone_data.sh
-function create_quantum_accounts() {
-
- SERVICE_TENANT=$(keystone tenant-list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
- ADMIN_ROLE=$(keystone role-list | awk "/ admin / { print \$2 }")
-
- if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then
- QUANTUM_USER=$(keystone user-create \
- --name=quantum \
- --pass="$SERVICE_PASSWORD" \
- --tenant_id $SERVICE_TENANT \
- --email=quantum@example.com \
- | grep " id " | get_field 2)
- keystone user-role-add \
- --tenant_id $SERVICE_TENANT \
- --user_id $QUANTUM_USER \
- --role_id $ADMIN_ROLE
- if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
- QUANTUM_SERVICE=$(keystone service-create \
- --name=quantum \
- --type=network \
- --description="Quantum Service" \
- | grep " id " | get_field 2)
- keystone endpoint-create \
- --region RegionOne \
- --service_id $QUANTUM_SERVICE \
- --publicurl "http://$SERVICE_HOST:9696/" \
- --adminurl "http://$SERVICE_HOST:9696/" \
- --internalurl "http://$SERVICE_HOST:9696/"
- fi
- fi
-}
-
-function create_quantum_initial_network() {
- TENANT_ID=$(keystone tenant-list | grep " demo " | get_field 1)
-
- # Create a small network
- # Since quantum command is executed in admin context at this point,
- # ``--tenant_id`` needs to be specified.
- if is_baremetal; then
- sudo ovs-vsctl add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE
- for IP in $(ip addr show dev $PUBLIC_INTERFACE | grep ' inet ' | awk '{print $2}'); do
- sudo ip addr del $IP dev $PUBLIC_INTERFACE
- sudo ip addr add $IP dev $OVS_PHYSICAL_BRIDGE
- done
- NET_ID=$(quantum net-create $PHYSICAL_NETWORK --tenant_id $TENANT_ID --provider:network_type flat --provider:physical_network "$PHYSICAL_NETWORK" | grep ' id ' | get_field 2)
- SUBNET_ID=$(quantum subnet-create --tenant_id $TENANT_ID --ip_version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} --gateway $NETWORK_GATEWAY --name $PRIVATE_SUBNET_NAME $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
- sudo ifconfig $OVS_PHYSICAL_BRIDGE up
- else
- NET_ID=$(quantum net-create --tenant_id $TENANT_ID "$PRIVATE_NETWORK_NAME" | grep ' id ' | get_field 2)
- SUBNET_ID=$(quantum subnet-create --tenant_id $TENANT_ID --ip_version 4 --gateway $NETWORK_GATEWAY --name $PRIVATE_SUBNET_NAME $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
- fi
-
- if [[ "$Q_L3_ENABLED" == "True" ]]; then
- # Create a router, and add the private subnet as one of its interfaces
- if [[ "$Q_L3_ROUTER_PER_TENANT" == "True" ]]; then
- # create a tenant-owned router.
- ROUTER_ID=$(quantum router-create --tenant_id $TENANT_ID $Q_ROUTER_NAME | grep ' id ' | get_field 2)
- else
- # Plugin only supports creating a single router, which should be admin owned.
- ROUTER_ID=$(quantum router-create $Q_ROUTER_NAME | grep ' id ' | get_field 2)
- fi
- quantum router-interface-add $ROUTER_ID $SUBNET_ID
- # Create an external network, and a subnet. Configure the external network as router gw
- EXT_NET_ID=$(quantum net-create "$PUBLIC_NETWORK_NAME" -- --router:external=True | grep ' id ' | get_field 2)
- EXT_GW_IP=$(quantum subnet-create --ip_version 4 ${Q_FLOATING_ALLOCATION_POOL:+--allocation-pool $Q_FLOATING_ALLOCATION_POOL} --gateway $PUBLIC_NETWORK_GATEWAY --name $PUBLIC_SUBNET_NAME $EXT_NET_ID $FLOATING_RANGE -- --enable_dhcp=False | grep 'gateway_ip' | get_field 2)
- quantum router-gateway-set $ROUTER_ID $EXT_NET_ID
-
- if is_service_enabled q-l3; then
- # logic is specific to using the l3-agent for l3
- if is_quantum_ovs_base_plugin && [[ "$Q_USE_NAMESPACE" = "True" ]]; then
- CIDR_LEN=${FLOATING_RANGE#*/}
- sudo ip addr add $EXT_GW_IP/$CIDR_LEN dev $PUBLIC_BRIDGE
- sudo ip link set $PUBLIC_BRIDGE up
- ROUTER_GW_IP=`quantum port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F '"' '{ print $8; }'`
- sudo route add -net $FIXED_RANGE gw $ROUTER_GW_IP
- fi
- if [[ "$Q_USE_NAMESPACE" == "False" ]]; then
- # Explicitly set router id in l3 agent configuration
- iniset $Q_L3_CONF_FILE DEFAULT router_id $ROUTER_ID
- fi
- fi
- fi
-}
-
-# init_quantum() - Initialize databases, etc.
-function init_quantum() {
- :
-}
-
-# install_quantum() - Collect source and prepare
-function install_quantum() {
- git_clone $QUANTUM_REPO $QUANTUM_DIR $QUANTUM_BRANCH
- setup_develop $QUANTUM_DIR
-}
-
-# install_quantumclient() - Collect source and prepare
-function install_quantumclient() {
- git_clone $QUANTUMCLIENT_REPO $QUANTUMCLIENT_DIR $QUANTUMCLIENT_BRANCH
- setup_develop $QUANTUMCLIENT_DIR
-}
-
-# install_quantum_agent_packages() - Collect source and prepare
-function install_quantum_agent_packages() {
- # install packages that are specific to plugin agent(s)
- if is_service_enabled q-agt q-dhcp q-l3; then
- quantum_plugin_install_agent_packages
- fi
-
- if is_service_enabled q-lbaas; then
- quantum_agent_lbaas_install_agent_packages
- fi
-}
-
-# Start running processes, including screen
-function start_quantum_service_and_check() {
- # build config-file options
- local cfg_file
- local CFG_FILE_OPTIONS="--config-file $QUANTUM_CONF --config-file /$Q_PLUGIN_CONF_FILE"
- for cfg_file in ${Q_PLUGIN_EXTRA_CONF_FILES[@]}; do
- CFG_FILE_OPTIONS+=" --config-file /$cfg_file"
- done
- # Start the Quantum service
- screen_it q-svc "cd $QUANTUM_DIR && python $QUANTUM_DIR/bin/quantum-server $CFG_FILE_OPTIONS"
- echo "Waiting for Quantum to start..."
- if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://$Q_HOST:$Q_PORT; do sleep 1; done"; then
- die $LINENO "Quantum did not start"
- fi
-}
-
-# Start running processes, including screen
-function start_quantum_agents() {
- # Start up the quantum agents if enabled
- screen_it q-agt "cd $QUANTUM_DIR && python $AGENT_BINARY --config-file $QUANTUM_CONF --config-file /$Q_PLUGIN_CONF_FILE"
- screen_it q-dhcp "cd $QUANTUM_DIR && python $AGENT_DHCP_BINARY --config-file $QUANTUM_CONF --config-file=$Q_DHCP_CONF_FILE"
- screen_it q-l3 "cd $QUANTUM_DIR && python $AGENT_L3_BINARY --config-file $QUANTUM_CONF --config-file=$Q_L3_CONF_FILE"
- screen_it q-meta "cd $QUANTUM_DIR && python $AGENT_META_BINARY --config-file $QUANTUM_CONF --config-file=$Q_META_CONF_FILE"
-
- if [ "$VIRT_DRIVER" = 'xenserver' ]; then
- # For XenServer, start an agent for the domU openvswitch
- screen_it q-domua "cd $QUANTUM_DIR && python $AGENT_BINARY --config-file $QUANTUM_CONF --config-file /$Q_PLUGIN_CONF_FILE.domU"
- fi
-
- if is_service_enabled q-lbaas; then
- screen_it q-lbaas "cd $QUANTUM_DIR && python $AGENT_LBAAS_BINARY --config-file $QUANTUM_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME"
- fi
-}
-
-# stop_quantum() - Stop running processes (non-screen)
-function stop_quantum() {
- if is_service_enabled q-dhcp; then
- pid=$(ps aux | awk '/[d]nsmasq.+interface=(tap|ns-)/ { print $2 }')
- [ ! -z "$pid" ] && sudo kill -9 $pid
- fi
- if is_service_enabled q-meta; then
- pid=$(ps aux | awk '/quantum-ns-metadata-proxy/ { print $2 }')
- [ ! -z "$pid" ] && sudo kill -9 $pid
- fi
-}
-
-# cleanup_quantum() - Remove residual data files, anything left over from previous
-# runs that a clean run would need to clean up
-function cleanup_quantum() {
- if is_quantum_ovs_base_plugin; then
- quantum_ovs_base_cleanup
- fi
-
- # delete all namespaces created by quantum
- for ns in $(sudo ip netns list | grep -o -e qdhcp-[0-9a-f\-]* -e qrouter-[0-9a-f\-]*); do
- sudo ip netns delete ${ns}
- done
-}
-
-# _configure_quantum_common()
-# Set common config for all quantum server and agents.
-# This MUST be called before other ``_configure_quantum_*`` functions.
-function _configure_quantum_common() {
- # Put config files in ``QUANTUM_CONF_DIR`` for everyone to find
- if [[ ! -d $QUANTUM_CONF_DIR ]]; then
- sudo mkdir -p $QUANTUM_CONF_DIR
- fi
- sudo chown $STACK_USER $QUANTUM_CONF_DIR
-
- cp $QUANTUM_DIR/etc/quantum.conf $QUANTUM_CONF
-
- # Set plugin-specific variables ``Q_DB_NAME``, ``Q_PLUGIN_CLASS``.
- # For main plugin config file, set ``Q_PLUGIN_CONF_PATH``, ``Q_PLUGIN_CONF_FILENAME``.
- # For addition plugin config files, set ``Q_PLUGIN_EXTRA_CONF_PATH``,
- # ``Q_PLUGIN_EXTRA_CONF_FILES``. For example:
- # ``Q_PLUGIN_EXTRA_CONF_FILES=(file1, file2)``
- quantum_plugin_configure_common
-
- if [[ $Q_PLUGIN_CONF_PATH == '' || $Q_PLUGIN_CONF_FILENAME == '' || $Q_PLUGIN_CLASS == '' ]]; then
- die $LINENO "Quantum plugin not set.. exiting"
- fi
-
- # If needed, move config file from ``$QUANTUM_DIR/etc/quantum`` to ``QUANTUM_CONF_DIR``
- mkdir -p /$Q_PLUGIN_CONF_PATH
- Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME
- cp $QUANTUM_DIR/$Q_PLUGIN_CONF_FILE /$Q_PLUGIN_CONF_FILE
-
- iniset /$Q_PLUGIN_CONF_FILE database connection `database_connection_url $Q_DB_NAME`
- iniset $QUANTUM_CONF DEFAULT state_path $DATA_DIR/quantum
-
- # If addition config files are set, make sure their path name is set as well
- if [[ ${#Q_PLUGIN_EXTRA_CONF_FILES[@]} > 0 && $Q_PLUGIN_EXTRA_CONF_PATH == '' ]]; then
- die $LINENO "Quantum additional plugin config not set.. exiting"
- fi
-
- # If additional config files exist, copy them over to quantum configuration
- # directory
- if [[ $Q_PLUGIN_EXTRA_CONF_PATH != '' ]]; then
- mkdir -p /$Q_PLUGIN_EXTRA_CONF_PATH
- local f
- for (( f=0; $f < ${#Q_PLUGIN_EXTRA_CONF_FILES[@]}; f+=1 )); do
- Q_PLUGIN_EXTRA_CONF_FILES[$f]=$Q_PLUGIN_EXTRA_CONF_PATH/${Q_PLUGIN_EXTRA_CONF_FILES[$f]}
- cp $QUANTUM_DIR/${Q_PLUGIN_EXTRA_CONF_FILES[$f]} /${Q_PLUGIN_EXTRA_CONF_FILES[$f]}
- done
- fi
-
- _quantum_setup_rootwrap
-}
-
-function _configure_quantum_debug_command() {
- if [[ "$Q_USE_DEBUG_COMMAND" != "True" ]]; then
- return
- fi
-
- cp $QUANTUM_DIR/etc/l3_agent.ini $QUANTUM_TEST_CONFIG_FILE
-
- iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT verbose False
- iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT debug False
- iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
- iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT root_helper "$Q_RR_COMMAND"
- # Intermediate fix until Quantum patch lands and then line above will
- # be cleaned.
- iniset $QUANTUM_TEST_CONFIG_FILE agent root_helper "$Q_RR_COMMAND"
-
- _quantum_setup_keystone $QUANTUM_TEST_CONFIG_FILE DEFAULT set_auth_url
- _quantum_setup_interface_driver $QUANTUM_TEST_CONFIG_FILE
-
- quantum_plugin_configure_debug_command
-}
-
-function _configure_quantum_dhcp_agent() {
- AGENT_DHCP_BINARY="$QUANTUM_DIR/bin/quantum-dhcp-agent"
- Q_DHCP_CONF_FILE=$QUANTUM_CONF_DIR/dhcp_agent.ini
-
- cp $QUANTUM_DIR/etc/dhcp_agent.ini $Q_DHCP_CONF_FILE
-
- iniset $Q_DHCP_CONF_FILE DEFAULT verbose True
- iniset $Q_DHCP_CONF_FILE DEFAULT debug True
- iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
- iniset $Q_DHCP_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
-
- _quantum_setup_keystone $Q_DHCP_CONF_FILE DEFAULT set_auth_url
- _quantum_setup_interface_driver $Q_DHCP_CONF_FILE
-
- quantum_plugin_configure_dhcp_agent
-}
-
-function _configure_quantum_l3_agent() {
- Q_L3_ENABLED=True
- # for l3-agent, only use per tenant router if we have namespaces
- Q_L3_ROUTER_PER_TENANT=$Q_USE_NAMESPACE
- AGENT_L3_BINARY="$QUANTUM_DIR/bin/quantum-l3-agent"
- Q_L3_CONF_FILE=$QUANTUM_CONF_DIR/l3_agent.ini
-
- cp $QUANTUM_DIR/etc/l3_agent.ini $Q_L3_CONF_FILE
-
- iniset $Q_L3_CONF_FILE DEFAULT verbose True
- iniset $Q_L3_CONF_FILE DEFAULT debug True
- iniset $Q_L3_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
- iniset $Q_L3_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
-
- _quantum_setup_keystone $Q_L3_CONF_FILE DEFAULT set_auth_url
- _quantum_setup_interface_driver $Q_L3_CONF_FILE
-
- quantum_plugin_configure_l3_agent
-}
-
-function _configure_quantum_metadata_agent() {
- AGENT_META_BINARY="$QUANTUM_DIR/bin/quantum-metadata-agent"
- Q_META_CONF_FILE=$QUANTUM_CONF_DIR/metadata_agent.ini
-
- cp $QUANTUM_DIR/etc/metadata_agent.ini $Q_META_CONF_FILE
-
- iniset $Q_META_CONF_FILE DEFAULT verbose True
- iniset $Q_META_CONF_FILE DEFAULT debug True
- iniset $Q_META_CONF_FILE DEFAULT nova_metadata_ip $Q_META_DATA_IP
- iniset $Q_META_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
-
- _quantum_setup_keystone $Q_META_CONF_FILE DEFAULT set_auth_url
-}
-
-function _configure_quantum_lbaas() {
- quantum_agent_lbaas_configure_common
- quantum_agent_lbaas_configure_agent
-}
-
-# _configure_quantum_plugin_agent() - Set config files for quantum plugin agent
-# It is called when q-agt is enabled.
-function _configure_quantum_plugin_agent() {
- # Specify the default root helper prior to agent configuration to
- # ensure that an agent's configuration can override the default
- iniset /$Q_PLUGIN_CONF_FILE agent root_helper "$Q_RR_COMMAND"
- iniset $QUANTUM_CONF DEFAULT verbose True
- iniset $QUANTUM_CONF DEFAULT debug True
-
- # Configure agent for plugin
- quantum_plugin_configure_plugin_agent
-}
-
-# _configure_quantum_service() - Set config files for quantum service
-# It is called when q-svc is enabled.
-function _configure_quantum_service() {
- Q_API_PASTE_FILE=$QUANTUM_CONF_DIR/api-paste.ini
- Q_POLICY_FILE=$QUANTUM_CONF_DIR/policy.json
-
- cp $QUANTUM_DIR/etc/api-paste.ini $Q_API_PASTE_FILE
- cp $QUANTUM_DIR/etc/policy.json $Q_POLICY_FILE
-
- if is_service_enabled $DATABASE_BACKENDS; then
- recreate_database $Q_DB_NAME utf8
- else
- die $LINENO "A database must be enabled in order to use the $Q_PLUGIN Quantum plugin."
- fi
-
- # Update either configuration file with plugin
- iniset $QUANTUM_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS
-
- if [[ $Q_SERVICE_PLUGIN_CLASSES != '' ]]; then
- iniset $QUANTUM_CONF DEFAULT service_plugins $Q_SERVICE_PLUGIN_CLASSES
- fi
-
- iniset $QUANTUM_CONF DEFAULT verbose True
- iniset $QUANTUM_CONF DEFAULT debug True
- iniset $QUANTUM_CONF DEFAULT policy_file $Q_POLICY_FILE
- iniset $QUANTUM_CONF DEFAULT allow_overlapping_ips $Q_ALLOW_OVERLAPPING_IP
-
- iniset $QUANTUM_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY
- _quantum_setup_keystone $QUANTUM_CONF keystone_authtoken
-
- # Configure plugin
- quantum_plugin_configure_service
-}
-
-# Utility Functions
-#------------------
-
-# _quantum_setup_rootwrap() - configure Quantum's rootwrap
-function _quantum_setup_rootwrap() {
- if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
- return
- fi
- # Deploy new rootwrap filters files (owned by root).
- # Wipe any existing ``rootwrap.d`` files first
- Q_CONF_ROOTWRAP_D=$QUANTUM_CONF_DIR/rootwrap.d
- if [[ -d $Q_CONF_ROOTWRAP_D ]]; then
- sudo rm -rf $Q_CONF_ROOTWRAP_D
- fi
- # Deploy filters to ``$QUANTUM_CONF_DIR/rootwrap.d``
- mkdir -p -m 755 $Q_CONF_ROOTWRAP_D
- cp -pr $QUANTUM_DIR/etc/quantum/rootwrap.d/* $Q_CONF_ROOTWRAP_D/
- sudo chown -R root:root $Q_CONF_ROOTWRAP_D
- sudo chmod 644 $Q_CONF_ROOTWRAP_D/*
- # Set up ``rootwrap.conf``, pointing to ``$QUANTUM_CONF_DIR/rootwrap.d``
- # location moved in newer versions, prefer new location
- if test -r $QUANTUM_DIR/etc/quantum/rootwrap.conf; then
- sudo cp -p $QUANTUM_DIR/etc/quantum/rootwrap.conf $Q_RR_CONF_FILE
- else
- sudo cp -p $QUANTUM_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE
- fi
- sudo sed -e "s:^filters_path=.*$:filters_path=$Q_CONF_ROOTWRAP_D:" -i $Q_RR_CONF_FILE
- sudo chown root:root $Q_RR_CONF_FILE
- sudo chmod 0644 $Q_RR_CONF_FILE
- # Specify ``rootwrap.conf`` as first parameter to quantum-rootwrap
- ROOTWRAP_SUDOER_CMD="$QUANTUM_ROOTWRAP $Q_RR_CONF_FILE *"
-
- # Set up the rootwrap sudoers for quantum
- TEMPFILE=`mktemp`
- echo "$USER ALL=(root) NOPASSWD: $ROOTWRAP_SUDOER_CMD" >$TEMPFILE
- chmod 0440 $TEMPFILE
- sudo chown root:root $TEMPFILE
- sudo mv $TEMPFILE /etc/sudoers.d/quantum-rootwrap
-
- # Update the root_helper
- iniset $QUANTUM_CONF agent root_helper "$Q_RR_COMMAND"
-}
-
-# Configures keystone integration for quantum service and agents
-function _quantum_setup_keystone() {
- local conf_file=$1
- local section=$2
- local use_auth_url=$3
- if [[ -n $use_auth_url ]]; then
- iniset $conf_file $section auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v2.0"
- else
- iniset $conf_file $section auth_host $KEYSTONE_SERVICE_HOST
- iniset $conf_file $section auth_port $KEYSTONE_AUTH_PORT
- iniset $conf_file $section auth_protocol $KEYSTONE_SERVICE_PROTOCOL
- fi
- iniset $conf_file $section admin_tenant_name $SERVICE_TENANT_NAME
- iniset $conf_file $section admin_user $Q_ADMIN_USERNAME
- iniset $conf_file $section admin_password $SERVICE_PASSWORD
- iniset $conf_file $section signing_dir $QUANTUM_AUTH_CACHE_DIR
- # Create cache dir
- sudo mkdir -p $QUANTUM_AUTH_CACHE_DIR
- sudo chown $STACK_USER $QUANTUM_AUTH_CACHE_DIR
- rm -f $QUANTUM_AUTH_CACHE_DIR/*
-}
-
-function _quantum_setup_interface_driver() {
-
- # ovs_use_veth needs to be set before the plugin configuration
- # occurs to allow plugins to override the setting.
- iniset $1 DEFAULT ovs_use_veth $Q_OVS_USE_VETH
-
- quantum_plugin_setup_interface_driver $1
-}
-
-# Functions for Quantum Exercises
-#--------------------------------
-
-function delete_probe() {
- local from_net="$1"
- net_id=`_get_net_id $from_net`
- probe_id=`quantum-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}'`
- quantum-debug --os-tenant-name admin --os-username admin probe-delete $probe_id
-}
-
-function setup_quantum_debug() {
- if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
- public_net_id=`_get_net_id $PUBLIC_NETWORK_NAME`
- quantum-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $public_net_id
- private_net_id=`_get_net_id $PRIVATE_NETWORK_NAME`
- quantum-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $private_net_id
- fi
-}
-
-function teardown_quantum_debug() {
- delete_probe $PUBLIC_NETWORK_NAME
- delete_probe $PRIVATE_NETWORK_NAME
-}
-
-function _get_net_id() {
- quantum --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD net-list | grep $1 | awk '{print $2}'
-}
-
-function _get_probe_cmd_prefix() {
- local from_net="$1"
- net_id=`_get_net_id $from_net`
- probe_id=`quantum-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}' | head -n 1`
- echo "$Q_RR_COMMAND ip netns exec qprobe-$probe_id"
-}
-
-function _ping_check_quantum() {
- local from_net=$1
- local ip=$2
- local timeout_sec=$3
- local expected=${4:-"True"}
- local check_command=""
- probe_cmd=`_get_probe_cmd_prefix $from_net`
- if [[ "$expected" = "True" ]]; then
- check_command="while ! $probe_cmd ping -w 1 -c 1 $ip; do sleep 1; done"
- else
- check_command="while $probe_cmd ping -w 1 -c 1 $ip; do sleep 1; done"
- fi
- if ! timeout $timeout_sec sh -c "$check_command"; then
- if [[ "$expected" = "True" ]]; then
- die $LINENO "[Fail] Couldn't ping server"
- else
- die $LINENO "[Fail] Could ping server"
- fi
- fi
-}
-
-# ssh check
-function _ssh_check_quantum() {
- local from_net=$1
- local key_file=$2
- local ip=$3
- local user=$4
- local timeout_sec=$5
- local probe_cmd = ""
- probe_cmd=`_get_probe_cmd_prefix $from_net`
- if ! timeout $timeout_sec sh -c "while ! $probe_cmd ssh -o StrictHostKeyChecking=no -i $key_file ${user}@$ip echo success; do sleep 1; done"; then
- die $LINENO "server didn't become ssh-able!"
- fi
-}
-
-# Quantum 3rd party programs
-#---------------------------
-
-# please refer to ``lib/quantum_thirdparty/README.md`` for details
-QUANTUM_THIRD_PARTIES=""
-for f in $TOP_DIR/lib/quantum_thirdparty/*; do
- third_party=$(basename $f)
- if is_service_enabled $third_party; then
- source $TOP_DIR/lib/quantum_thirdparty/$third_party
- QUANTUM_THIRD_PARTIES="$QUANTUM_THIRD_PARTIES,$third_party"
- fi
-done
-
-function _quantum_third_party_do() {
- for third_party in ${QUANTUM_THIRD_PARTIES//,/ }; do
- ${1}_${third_party}
- done
-}
-
-# configure_quantum_third_party() - Set config files, create data dirs, etc
-function configure_quantum_third_party() {
- _quantum_third_party_do configure
-}
-
-# init_quantum_third_party() - Initialize databases, etc.
-function init_quantum_third_party() {
- _quantum_third_party_do init
-}
-
-# install_quantum_third_party() - Collect source and prepare
-function install_quantum_third_party() {
- _quantum_third_party_do install
-}
-
-# start_quantum_third_party() - Start running processes, including screen
-function start_quantum_third_party() {
- _quantum_third_party_do start
-}
-
-# stop_quantum_third_party - Stop running processes (non-screen)
-function stop_quantum_third_party() {
- _quantum_third_party_do stop
-}
-
-
-# Restore xtrace
-$XTRACE
-
-# Local variables:
-# mode: shell-script
-# End:
diff --git a/lib/quantum_plugins/README.md b/lib/quantum_plugins/README.md
deleted file mode 100644
index e829940..0000000
--- a/lib/quantum_plugins/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-Quantum plugin specific files
-=============================
-Quantum plugins require plugin specific behavior.
-The files under the directory, ``lib/quantum_plugins/``, will be used
-when their service is enabled.
-Each plugin has ``lib/quantum_plugins/$Q_PLUGIN`` and define the following
-functions.
-Plugin specific configuration variables should be in this file.
-
-* filename: ``$Q_PLUGIN``
- * The corresponding file name MUST be the same to plugin name ``$Q_PLUGIN``.
- Plugin specific configuration variables should be in this file.
-
-functions
----------
-``lib/quantum`` calls the following functions when the ``$Q_PLUGIN`` is enabled
-
-* ``quantum_plugin_create_nova_conf`` :
- set ``NOVA_VIF_DRIVER`` and optionally set options in nova_conf
- e.g.
- NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
-* ``quantum_plugin_install_agent_packages`` :
- install packages that is specific to plugin agent
- e.g.
- install_package bridge-utils
-* ``quantum_plugin_configure_common`` :
- set plugin-specific variables, ``Q_PLUGIN_CONF_PATH``, ``Q_PLUGIN_CONF_FILENAME``,
- ``Q_DB_NAME``, ``Q_PLUGIN_CLASS``
-* ``quantum_plugin_configure_debug_command``
-* ``quantum_plugin_configure_dhcp_agent``
-* ``quantum_plugin_configure_l3_agent``
-* ``quantum_plugin_configure_plugin_agent``
-* ``quantum_plugin_configure_service``
-* ``quantum_plugin_setup_interface_driver``
-* ``has_quantum_plugin_security_group``:
- return 0 if the plugin support quantum security group otherwise return 1
-* ``quantum_plugin_check_adv_test_requirements``:
- return 0 if requirements are satisfied otherwise return 1
diff --git a/lib/quantum_plugins/bigswitch_floodlight b/lib/quantum_plugins/bigswitch_floodlight
deleted file mode 100644
index cae8882..0000000
--- a/lib/quantum_plugins/bigswitch_floodlight
+++ /dev/null
@@ -1,74 +0,0 @@
-# Quantum Big Switch/FloodLight plugin
-# ------------------------------------
-
-# Save trace setting
-MY_XTRACE=$(set +o | grep xtrace)
-set +o xtrace
-
-source $TOP_DIR/lib/quantum_plugins/ovs_base
-source $TOP_DIR/lib/quantum_thirdparty/bigswitch_floodlight # for third party service specific configuration values
-
-function quantum_plugin_create_nova_conf() {
- NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
-}
-
-function quantum_plugin_install_agent_packages() {
- _quantum_ovs_base_install_agent_packages
-}
-
-function quantum_plugin_configure_common() {
- Q_PLUGIN_CONF_PATH=etc/quantum/plugins/bigswitch
- Q_PLUGIN_CONF_FILENAME=restproxy.ini
- Q_DB_NAME="restproxy_quantum"
- Q_PLUGIN_CLASS="quantum.plugins.bigswitch.plugin.QuantumRestProxyV2"
- BS_FL_CONTROLLERS_PORT=${BS_FL_CONTROLLERS_PORT:-localhost:80}
- BS_FL_CONTROLLER_TIMEOUT=${BS_FL_CONTROLLER_TIMEOUT:-10}
-}
-
-function quantum_plugin_configure_debug_command() {
- _quantum_ovs_base_configure_debug_command
-}
-
-function quantum_plugin_configure_dhcp_agent() {
- :
-}
-
-function quantum_plugin_configure_l3_agent() {
- _quantum_ovs_base_configure_l3_agent
-}
-
-function quantum_plugin_configure_plugin_agent() {
- :
-}
-
-function quantum_plugin_configure_service() {
- iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT
- iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT
- if [ "$BS_FL_VIF_DRIVER" = "ivs" ]
- then
- iniset /$Q_PLUGIN_CONF_FILE nova vif_type ivs
- fi
-}
-
-function quantum_plugin_setup_interface_driver() {
- local conf_file=$1
- if [ "$BS_FL_VIF_DRIVER" = "ivs" ]
- then
- iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.IVSInterfaceDriver
- else
- iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
- fi
-}
-
-
-function has_quantum_plugin_security_group() {
- # 1 means False here
- return 1
-}
-
-function quantum_plugin_check_adv_test_requirements() {
- is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
-}
-
-# Restore xtrace
-$MY_XTRACE
diff --git a/lib/quantum_plugins/brocade b/lib/quantum_plugins/brocade
deleted file mode 100644
index 52ce3db..0000000
--- a/lib/quantum_plugins/brocade
+++ /dev/null
@@ -1,59 +0,0 @@
-# Brocade Quantum Plugin
-# ----------------------
-
-# Save trace setting
-BRCD_XTRACE=$(set +o | grep xtrace)
-set +o xtrace
-
-function is_quantum_ovs_base_plugin() {
- return 1
-}
-
-function quantum_plugin_create_nova_conf() {
- NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
-}
-
-function quantum_plugin_install_agent_packages() {
- install_package bridge-utils
-}
-
-function quantum_plugin_configure_common() {
- Q_PLUGIN_CONF_PATH=etc/quantum/plugins/brocade
- Q_PLUGIN_CONF_FILENAME=brocade.ini
- Q_DB_NAME="brcd_quantum"
- Q_PLUGIN_CLASS="quantum.plugins.brocade.QuantumPlugin.BrocadePluginV2"
-}
-
-function quantum_plugin_configure_debug_command() {
- iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge
-}
-
-function quantum_plugin_configure_dhcp_agent() {
- iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager quantum.agent.dhcp_agent.DhcpAgentWithStateReport
-}
-
-function quantum_plugin_configure_l3_agent() {
- iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
- iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager quantum.agent.l3_agent.L3NATAgentWithStateReport
-}
-
-function quantum_plugin_configure_plugin_agent() {
- AGENT_BINARY="$QUANTUM_DIR/bin/quantum-linuxbridge-agent"
-}
-
-function quantum_plugin_setup_interface_driver() {
- local conf_file=$1
- iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver
-}
-
-function has_quantum_plugin_security_group() {
- # 0 means True here
- return 0
-}
-
-function quantum_plugin_check_adv_test_requirements() {
- is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
-}
-
-# Restore xtrace
-$BRCD_XTRACE
diff --git a/lib/quantum_plugins/plumgrid b/lib/quantum_plugins/plumgrid
deleted file mode 100644
index dde18c8..0000000
--- a/lib/quantum_plugins/plumgrid
+++ /dev/null
@@ -1,42 +0,0 @@
-# PLUMgrid Quantum Plugin
-# Edgar Magana emagana@plumgrid.com
-# ------------------------------------
-
-# Save trace settings
-MY_XTRACE=$(set +o | grep xtrace)
-set +o xtrace
-
-#source $TOP_DIR/lib/quantum_plugins/ovs_base
-
-function quantum_plugin_create_nova_conf() {
-
- NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
-}
-
-function quantum_plugin_setup_interface_driver() {
- :
-}
-
-function quantum_plugin_configure_common() {
- Q_PLUGIN_CONF_PATH=etc/quantum/plugins/plumgrid
- Q_PLUGIN_CONF_FILENAME=plumgrid.ini
- Q_DB_NAME="plumgrid_quantum"
- Q_PLUGIN_CLASS="quantum.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin.QuantumPluginPLUMgridV2"
-}
-
-function quantum_plugin_configure_service() {
- PLUMGRID_NOS_IP=${PLUMGRID_NOS_IP:-localhost}
- PLUMGRID_NOS_PORT=${PLUMGRID_NOS_PORT:-7766}
- iniset /$Q_PLUGIN_CONF_FILE plumgridnos nos_server $PLUMGRID_NOS_IP
- iniset /$Q_PLUGIN_CONF_FILE plumgridnos nos_server_port $PLUMGRID_NOS_PORT
-}
-
-function quantum_plugin_configure_debug_command() {
- :
-}
-
-function quantum_plugin_check_adv_test_requirements() {
- is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
-}
-# Restore xtrace
-$MY_XTRACE
diff --git a/lib/quantum_plugins/ryu b/lib/quantum_plugins/ryu
deleted file mode 100644
index 53c4f41..0000000
--- a/lib/quantum_plugins/ryu
+++ /dev/null
@@ -1,80 +0,0 @@
-# Quantum Ryu plugin
-# ------------------
-
-# Save trace setting
-MY_XTRACE=$(set +o | grep xtrace)
-set +o xtrace
-
-source $TOP_DIR/lib/quantum_plugins/ovs_base
-source $TOP_DIR/lib/quantum_thirdparty/ryu # for configuration value
-
-function quantum_plugin_create_nova_conf() {
- _quantum_ovs_base_configure_nova_vif_driver
- iniset $NOVA_CONF DEFAULT libvirt_ovs_integration_bridge "$OVS_BRIDGE"
-}
-
-function quantum_plugin_install_agent_packages() {
- _quantum_ovs_base_install_agent_packages
-
- # quantum_ryu_agent requires ryu module
- install_package $(get_packages "ryu")
- install_ryu
- configure_ryu
-}
-
-function quantum_plugin_configure_common() {
- Q_PLUGIN_CONF_PATH=etc/quantum/plugins/ryu
- Q_PLUGIN_CONF_FILENAME=ryu.ini
- Q_DB_NAME="ovs_quantum"
- Q_PLUGIN_CLASS="quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2"
-}
-
-function quantum_plugin_configure_debug_command() {
- _quantum_ovs_base_configure_debug_command
- iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
-}
-
-function quantum_plugin_configure_dhcp_agent() {
- iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
-}
-
-function quantum_plugin_configure_l3_agent() {
- iniset $Q_L3_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
- _quantum_ovs_base_configure_l3_agent
-}
-
-function quantum_plugin_configure_plugin_agent() {
- # Set up integration bridge
- _quantum_ovs_base_setup_bridge $OVS_BRIDGE
- if [ -n "$RYU_INTERNAL_INTERFACE" ]; then
- sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $RYU_INTERNAL_INTERFACE
- fi
- iniset /$Q_PLUGIN_CONF_FILE ovs integration_bridge $OVS_BRIDGE
- AGENT_BINARY="$QUANTUM_DIR/quantum/plugins/ryu/agent/ryu_quantum_agent.py"
-
- _quantum_ovs_base_configure_firewall_driver
-}
-
-function quantum_plugin_configure_service() {
- iniset /$Q_PLUGIN_CONF_FILE ovs openflow_rest_api $RYU_API_HOST:$RYU_API_PORT
-
- _quantum_ovs_base_configure_firewall_driver
-}
-
-function quantum_plugin_setup_interface_driver() {
- local conf_file=$1
- iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
- iniset $conf_file DEFAULT ovs_use_veth True
-}
-
-function has_quantum_plugin_security_group() {
- # 0 means True here
- return 0
-}
-
-function quantum_plugin_check_adv_test_requirements() {
- is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
-}
-
-# Restore xtrace
-$MY_XTRACE
diff --git a/lib/tempest b/lib/tempest
index 8b4ae0e..8a844b9 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -185,12 +185,12 @@
fi
if is_service_enabled q-l3; then
- public_network_id=$(quantum net-list | grep $PUBLIC_NETWORK_NAME | \
+ public_network_id=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \
awk '{print $2}')
if [ "$Q_USE_NAMESPACE" == "False" ]; then
# If namespaces are disabled, devstack will create a single
# public router that tempest should be configured to use.
- public_router_id=$(quantum router-list | awk "/ $Q_ROUTER_NAME / \
+ public_router_id=$(neutron router-list | awk "/ $Q_ROUTER_NAME / \
{ print \$2 }")
fi
fi
@@ -223,7 +223,7 @@
iniset $TEMPEST_CONF compute change_password_available False
# Note(nati) current tempest don't create network for each tenant
# so reuse same tenant for now
- if is_service_enabled quantum; then
+ if is_service_enabled neutron; then
TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
fi
iniset $TEMPEST_CONF compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
@@ -252,8 +252,8 @@
iniset $TEMPEST_CONF "compute-admin" password "$password" # DEPRECATED
# Network
- if is_service_enabled quantum; then
- iniset $TEMPEST_CONF network quantum_available "True"
+ if is_service_enabled neutron; then
+ iniset $TEMPEST_CONF network neutron_available "True"
fi
iniset $TEMPEST_CONF network api_version 2.0
iniset $TEMPEST_CONF network tenant_networks_reachable "$tenant_networks_reachable"
diff --git a/samples/localrc b/samples/localrc
index bcaa788..fd7221a 100644
--- a/samples/localrc
+++ b/samples/localrc
@@ -66,7 +66,7 @@
#KEYSTONECLIENT_BRANCH=milestone-proposed
#NOVA_BRANCH=milestone-proposed
#NOVACLIENT_BRANCH=milestone-proposed
-#QUANTUM_BRANCH=milestone-proposed
+#NEUTRON_BRANCH=milestone-proposed
#SWIFT_BRANCH=milestone-proposed
diff --git a/stack.sh b/stack.sh
index 05b53af..c4f7944 100755
--- a/stack.sh
+++ b/stack.sh
@@ -2,7 +2,7 @@
# ``stack.sh`` is an opinionated OpenStack developer installation. It
# installs and configures various combinations of **Ceilometer**, **Cinder**,
-# **Glance**, **Heat**, **Horizon**, **Keystone**, **Nova**, **Quantum**
+# **Glance**, **Heat**, **Horizon**, **Keystone**, **Nova**, **Neutron**
# and **Swift**.
# This script allows you to specify configuration options of what git
@@ -307,7 +307,7 @@
source $TOP_DIR/lib/swift
source $TOP_DIR/lib/ceilometer
source $TOP_DIR/lib/heat
-source $TOP_DIR/lib/quantum
+source $TOP_DIR/lib/neutron
source $TOP_DIR/lib/baremetal
source $TOP_DIR/lib/ldap
@@ -583,8 +583,8 @@
install_database
fi
-if is_service_enabled quantum; then
- install_quantum_agent_packages
+if is_service_enabled neutron; then
+ install_neutron_agent_packages
fi
@@ -669,8 +669,8 @@
if is_service_enabled swift glance; then
install_swiftclient
fi
-if is_service_enabled quantum nova; then
- install_quantumclient
+if is_service_enabled neutron nova; then
+ install_neutronclient
fi
git_clone $OPENSTACKCLIENT_REPO $OPENSTACKCLIENT_DIR $OPENSTACKCLIENT_BRANCH
@@ -705,9 +705,9 @@
configure_cinder
fi
-if is_service_enabled quantum; then
- install_quantum
- install_quantum_third_party
+if is_service_enabled neutron; then
+ install_neutron
+ install_neutron_third_party
fi
if is_service_enabled nova; then
@@ -879,7 +879,7 @@
create_keystone_accounts
create_nova_accounts
create_cinder_accounts
- create_quantum_accounts
+ create_neutron_accounts
# ``keystone_data.sh`` creates services, admin and demo users, and roles.
ADMIN_PASSWORD=$ADMIN_PASSWORD SERVICE_TENANT_NAME=$SERVICE_TENANT_NAME SERVICE_PASSWORD=$SERVICE_PASSWORD \
@@ -919,22 +919,22 @@
fi
-# Quantum
+# Neutron
# -------
-if is_service_enabled quantum; then
- echo_summary "Configuring Quantum"
+if is_service_enabled neutron; then
+ echo_summary "Configuring Neutron"
- configure_quantum
- init_quantum
+ configure_neutron
+ init_neutron
fi
-# Some Quantum plugins require network controllers which are not
+# Some Neutron plugins require network controllers which are not
# a part of the OpenStack project. Configure and start them.
-if is_service_enabled quantum; then
- configure_quantum_third_party
- init_quantum_third_party
- start_quantum_third_party
+if is_service_enabled neutron; then
+ configure_neutron_third_party
+ init_neutron_third_party
+ start_neutron_third_party
fi
@@ -989,8 +989,8 @@
init_nova
# Additional Nova configuration that is dependent on other services
- if is_service_enabled quantum; then
- create_nova_conf_quantum
+ if is_service_enabled neutron; then
+ create_nova_conf_neutron
elif is_service_enabled n-net; then
create_nova_conf_nova_network
fi
@@ -1172,11 +1172,11 @@
fi
if is_service_enabled q-svc; then
- echo_summary "Starting Quantum"
+ echo_summary "Starting Neutron"
- start_quantum_service_and_check
- create_quantum_initial_network
- setup_quantum_debug
+ start_neutron_service_and_check
+ create_neutron_initial_network
+ setup_neutron_debug
elif is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-net; then
NM_CONF=${NOVA_CONF}
if is_service_enabled n-cell; then
@@ -1193,8 +1193,8 @@
$NOVA_BIN_DIR/nova-manage --config-file $NM_CONF floating create --ip_range=$TEST_FLOATING_RANGE --pool=$TEST_FLOATING_POOL
fi
-if is_service_enabled quantum; then
- start_quantum_agents
+if is_service_enabled neutron; then
+ start_neutron_agents
fi
if is_service_enabled nova; then
echo_summary "Starting Nova"
diff --git a/stackrc b/stackrc
index fc1e01d..212d340 100644
--- a/stackrc
+++ b/stackrc
@@ -21,7 +21,7 @@
# ``disable_service`` functions in ``localrc``.
# For example, to enable Swift add this to ``localrc``:
# enable_service swift
-# In order to enable Quantum (a single node setup) add the following
+# In order to enable Neutron (a single node setup) add the following
# settings in `` localrc``:
# disable_service n-net
# enable_service q-svc
@@ -29,7 +29,7 @@
# enable_service q-dhcp
# enable_service q-l3
# enable_service q-meta
-# enable_service quantum
+# enable_service neutron
# # Optional, to enable tempest configuration as part of devstack
# enable_service tempest
ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,tempest,mysql
@@ -117,13 +117,13 @@
PBR_REPO=${PBR_REPO:-${GIT_BASE}/openstack-dev/pbr.git}
PBR_BRANCH=${PBR_BRANCH:-master}
-# quantum service
-QUANTUM_REPO=${QUANTUM_REPO:-${GIT_BASE}/openstack/neutron.git}
-QUANTUM_BRANCH=${QUANTUM_BRANCH:-master}
+# neutron service
+NEUTRON_REPO=${NEUTRON_REPO:-${GIT_BASE}/openstack/neutron.git}
+NEUTRON_BRANCH=${NEUTRON_BRANCH:-master}
-# quantum client
-QUANTUMCLIENT_REPO=${QUANTUMCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git}
-QUANTUMCLIENT_BRANCH=${QUANTUMCLIENT_BRANCH:-master}
+# neutron client
+NEUTRONCLIENT_REPO=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git}
+NEUTRONCLIENT_BRANCH=${NEUTRONCLIENT_BRANCH:-master}
# storage service
SWIFT_REPO=${SWIFT_REPO:-${GIT_BASE}/openstack/swift.git}
@@ -177,7 +177,7 @@
fi
;;
xenserver)
- # Xen config common to nova and quantum
+ # Xen config common to nova and neutron
XENAPI_USER=${XENAPI_USER:-"root"}
;;
*)
diff --git a/tools/xen/README.md b/tools/xen/README.md
index 9f39080..039e660 100644
--- a/tools/xen/README.md
+++ b/tools/xen/README.md
@@ -39,7 +39,7 @@
- eth0 - Management interface, connected to `MGT_BRIDGE_OR_NET_NAME`
- eth1 - VM interface, connected to `VM_BRIDGE_OR_NET_NAME`
- eth2 - Public interface, connected to `PUB_BRIDGE_OR_NET_NAME`
- - (eth3) - Optional network interface if quantum is used, to enforce xapi to
+ - (eth3) - Optional network interface if neutron is used, to enforce xapi to
create the underlying bridge.
- Start devstack inside the created OpenStack VM
diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh
index d74b1ad..65eb97c 100755
--- a/tools/xen/install_os_domU.sh
+++ b/tools/xen/install_os_domU.sh
@@ -58,8 +58,8 @@
## Install the netwrap xapi plugin to support agent control of dom0 networking
if [[ "$ENABLED_SERVICES" =~ "q-agt" && "$Q_PLUGIN" = "openvswitch" ]]; then
- QUANTUM_ZIPBALL_URL=${QUANTUM_ZIPBALL_URL:-$(zip_snapshot_location $QUANTUM_REPO $QUANTUM_BRANCH)}
- install_xapi_plugins_from_zipball $QUANTUM_ZIPBALL_URL
+ NEUTRON_ZIPBALL_URL=${NEUTRON_ZIPBALL_URL:-$(zip_snapshot_location $NEUTRON_REPO $NEUTRON_BRANCH)}
+ install_xapi_plugins_from_zipball $NEUTRON_ZIPBALL_URL
fi
create_directory_for_kernels
@@ -72,9 +72,9 @@
setup_network "$MGT_BRIDGE_OR_NET_NAME"
setup_network "$PUB_BRIDGE_OR_NET_NAME"
-# With quantum, one more network is required, which is internal to the
+# With neutron, one more network is required, which is internal to the
# hypervisor, and used by the VMs
-if is_service_enabled quantum; then
+if is_service_enabled neutron; then
setup_network "$XEN_INT_BRIDGE_OR_NET_NAME"
fi
@@ -255,9 +255,9 @@
$THIS_DIR/build_xva.sh "$GUEST_NAME"
# Attach a network interface for the integration network (so that the bridge
-# is created by XenServer). This is required for Quantum. Also pass that as a
+# is created by XenServer). This is required for Neutron. Also pass that as a
# kernel parameter for DomU
-if is_service_enabled quantum; then
+if is_service_enabled neutron; then
add_interface "$GUEST_NAME" "$XEN_INT_BRIDGE_OR_NET_NAME" $XEN_INT_DEV_NR
XEN_INTEGRATION_BRIDGE=$(bridge_for "$XEN_INT_BRIDGE_OR_NET_NAME")
diff --git a/unstack.sh b/unstack.sh
index d1d0349..ece06eb 100755
--- a/unstack.sh
+++ b/unstack.sh
@@ -29,7 +29,7 @@
source $TOP_DIR/lib/cinder
source $TOP_DIR/lib/horizon
source $TOP_DIR/lib/swift
-source $TOP_DIR/lib/quantum
+source $TOP_DIR/lib/neutron
# Determine what system we are running on. This provides ``os_VENDOR``,
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
@@ -50,7 +50,7 @@
if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
source $TOP_DIR/openrc
- teardown_quantum_debug
+ teardown_neutron_debug
fi
# Shut down devstack's screen to get the bulk of OpenStack services in one shot
@@ -106,8 +106,8 @@
fi
fi
-if is_service_enabled quantum; then
- stop_quantum
- stop_quantum_third_party
- cleanup_quantum
+if is_service_enabled neutron; then
+ stop_neutron
+ stop_neutron_third_party
+ cleanup_neutron
fi