Merge "update for name change to Neutron"

This commit is contained in:
Jenkins 2013-07-07 21:32:23 +00:00 committed by Gerrit Code Review
commit 2076647e21
43 changed files with 834 additions and 827 deletions

View File

@ -110,7 +110,7 @@ follows:
* 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

View File

@ -104,11 +104,11 @@ If you are enabling `swift3` in `ENABLED_SERVICES` devstack will install the swi
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 @@ In order to enable Quantum a single node setup, you'll need the following settin
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 @@ If tempest has been successfully configured, a basic set of smoke tests can be r
# 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 @@ You should run at least one "controller node", which should have a `stackrc` tha
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 likely want to change your `localrc` to run a scheduler that will balance VM
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

View File

@ -42,7 +42,7 @@ source $TOP_DIR/lib/cinder
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_cinder
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...

View File

@ -32,9 +32,9 @@ source $TOP_DIR/functions
# 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

View File

@ -33,9 +33,9 @@ source $TOP_DIR/functions
# 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

View File

@ -30,9 +30,9 @@ source $TOP_DIR/functions
# 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 @@ nova add-floating-ip $VM_UUID $FLOATING_IP || \
# 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 @@ fi
# 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"

View File

@ -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 @@ source $TOP_DIR/functions
# 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_role_id {
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 @@ function create_network {
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 @@ function delete_network {
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
}

View File

@ -30,9 +30,9 @@ source $TOP_DIR/functions
# 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

View File

@ -262,8 +262,8 @@ function get_packages() {
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 @@ function is_running() {
# **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 @@ function is_service_enabled() {
[[ ${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 @@ function _cleanup_service_list () {
# 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 @@ function enable_service() {
# 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() {
@ -1331,8 +1331,8 @@ function zypper_install() {
# 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
@ -1371,8 +1371,8 @@ function _ping_check_novanet() {
# 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

View File

@ -151,12 +151,12 @@ function configure_keystone() {
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 "

View File

@ -1,5 +1,5 @@
# lib/quantum
# functions - funstions specific to quantum
# lib/neutron
# functions - funstions specific to neutron
# Dependencies:
# ``functions`` file
@ -7,62 +7,62 @@
# ``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
# 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_quantum
# stop_neutron
# Functions in lib/quantum are classified into the following categories:
# Functions in lib/neutron are classified into the following categories:
#
# - entry points (called from stack.sh or unstack.sh)
# - internal functions
# - quantum exercises
# - neutron exercises
# - 3rd party programs
# Quantum Networking
# Neutron 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
# 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 Quantum openvswitch plugin, set
# 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 Quantum
# 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 "Quantum Network Configuration" below for additional variables
# See "Neutron Network Configuration" below for additional variables
# that must be set in localrc for connectivity across hosts with
# Quantum.
# Neutron.
#
# With Quantum networking the NETWORK_MANAGER variable is ignored.
# 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
# Quantum section.
# Neutron section.
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace
# Quantum Network Configuration
# Neutron Network Configuration
# -----------------------------
# Gateway and subnet defaults, in case they are not customized in localrc
@ -72,22 +72,29 @@ 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}
NEUTRON_DIR=$DEST/neutron
NEUTRONCLIENT_DIR=$DEST/python-neutronclient
NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron}
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"}
# 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
# Default Quantum Plugin
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 Quantum Port
# Default Neutron Port
Q_PORT=${Q_PORT:-9696}
# Default Quantum Host
# Default Neutron Host
Q_HOST=${Q_HOST:-$SERVICE_HOST}
# Default admin username
Q_ADMIN_USERNAME=${Q_ADMIN_USERNAME:-quantum}
Q_ADMIN_USERNAME=${Q_ADMIN_USERNAME:-neutron}
# Default auth strategy
Q_AUTH_STRATEGY=${Q_AUTH_STRATEGY:-keystone}
# Use namespace or not
@ -99,27 +106,27 @@ Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP:-True}
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
# 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_quantum_common() for details about setting it up
# See _configure_neutron_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 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
QUANTUM_ROOTWRAP=$(get_rootwrap_location quantum)
Q_RR_COMMAND="sudo $QUANTUM_ROOTWRAP $Q_RR_CONF_FILE"
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 Quantum openvswitch and
# 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
@ -183,20 +190,20 @@ if is_service_enabled quantum; then
OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-$ENABLE_TENANT_TUNNELS}
fi
# Quantum plugin specific functions
# Neutron plugin specific functions
# ---------------------------------
# Please refer to ``lib/quantum_plugins/README.md`` for details.
source $TOP_DIR/lib/quantum_plugins/$Q_PLUGIN
# 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/quantum_plugins/services/loadbalancer
source $TOP_DIR/lib/neutron_plugins/services/loadbalancer
# Use security group or not
if has_quantum_plugin_security_group; then
if has_neutron_plugin_security_group; then
Q_USE_SECGROUP=${Q_USE_SECGROUP:-True}
else
Q_USE_SECGROUP=False
@ -205,36 +212,36 @@ 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
# 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_quantum_lbaas
_configure_neutron_lbaas
fi
if is_service_enabled q-svc; then
_configure_quantum_service
_configure_neutron_service
fi
if is_service_enabled q-agt; then
_configure_quantum_plugin_agent
_configure_neutron_plugin_agent
fi
if is_service_enabled q-dhcp; then
_configure_quantum_dhcp_agent
_configure_neutron_dhcp_agent
fi
if is_service_enabled q-l3; then
_configure_quantum_l3_agent
_configure_neutron_l3_agent
fi
if is_service_enabled q-meta; then
_configure_quantum_metadata_agent
_configure_neutron_metadata_agent
fi
_configure_quantum_debug_command
_configure_neutron_debug_command
}
function create_nova_conf_quantum() {
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"
@ -249,7 +256,7 @@ function create_nova_conf_quantum() {
fi
# set NOVA_VIF_DRIVER and optionally set options in nova_conf
quantum_plugin_create_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"
@ -258,38 +265,38 @@ function create_nova_conf_quantum() {
fi
}
# create_quantum_accounts() - Set up common required quantum accounts
# create_neutron_accounts() - Set up common required neutron accounts
# Tenant User Roles
# ------------------------------------------------------------------
# service quantum admin # if enabled
# service neutron admin # if enabled
# Migrated from keystone_data.sh
function create_quantum_accounts() {
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
QUANTUM_USER=$(keystone user-create \
--name=quantum \
NEUTRON_USER=$(keystone user-create \
--name=neutron \
--pass="$SERVICE_PASSWORD" \
--tenant_id $SERVICE_TENANT \
--email=quantum@example.com \
--email=neutron@example.com \
| grep " id " | get_field 2)
keystone user-role-add \
--tenant_id $SERVICE_TENANT \
--user_id $QUANTUM_USER \
--user_id $NEUTRON_USER \
--role_id $ADMIN_ROLE
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
QUANTUM_SERVICE=$(keystone service-create \
--name=quantum \
NEUTRON_SERVICE=$(keystone service-create \
--name=neutron \
--type=network \
--description="Quantum Service" \
--description="Neutron Service" \
| grep " id " | get_field 2)
keystone endpoint-create \
--region RegionOne \
--service_id $QUANTUM_SERVICE \
--service_id $NEUTRON_SERVICE \
--publicurl "http://$SERVICE_HOST:9696/" \
--adminurl "http://$SERVICE_HOST:9696/" \
--internalurl "http://$SERVICE_HOST:9696/"
@ -297,11 +304,11 @@ function create_quantum_accounts() {
fi
}
function create_quantum_initial_network() {
function create_neutron_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,
# 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
@ -309,36 +316,36 @@ function create_quantum_initial_network() {
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)
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=$(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)
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=$(quantum router-create --tenant_id $TENANT_ID $Q_ROUTER_NAME | grep ' id ' | get_field 2)
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=$(quantum router-create $Q_ROUTER_NAME | grep ' id ' | get_field 2)
ROUTER_ID=$(neutron router-create $Q_ROUTER_NAME | grep ' id ' | get_field 2)
fi
quantum router-interface-add $ROUTER_ID $SUBNET_ID
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=$(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
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_quantum_ovs_base_plugin && [[ "$Q_USE_NAMESPACE" = "True" ]]; then
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=`quantum port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F '"' '{ print $8; }'`
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
@ -349,313 +356,313 @@ function create_quantum_initial_network() {
fi
}
# init_quantum() - Initialize databases, etc.
function init_quantum() {
# init_neutron() - Initialize databases, etc.
function init_neutron() {
:
}
# install_quantum() - Collect source and prepare
function install_quantum() {
git_clone $QUANTUM_REPO $QUANTUM_DIR $QUANTUM_BRANCH
setup_develop $QUANTUM_DIR
# install_neutron() - Collect source and prepare
function install_neutron() {
git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH
setup_develop $NEUTRON_DIR
}
# install_quantumclient() - Collect source and prepare
function install_quantumclient() {
git_clone $QUANTUMCLIENT_REPO $QUANTUMCLIENT_DIR $QUANTUMCLIENT_BRANCH
setup_develop $QUANTUMCLIENT_DIR
# install_neutronclient() - Collect source and prepare
function install_neutronclient() {
git_clone $NEUTRONCLIENT_REPO $NEUTRONCLIENT_DIR $NEUTRONCLIENT_BRANCH
setup_develop $NEUTRONCLIENT_DIR
}
# install_quantum_agent_packages() - Collect source and prepare
function install_quantum_agent_packages() {
# 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
quantum_plugin_install_agent_packages
neutron_plugin_install_agent_packages
fi
if is_service_enabled q-lbaas; then
quantum_agent_lbaas_install_agent_packages
neutron_agent_lbaas_install_agent_packages
fi
}
# Start running processes, including screen
function start_quantum_service_and_check() {
function start_neutron_service_and_check() {
# build config-file options
local cfg_file
local CFG_FILE_OPTIONS="--config-file $QUANTUM_CONF --config-file /$Q_PLUGIN_CONF_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 Quantum service
screen_it q-svc "cd $QUANTUM_DIR && python $QUANTUM_DIR/bin/quantum-server $CFG_FILE_OPTIONS"
echo "Waiting for Quantum to start..."
# 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 "Quantum did not start"
die $LINENO "Neutron 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"
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 $QUANTUM_DIR && python $AGENT_BINARY --config-file $QUANTUM_CONF --config-file /$Q_PLUGIN_CONF_FILE.domU"
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 $QUANTUM_DIR && python $AGENT_LBAAS_BINARY --config-file $QUANTUM_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME"
screen_it q-lbaas "cd $NEUTRON_DIR && python $AGENT_LBAAS_BINARY --config-file $NEUTRON_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME"
fi
}
# stop_quantum() - Stop running processes (non-screen)
function stop_quantum() {
# 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 '/quantum-ns-metadata-proxy/ { print $2 }')
pid=$(ps aux | awk '/neutron-ns-metadata-proxy/ { print $2 }')
[ ! -z "$pid" ] && sudo kill -9 $pid
fi
}
# cleanup_quantum() - Remove residual data files, anything left over from previous
# cleanup_neutron() - 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
function cleanup_neutron() {
if is_neutron_ovs_base_plugin; then
neutron_ovs_base_cleanup
fi
# delete all namespaces created by quantum
# 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_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
# _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 $QUANTUM_CONF_DIR
sudo chown $STACK_USER $NEUTRON_CONF_DIR
cp $QUANTUM_DIR/etc/quantum.conf $QUANTUM_CONF
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)``
quantum_plugin_configure_common
neutron_plugin_configure_common
if [[ $Q_PLUGIN_CONF_PATH == '' || $Q_PLUGIN_CONF_FILENAME == '' || $Q_PLUGIN_CLASS == '' ]]; then
die $LINENO "Quantum plugin not set.. exiting"
die $LINENO "Neutron plugin not set.. exiting"
fi
# If needed, move config file from ``$QUANTUM_DIR/etc/quantum`` to ``QUANTUM_CONF_DIR``
# 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 $QUANTUM_DIR/$Q_PLUGIN_CONF_FILE /$Q_PLUGIN_CONF_FILE
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 $QUANTUM_CONF DEFAULT state_path $DATA_DIR/quantum
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 "Quantum additional plugin config not set.. exiting"
die $LINENO "Neutron additional plugin config not set.. exiting"
fi
# If additional config files exist, copy them over to quantum configuration
# 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 $QUANTUM_DIR/${Q_PLUGIN_EXTRA_CONF_FILES[$f]} /${Q_PLUGIN_EXTRA_CONF_FILES[$f]}
cp $NEUTRON_DIR/${Q_PLUGIN_EXTRA_CONF_FILES[$f]} /${Q_PLUGIN_EXTRA_CONF_FILES[$f]}
done
fi
_quantum_setup_rootwrap
_neutron_setup_rootwrap
}
function _configure_quantum_debug_command() {
function _configure_neutron_debug_command() {
if [[ "$Q_USE_DEBUG_COMMAND" != "True" ]]; then
return
fi
cp $QUANTUM_DIR/etc/l3_agent.ini $QUANTUM_TEST_CONFIG_FILE
cp $NEUTRON_DIR/etc/l3_agent.ini $NEUTRON_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
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 $QUANTUM_TEST_CONFIG_FILE agent root_helper "$Q_RR_COMMAND"
iniset $NEUTRON_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
_neutron_setup_keystone $NEUTRON_TEST_CONFIG_FILE DEFAULT set_auth_url
_neutron_setup_interface_driver $NEUTRON_TEST_CONFIG_FILE
quantum_plugin_configure_debug_command
neutron_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
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 $QUANTUM_DIR/etc/dhcp_agent.ini $Q_DHCP_CONF_FILE
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"
_quantum_setup_keystone $Q_DHCP_CONF_FILE DEFAULT set_auth_url
_quantum_setup_interface_driver $Q_DHCP_CONF_FILE
_neutron_setup_keystone $Q_DHCP_CONF_FILE DEFAULT set_auth_url
_neutron_setup_interface_driver $Q_DHCP_CONF_FILE
quantum_plugin_configure_dhcp_agent
neutron_plugin_configure_dhcp_agent
}
function _configure_quantum_l3_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="$QUANTUM_DIR/bin/quantum-l3-agent"
Q_L3_CONF_FILE=$QUANTUM_CONF_DIR/l3_agent.ini
AGENT_L3_BINARY="$NEUTRON_BIN_DIR/neutron-l3-agent"
Q_L3_CONF_FILE=$NEUTRON_CONF_DIR/l3_agent.ini
cp $QUANTUM_DIR/etc/l3_agent.ini $Q_L3_CONF_FILE
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"
_quantum_setup_keystone $Q_L3_CONF_FILE DEFAULT set_auth_url
_quantum_setup_interface_driver $Q_L3_CONF_FILE
_neutron_setup_keystone $Q_L3_CONF_FILE DEFAULT set_auth_url
_neutron_setup_interface_driver $Q_L3_CONF_FILE
quantum_plugin_configure_l3_agent
neutron_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
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 $QUANTUM_DIR/etc/metadata_agent.ini $Q_META_CONF_FILE
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"
_quantum_setup_keystone $Q_META_CONF_FILE DEFAULT set_auth_url
_neutron_setup_keystone $Q_META_CONF_FILE DEFAULT set_auth_url
}
function _configure_quantum_lbaas() {
quantum_agent_lbaas_configure_common
quantum_agent_lbaas_configure_agent
function _configure_neutron_lbaas() {
neutron_agent_lbaas_configure_common
neutron_agent_lbaas_configure_agent
}
# _configure_quantum_plugin_agent() - Set config files for quantum plugin agent
# _configure_neutron_plugin_agent() - Set config files for neutron plugin agent
# It is called when q-agt is enabled.
function _configure_quantum_plugin_agent() {
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 $QUANTUM_CONF DEFAULT verbose True
iniset $QUANTUM_CONF DEFAULT debug True
iniset $NEUTRON_CONF DEFAULT verbose True
iniset $NEUTRON_CONF DEFAULT debug True
# Configure agent for plugin
quantum_plugin_configure_plugin_agent
neutron_plugin_configure_plugin_agent
}
# _configure_quantum_service() - Set config files for quantum service
# _configure_neutron_service() - Set config files for neutron 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
function _configure_neutron_service() {
Q_API_PASTE_FILE=$NEUTRON_CONF_DIR/api-paste.ini
Q_POLICY_FILE=$NEUTRON_CONF_DIR/policy.json
cp $QUANTUM_DIR/etc/api-paste.ini $Q_API_PASTE_FILE
cp $QUANTUM_DIR/etc/policy.json $Q_POLICY_FILE
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 Quantum plugin."
die $LINENO "A database must be enabled in order to use the $Q_PLUGIN Neutron plugin."
fi
# Update either configuration file with plugin
iniset $QUANTUM_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS
iniset $NEUTRON_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS
if [[ $Q_SERVICE_PLUGIN_CLASSES != '' ]]; then
iniset $QUANTUM_CONF DEFAULT service_plugins $Q_SERVICE_PLUGIN_CLASSES
iniset $NEUTRON_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 $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 $QUANTUM_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY
_quantum_setup_keystone $QUANTUM_CONF keystone_authtoken
iniset $NEUTRON_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY
_neutron_setup_keystone $NEUTRON_CONF keystone_authtoken
# Configure plugin
quantum_plugin_configure_service
neutron_plugin_configure_service
}
# Utility Functions
#------------------
# _quantum_setup_rootwrap() - configure Quantum's rootwrap
function _quantum_setup_rootwrap() {
# _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=$QUANTUM_CONF_DIR/rootwrap.d
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 ``$QUANTUM_CONF_DIR/rootwrap.d``
# Deploy filters to ``$NEUTRON_CONF_DIR/rootwrap.d``
mkdir -p -m 755 $Q_CONF_ROOTWRAP_D
cp -pr $QUANTUM_DIR/etc/quantum/rootwrap.d/* $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 ``$QUANTUM_CONF_DIR/rootwrap.d``
# Set up ``rootwrap.conf``, pointing to ``$NEUTRON_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
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 $QUANTUM_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE
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 quantum-rootwrap
ROOTWRAP_SUDOER_CMD="$QUANTUM_ROOTWRAP $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 quantum
# 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/quantum-rootwrap
sudo mv $TEMPFILE /etc/sudoers.d/neutron-rootwrap
# Update the root_helper
iniset $QUANTUM_CONF agent root_helper "$Q_RR_COMMAND"
iniset $NEUTRON_CONF agent root_helper "$Q_RR_COMMAND"
}
# Configures keystone integration for quantum service and agents
function _quantum_setup_keystone() {
# Configures keystone integration for neutron service and agents
function _neutron_setup_keystone() {
local conf_file=$1
local section=$2
local use_auth_url=$3
@ -669,58 +676,58 @@ function _quantum_setup_keystone() {
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
iniset $conf_file $section signing_dir $NEUTRON_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/*
sudo mkdir -p $NEUTRON_AUTH_CACHE_DIR
sudo chown $STACK_USER $NEUTRON_AUTH_CACHE_DIR
rm -f $NEUTRON_AUTH_CACHE_DIR/*
}
function _quantum_setup_interface_driver() {
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
quantum_plugin_setup_interface_driver $1
neutron_plugin_setup_interface_driver $1
}
# Functions for Quantum Exercises
# Functions for Neutron 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
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_quantum_debug() {
function setup_neutron_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
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`
quantum-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create --device-owner compute $private_net_id
neutron-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() {
function teardown_neutron_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}'
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=`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`
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_quantum() {
function _ping_check_neutron() {
local from_net=$1
local ip=$2
local timeout_sec=$3
@ -742,7 +749,7 @@ function _ping_check_quantum() {
}
# ssh check
function _ssh_check_quantum() {
function _ssh_check_neutron() {
local from_net=$1
local key_file=$2
local ip=$3
@ -755,48 +762,48 @@ function _ssh_check_quantum() {
fi
}
# Quantum 3rd party programs
# Neutron 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
# 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/quantum_thirdparty/$third_party
QUANTUM_THIRD_PARTIES="$QUANTUM_THIRD_PARTIES,$third_party"
source $TOP_DIR/lib/neutron_thirdparty/$third_party
NEUTRON_THIRD_PARTIES="$NEUTRON_THIRD_PARTIES,$third_party"
fi
done
function _quantum_third_party_do() {
for third_party in ${QUANTUM_THIRD_PARTIES//,/ }; do
function _neutron_third_party_do() {
for third_party in ${NEUTRON_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
# configure_neutron_third_party() - Set config files, create data dirs, etc
function configure_neutron_third_party() {
_neutron_third_party_do configure
}
# init_quantum_third_party() - Initialize databases, etc.
function init_quantum_third_party() {
_quantum_third_party_do init
# init_neutron_third_party() - Initialize databases, etc.
function init_neutron_third_party() {
_neutron_third_party_do init
}
# install_quantum_third_party() - Collect source and prepare
function install_quantum_third_party() {
_quantum_third_party_do install
# install_neutron_third_party() - Collect source and prepare
function install_neutron_third_party() {
_neutron_third_party_do install
}
# start_quantum_third_party() - Start running processes, including screen
function start_quantum_third_party() {
_quantum_third_party_do start
# start_neutron_third_party() - Start running processes, including screen
function start_neutron_third_party() {
_neutron_third_party_do start
}
# stop_quantum_third_party - Stop running processes (non-screen)
function stop_quantum_third_party() {
_quantum_third_party_do stop
# stop_neutron_third_party - Stop running processes (non-screen)
function stop_neutron_third_party() {
_neutron_third_party_do stop
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,4 @@
# Quantum Cisco plugin
# Neutron Cisco plugin
# ---------------------------
# Save trace setting
@ -86,17 +86,17 @@ function _config_switch() {
# 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 @@ function is_ncclient_installed() {
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 @@ function _configure_nexus_subplugin() {
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 @@ function _configure_n1kv_subplugin() {
# 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 @@ function quantum_plugin_configure_service() {
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 @@ function quantum_plugin_configure_service() {
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

View File

@ -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 @@ function quantum_plugin_configure_service() {
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 @@ function quantum_plugin_configure_service() {
done
}
function has_quantum_plugin_security_group() {
function has_neutron_plugin_security_group() {
# 0 means True here
return 0
}

View File

@ -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 @@ function quantum_plugin_configure_plugin_agent() {
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 @@ function quantum_plugin_configure_plugin_agent() {
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
}

View File

@ -1,4 +1,4 @@
# Quantum Modular Layer 2 plugin
# Neutron Modular Layer 2 plugin
# ------------------------------
# Save trace setting
@ -7,16 +7,16 @@ set +o xtrace
# 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 @@ function quantum_plugin_configure_service() {
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
}

View File

@ -1,4 +1,4 @@
# Quantum NEC OpenFlow plugin
# Neutron NEC OpenFlow plugin
# ---------------------------
# Save trace setting
@ -20,47 +20,47 @@ OFC_RETRY_INTERVAL=${OFC_RETRY_INTERVAL:-1}
# 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 @@ function quantum_plugin_configure_plugin_agent() {
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 @@ function quantum_plugin_setup_interface_driver() {
# ---------------------------
# 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 @@ function _quantum_setup_ovs_tunnels() {
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
}

View File

@ -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 @@ function setup_integration_bridge() {
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 @@ function quantum_plugin_create_nova_conf() {
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 @@ function quantum_plugin_configure_service() {
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
}

View File

@ -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 @@ function quantum_plugin_configure_service() {
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 @@ function quantum_plugin_configure_service() {
done
}
function has_quantum_plugin_security_group() {
function has_neutron_plugin_security_group() {
return 0
}

View File

@ -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 @@ function quantum_plugin_configure_plugin_agent() {
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 @@ function quantum_plugin_configure_plugin_agent() {
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
}

View File

@ -8,34 +8,34 @@ set +o xtrace
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 @@ function _quantum_ovs_base_install_agent_packages() {
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"}

View File

@ -1,4 +1,4 @@
# PLUMgrid Quantum Plugin
# PLUMgrid Neutron Plugin
# Edgar Magana emagana@plumgrid.com
# ------------------------------------
@ -6,36 +6,36 @@
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 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_setup_interface_driver() {
function neutron_plugin_setup_interface_driver() {
:
}
function quantum_plugin_configure_common() {
Q_PLUGIN_CONF_PATH=etc/quantum/plugins/plumgrid
function neutron_plugin_configure_common() {
Q_PLUGIN_CONF_PATH=etc/neutron/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"
Q_DB_NAME="plumgrid_neutron"
Q_PLUGIN_CLASS="neutron.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2"
}
function quantum_plugin_configure_service() {
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 quantum_plugin_configure_debug_command() {
function neutron_plugin_configure_debug_command() {
:
}
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
}
# Restore xtrace

80
lib/neutron_plugins/ryu Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
# Quantum loadbalancer plugin
# Neutron loadbalancer plugin
# ---------------------------
# Save trace setting
@ -6,10 +6,10 @@ MY_XTRACE=$(set +o | grep xtrace)
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 @@ function quantum_agent_lbaas_install_agent_packages() {
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 @@ function quantum_agent_lbaas_configure_common() {
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"

View File

@ -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 @@ Third party program specific configuration variables should be in this file.
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>``:

View File

@ -13,7 +13,7 @@ function configure_bigswitch_floodlight() {
}
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}

View File

@ -18,8 +18,8 @@ RYU_OFP_PORT=${RYU_OFP_PORT:-6633}
# 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_host=$RYU_API_HOST
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}

View File

@ -81,7 +81,7 @@ if [ "$VIRT_DRIVER" = 'xenserver' ]; then
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 @@ function configure_nova() {
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 = [

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -185,12 +185,12 @@ function configure_tempest() {
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 @@ function configure_tempest() {
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 @@ function configure_tempest() {
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"

View File

@ -66,7 +66,7 @@ LOGDAYS=2
#KEYSTONECLIENT_BRANCH=milestone-proposed
#NOVA_BRANCH=milestone-proposed
#NOVACLIENT_BRANCH=milestone-proposed
#QUANTUM_BRANCH=milestone-proposed
#NEUTRON_BRANCH=milestone-proposed
#SWIFT_BRANCH=milestone-proposed

View File

@ -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/cinder
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 @@ if is_service_enabled $DATABASE_BACKENDS; then
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 @@ install_novaclient
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 @@ if is_service_enabled cinder; then
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 @@ if is_service_enabled key; then
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 @@ if is_service_enabled g-reg; then
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 @@ if is_service_enabled nova; then
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 @@ if is_service_enabled n-api; then
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 @@ elif is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-net; then
$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"

18
stackrc
View File

@ -21,7 +21,7 @@ fi
# ``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 @@ fi
# 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 @@ OPENSTACKCLIENT_BRANCH=${OPENSTACKCLIENT_BRANCH:-master}
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 @@ case "$VIRT_DRIVER" in
fi
;;
xenserver)
# Xen config common to nova and quantum
# Xen config common to nova and neutron
XENAPI_USER=${XENAPI_USER:-"root"}
;;
*)

View File

@ -39,7 +39,7 @@ The `install_os_domU.sh` script will:
- 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

View File

@ -58,8 +58,8 @@ install_xapi_plugins_from_zipball $NOVA_ZIPBALL_URL
## 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 "$VM_BRIDGE_OR_NET_NAME"
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 @@ add_interface "$GUEST_NAME" "$PUB_BRIDGE_OR_NET_NAME" "$PUB_DEV_NR"
$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")

View File

@ -29,7 +29,7 @@ source $TOP_DIR/lib/baremetal
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 @@ fi
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 @@ if [[ -n "$UNSTACK_ALL" ]]; then
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