Merge "Fixes for linux bridge and Q_USE_PROVIDER_NET"
diff --git a/doc/source/assets/images/screen_session_1.png b/doc/source/assets/images/screen_session_1.png
new file mode 100644
index 0000000..6ad6752
--- /dev/null
+++ b/doc/source/assets/images/screen_session_1.png
Binary files differ
diff --git a/doc/source/development.rst b/doc/source/development.rst
new file mode 100644
index 0000000..776ac6c
--- /dev/null
+++ b/doc/source/development.rst
@@ -0,0 +1,140 @@
+==========================
+ Developing with Devstack
+==========================
+
+Now that you have your nifty DevStack up and running, what can you do
+with it?
+
+Inspecting Services
+===================
+
+By default most services in DevStack are running in a `screen
+<https://www.gnu.org/software/screen/manual/screen.html>`_
+session.
+
+.. code-block:: bash
+
+ os3:~> screen -list
+ There is a screen on:
+ 28994.stack (08/10/2016 09:01:33 PM) (Detached)
+ 1 Socket in /var/run/screen/S-sdague.
+
+You can attach to this screen session using ``screen -r`` which gives
+you a view of the services in action.
+
+.. image:: assets/images/screen_session_1.png
+ :width: 100%
+
+Basic Screen Commands
+---------------------
+
+The following minimal commands will be useful to using screen:
+
+* ``ctrl-a n`` - go to next window. Next is assumed to be right of
+ current window.
+* ``ctrl-a p`` - go to previous window. Previous is assumed to be left
+ of current window.
+* ``ctrl-a [`` - entry copy/scrollback mode. This allows you to
+ navigate back through the logs with the up arrow.
+* ``ctrl-a d`` - detach from screen. Gets you back to a normal
+ terminal, while leaving everything running.
+
+For more about using screen, see the excellent `screen manual
+<https://www.gnu.org/software/screen/manual/screen.html>`_.
+
+Patching a Service
+==================
+
+If you want to make a quick change to a running service the easiest
+way to do this is:
+
+* attach to screen
+* navigate to the window in question
+* ``ctrl-c`` to kill the service
+* make appropriate changes to the code
+* ``up arrow`` in the screen window to display the command used to run
+ that service
+* ``enter`` to restart the service
+
+This works for services, except those running under Apache (currently
+just ``keystone`` by default).
+
+.. warning::
+
+ All changes you are making are in checked out git trees that
+ DevStack thinks it has full control over. Uncommitted work, or
+ work committed to the master branch, may be overwritten during
+ subsequent DevStack runs.
+
+Testing a Patch Series
+======================
+
+When testing a larger set of patches, or patches that will impact more
+than one service within a project, it is often less confusing to use
+custom git locations, and make all your changes in a dedicated git
+tree.
+
+In your ``local.conf`` you can add ``**_REPO``, ``**_BRANCH`` for most projects
+to use a custom git tree instead of the default upstream ones.
+
+For instance:
+
+.. code-block:: bash
+
+ [[local|localrc]]
+ NOVA_REPO=/home/sdague/nova
+ NOVA_BRANCH=fold_disk_config
+
+Will use a custom git tree and branch when doing any devstack
+operations, such as ``stack.sh``.
+
+When testing complicated changes committing to these trees, then doing
+``./unstack.sh && ./stack.sh`` is often a valuable way to
+iterate. This does take longer per iteration than direct patching, as
+the whole devstack needs to rebuild.
+
+You can use this same approach to test patches that are up for review
+in gerrit by using the ref name that gerrit assigns to each change.
+
+.. code-block:: bash
+
+ [[local|localrc]]
+ NOVA_BRANCH=refs/changes/10/353710/1
+
+
+Testing Changes to Apache Based Services
+========================================
+
+When testing changes to Apache based services, such as ``keystone``,
+you can either use the Testing a Patch Series approach above, or make
+changes in the code tree and issue an apache restart.
+
+
+Testing Changes to Libraries
+============================
+
+When testing changes to libraries consumed by OpenStack services (such
+as oslo or any of the python-fooclient libraries) things are a little
+more complicated. By default we only test with released versions of
+these libraries that are on pypi.
+
+You must first override this with the setting ``LIBS_FROM_GIT``. This
+will enable your DevStack with the git version of that library instead
+of the released version.
+
+After that point you can also specify ``**_REPO``, ``**_BRANCH`` to use
+your changes instead of just upstream master.
+
+.. code-block:: bash
+
+ [[local|localrc]]
+ LIBS_FROM_GIT=oslo.policy
+ OSLOPOLICY_REPO=/home/sdague/oslo.policy
+ OSLOPOLICY_BRANCH=better_exception
+
+Because libraries are used by many services, library changes really
+need to go through a full ``./unstack.sh && ./stack.sh`` to see your
+changes in action.
+
+To figure out the repo / branch names for every library that's
+supported, you'll need to read the devstack source.
diff --git a/doc/source/index.rst b/doc/source/index.rst
index c1302eb..435011b 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -113,11 +113,15 @@
You can ``cd /opt/stack/tempest`` and run tempest tests that have
been configured to work with your devstack.
+You can :doc:`make code changes to OpenStack and validate them
+<development>`.
+
Going further
-------------
Learn more about our :doc:`configuration system <configuration>` to
-customize devstack for your needs.
+customize devstack for your needs. Including making adjustments to the
+default :doc:`networking <networking>`.
Read :doc:`guides <guides>` for specific setups people have (note:
guides are point in time contributions, and may not always be kept
diff --git a/doc/source/networking.rst b/doc/source/networking.rst
new file mode 100644
index 0000000..1d56c33
--- /dev/null
+++ b/doc/source/networking.rst
@@ -0,0 +1,97 @@
+=====================
+ DevStack Networking
+=====================
+
+An important part of the DevStack experience is networking that works
+by default for created guests. This might not be optimal for your
+particular testing environment, so this document tries it's best to
+explain what's going on.
+
+Defaults
+========
+
+If you don't specify any configuration you will get the following:
+
+* neutron (including l3 with openvswitch)
+* private project networks for each openstack project
+* a floating ip range of 172.24.4.0/24 with the gateway of 172.24.4.1
+* the demo project configured with fixed ips on 10.0.0.0/24
+* a ``br-ex`` interface controlled by neutron for all it's networking
+ (this is not connected to any physical interfaces).
+* DNS resolution for guests based on the resolv.conf for you host
+* an ip masq rule that allows created guests to route out
+
+This creates an environment which is isolated to the single
+host. Guests can get to the external network for package
+updates. Tempest tests will work in this environment.
+
+.. note::
+
+ By default all OpenStack environments have security group rules
+ which block all inbound packets to guests. If you want to be able
+ to ssh / ping your created guests you should run the following.
+
+ .. code-block:: bash
+
+ openstack security group rule create --proto icmp --dst-port 0 default
+ openstack security group rule create --proto tcp --dst-port 22 default
+
+Locally Accessible Guests
+=========================
+
+If you want to make you guests accessible other machines on your
+network, we have to connect ``br-ex`` to a physical interface.
+
+Dedicated Guest Interface
+-------------------------
+
+If you have 2 or more interfaces on your devstack server, you can
+allocate an interface to neutron to fully manage. This **should not**
+be the same interface you use to ssh into the devstack server itself.
+
+This is done by setting with the ``PUBLIC_INTERFACE`` attribute.
+
+.. code-block:: bash
+
+ [[local|localrc]]
+ PUBLIC_INTERFACE=eth1
+
+That will put all layer 2 traffic from your guests onto the main
+network. When running in this mode the ip masq rule is **not** added
+in your devstack, you are responsible for making routing work on your
+local network.
+
+Shared Guest Interface
+----------------------
+
+.. warning::
+
+ This is not a recommended configuration. Because of interactions
+ between ovs and bridging, if you reboot your box with active
+ networking you may loose network connectivity to your system.
+
+If you need your guests accessible on the network, but only have 1
+interface (using something like a NUC), you can share your one
+network. But in order for this to work you need to manually set a lot
+of addresses, and have them all exactly correct.
+
+.. code-block:: bash
+
+ [[local|localrc]]
+ PUBLIC_INTERFACE=eth0
+ HOST_IP=10.42.0.52
+ FLOATING_RANGE=10.42.0.52/24
+ PUBLIC_NETWORK_GATEWAY=10.42.0.1
+ Q_FLOATING_ALLOCATION_POOL=start=10.42.0.250,end=10.42.0.254
+
+In order for this scenario to work the floating ip network must match
+the default networking on your server. This breaks HOST_IP detection,
+as we exclude the floating range by default, so you have to specify
+that manually.
+
+The ``PUBLIC_NETWORK_GATEWAY`` is the gateway that server would normally
+use to get off the network. ``Q_FLOATING_ALLOCATION_POOL`` controls
+the range of floating ips that will be handed out. As we are sharing
+your existing network, you'll want to give it a slice that your local
+dhcp server is not allocating. Otherwise you could easily have
+conflicting ip addresses, and cause havoc with your local network.
diff --git a/doc/source/plugin-registry.rst b/doc/source/plugin-registry.rst
index bdb8d8b..bb85270 100644
--- a/doc/source/plugin-registry.rst
+++ b/doc/source/plugin-registry.rst
@@ -73,6 +73,7 @@
magnum `git://git.openstack.org/openstack/magnum <https://git.openstack.org/cgit/openstack/magnum>`__
magnum-ui `git://git.openstack.org/openstack/magnum-ui <https://git.openstack.org/cgit/openstack/magnum-ui>`__
manila `git://git.openstack.org/openstack/manila <https://git.openstack.org/cgit/openstack/manila>`__
+masakari `git://git.openstack.org/openstack/masakari <https://git.openstack.org/cgit/openstack/masakari>`__
mistral `git://git.openstack.org/openstack/mistral <https://git.openstack.org/cgit/openstack/mistral>`__
monasca-analytics `git://git.openstack.org/openstack/monasca-analytics <https://git.openstack.org/cgit/openstack/monasca-analytics>`__
monasca-api `git://git.openstack.org/openstack/monasca-api <https://git.openstack.org/cgit/openstack/monasca-api>`__
diff --git a/doc/source/site-map.rst b/doc/source/site-map.rst
index 480d6aa..801fc66 100644
--- a/doc/source/site-map.rst
+++ b/doc/source/site-map.rst
@@ -14,8 +14,10 @@
overview
configuration
+ networking
plugins
plugin-registry
faq
+ development
hacking
guides
diff --git a/inc/python b/inc/python
index 9de2831..e4cfab8 100644
--- a/inc/python
+++ b/inc/python
@@ -370,7 +370,7 @@
# Install python3 packages
function install_python3 {
if is_ubuntu; then
- apt_get install python3.4 python3.4-dev
+ apt_get install python${PYTHON3_VERSION} python${PYTHON3_VERSION}-dev
fi
}
diff --git a/lib/cinder_backends/xiv b/lib/cinder_backends/xiv
deleted file mode 100644
index e8b5da0..0000000
--- a/lib/cinder_backends/xiv
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014 IBM Corp.
-# Copyright (c) 2014 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# Authors:
-# Alon Marx <alonma@il.ibm.com>
-#
-
-# lib/cinder_plugins/xiv
-# Configure the xiv_ds8k driver for xiv testing
-
-# Enable xiv_ds8k driver for xiv with:
-#
-# CINDER_ENABLED_BACKENDS+=,xiv:<volume-type-name>
-# XIV_DRIVER_VERSION=<version-string>
-# SAN_IP=<storage-ip-or-hostname>
-# SAN_LOGIN=<storage-admin-account>
-# SAN_PASSWORD=<storage-admin-password>
-# SAN_CLUSTERNAME=<cluster-name>
-# CONNECTION_TYPE=<connection-type> iscsi|fc
-# XIV_CHAP=<chap-type> disabled|enabled
-
-# Dependencies:
-#
-# - ``functions`` file
-# - ``cinder`` configurations
-
-# configure_cinder_backend_xiv - Configure Cinder for xiv backends
-
-# Save trace setting
-_XTRACE_CINDER_XIV=$(set +o | grep xtrace)
-set +o xtrace
-
-# Defaults
-# --------
-# Set up default directories
-
-
-# Entry Points
-# ------------
-
-# configure_cinder_backend_xiv - Set config files, create data dirs, etc
-function configure_cinder_backend_xiv {
-
- local be_name=$1
-
- python -c 'from xiv_ds8k_openstack.xiv_nova_proxy import XIVNovaProxy'
- if [ $? -ne 0 ]; then
- die $LINENO "XIV_DS8K driver is missing. Please install first"
- fi
-
- # For reference:
- # ``XIV_DS8K_BACKEND='IBM-XIV_'${SAN_IP}'_'${SAN_CLUSTERNAME}'_'${CONNECTION_TYPE}``
- iniset $CINDER_CONF DEFAULT xiv_ds8k_driver_version $XIV_DRIVER_VERSION
-
- iniset $CINDER_CONF $be_name san_ip $SAN_IP
- iniset $CINDER_CONF $be_name san_login $SAN_LOGIN
- iniset $CINDER_CONF $be_name san_password $SAN_PASSWORD
- iniset $CINDER_CONF $be_name san_clustername $SAN_CLUSTERNAME
- iniset $CINDER_CONF $be_name xiv_ds8k_connection_type $CONNECTION_TYPE
- iniset $CINDER_CONF $be_name volume_backend_name $be_name
- iniset $CINDER_CONF $be_name volume_driver 'cinder.volume.drivers.ibm.xiv_ds8k.XIVDS8KDriver'
- iniset $CINDER_CONF $be_name xiv_ds8k_proxy 'xiv_ds8k_openstack.xiv_nova_proxy.XIVNovaProxy'
- iniset $CINDER_CONF $be_name xiv_chap $XIV_CHAP
-}
-
-# Restore xtrace
-$_XTRACE_CINDER_XIV
-
-# Local variables:
-# mode: shell-script
-# End:
diff --git a/lib/neutron b/lib/neutron
index f36e564..c1552e3 100644
--- a/lib/neutron
+++ b/lib/neutron
@@ -166,6 +166,7 @@
iniset $NEUTRON_PLUGIN_CONF ml2 type_drivers vxlan
iniset $NEUTRON_PLUGIN_CONF ml2 mechanism_drivers openvswitch,linuxbridge
iniset $NEUTRON_PLUGIN_CONF ml2_type_vxlan vni_ranges 1001:2000
+ iniset $NEUTRON_PLUGIN_CONF ml2 extension_drivers port_security
fi
# Neutron OVS or LB agent
diff --git a/lib/neutron_plugins/linuxbridge_agent b/lib/neutron_plugins/linuxbridge_agent
index 437aaeb..7d59e13 100644
--- a/lib/neutron_plugins/linuxbridge_agent
+++ b/lib/neutron_plugins/linuxbridge_agent
@@ -44,7 +44,7 @@
function neutron_plugin_configure_dhcp_agent {
local conf_file=$1
- iniset $conf_file DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
+ :
}
function neutron_plugin_configure_l3_agent {
@@ -52,7 +52,6 @@
sudo brctl addbr $PUBLIC_BRIDGE
set_mtu $PUBLIC_BRIDGE $PUBLIC_BRIDGE_MTU
iniset $conf_file DEFAULT external_network_bridge
- iniset $conf_file DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
}
function neutron_plugin_configure_plugin_agent {
diff --git a/lib/neutron_plugins/openvswitch_agent b/lib/neutron_plugins/openvswitch_agent
index b4a53e4..e27b8a6 100644
--- a/lib/neutron_plugins/openvswitch_agent
+++ b/lib/neutron_plugins/openvswitch_agent
@@ -29,13 +29,12 @@
function neutron_plugin_configure_dhcp_agent {
local conf_file=$1
- iniset $conf_file DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
+ :
}
function neutron_plugin_configure_l3_agent {
local conf_file=$1
_neutron_ovs_base_configure_l3_agent
- iniset $conf_file DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
}
function neutron_plugin_configure_plugin_agent {
diff --git a/lib/nova_plugins/hypervisor-fake b/lib/nova_plugins/hypervisor-fake
index 2434dce..6ac2199 100644
--- a/lib/nova_plugins/hypervisor-fake
+++ b/lib/nova_plugins/hypervisor-fake
@@ -36,7 +36,7 @@
# configure_nova_hypervisor - Set config files, create data dirs, etc
function configure_nova_hypervisor {
- iniset $NOVA_CONF DEFAULT compute_driver "nova.virt.fake.FakeDriver"
+ iniset $NOVA_CONF DEFAULT compute_driver "fake.FakeDriver"
# Disable arbitrary limits
iniset $NOVA_CONF DEFAULT quota_instances -1
iniset $NOVA_CONF DEFAULT quota_cores -1
diff --git a/lib/oslo b/lib/oslo
index 1773da2..e34e48a 100644
--- a/lib/oslo
+++ b/lib/oslo
@@ -26,6 +26,8 @@
GITDIR["cliff"]=$DEST/cliff
GITDIR["debtcollector"]=$DEST/debtcollector
GITDIR["futurist"]=$DEST/futurist
+GITDIR["os-client-config"]=$DEST/os-client-config
+GITDIR["osc-lib"]=$DEST/osc-lib
GITDIR["oslo.cache"]=$DEST/oslo.cache
GITDIR["oslo.concurrency"]=$DEST/oslo.concurrency
GITDIR["oslo.config"]=$DEST/oslo.config
@@ -71,6 +73,8 @@
_do_install_oslo_lib "cliff"
_do_install_oslo_lib "debtcollector"
_do_install_oslo_lib "futurist"
+ _do_install_oslo_lib "osc-lib"
+ _do_install_oslo_lib "os-client-config"
_do_install_oslo_lib "oslo.cache"
_do_install_oslo_lib "oslo.concurrency"
_do_install_oslo_lib "oslo.config"
diff --git a/lib/tempest b/lib/tempest
index 6bfa889..67fb454 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -236,6 +236,8 @@
fi
fi
+ iniset $TEMPEST_CONFIG network project_network_cidr $FIXED_RANGE
+
ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method}
# the public network (for floating ip access) is only available
@@ -452,15 +454,26 @@
fi
# Using ``CINDER_ENABLED_BACKENDS``
+ # Cinder uses a comma separated list with "type:backend_name":
+ # CINDER_ENABLED_BACKENDS = ceph:cephBE1,lvm:lvmBE2,foo:my_foo
if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
+ # We have at least 2 backends
iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
- local i=1
+ local add_comma_seperator=0
+ local backends_list=''
local be
+ # Tempest uses a comma separated list of backend_names:
+ # backend_names = BACKEND_1,BACKEND_2
for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
- local be_name=${be##*:}
- iniset $TEMPEST_CONFIG volume "backend${i}_name" "$be_name"
- i=$(( i + 1 ))
+ if [ "$add_comma_seperator" -eq "1" ]; then
+ backends_list+=,${be##*:}
+ else
+ # first element in the list
+ backends_list+=${be##*:}
+ add_comma_seperator=1
+ fi
done
+ iniset $TEMPEST_CONFIG volume "backend_names" "$backends_list"
fi
if [ $TEMPEST_VOLUME_DRIVER != "default" -o \
@@ -561,16 +574,14 @@
# Run ``verify_tempest_config -ur`` to retrieve enabled extensions on API endpoints
# NOTE(mtreinish): This must be done after auth settings are added to the tempest config
tox -evenv -- tempest verify-config -uro $tmp_cfg_file
- # Nova API extensions
- local compute_api_extensions=${COMPUTE_API_EXTENSIONS:-"all"}
- if [[ ! -z "$DISABLE_COMPUTE_API_EXTENSIONS" ]]; then
- # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
- compute_api_extensions=${COMPUTE_API_EXTENSIONS:-$(iniget $tmp_cfg_file compute-feature-enabled api_extensions | tr -d " ")}
- # Remove disabled extensions
- compute_api_extensions=$(remove_disabled_extensions $compute_api_extensions $DISABLE_COMPUTE_API_EXTENSIONS)
- fi
- iniset $TEMPEST_CONFIG compute-feature-enabled api_extensions $compute_api_extensions
+
# Neutron API Extensions
+
+ # disable metering if we didn't enable the service
+ if ! is_service_enabled q-metering; then
+ DISABLE_NETWORK_API_EXTENSIONS+=", metering"
+ fi
+
local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"}
if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
diff --git a/stackrc b/stackrc
index 4fefe8d..bfb897b 100644
--- a/stackrc
+++ b/stackrc
@@ -508,10 +508,19 @@
GITREPO["os-brick"]=${OS_BRICK_REPO:-${GIT_BASE}/openstack/os-brick.git}
GITBRANCH["os-brick"]=${OS_BRICK_BRANCH:-master}
+# os-client-config to manage clouds.yaml and friends
+GITREPO["os-client-config"]=${OS_CLIENT_CONFIG_REPO:-${GIT_BASE}/openstack/os-client-config.git}
+GITBRANCH["os-client-config"]=${OS_CLIENT_CONFIG_BRANCH:-master}
+GITDIR["os-client-config"]=$DEST/os-client-config
+
# os-vif library to communicate between Neutron to Nova
GITREPO["os-vif"]=${OS_VIF_REPO:-${GIT_BASE}/openstack/os-vif.git}
GITBRANCH["os-vif"]=${OS_VIF_BRANCH:-master}
+# osc-lib OpenStackClient common lib
+GITREPO["osc-lib"]=${OSC_LIB_REPO:-${GIT_BASE}/openstack/osc-lib.git}
+GITBRANCH["osc-lib"]=${OSC_LIB_BRANCH:-master}
+
# ironic common lib
GITREPO["ironic-lib"]=${IRONIC_LIB_REPO:-${GIT_BASE}/openstack/ironic-lib.git}
GITBRANCH["ironic-lib"]=${IRONIC_LIB_BRANCH:-master}
diff --git a/tests/test_libs_from_pypi.sh b/tests/test_libs_from_pypi.sh
index bb58088..fb55023 100755
--- a/tests/test_libs_from_pypi.sh
+++ b/tests/test_libs_from_pypi.sh
@@ -36,8 +36,8 @@
ALL_LIBS+=" python-cinderclient glance_store oslo.concurrency oslo.db"
ALL_LIBS+=" oslo.versionedobjects oslo.vmware keystonemiddleware"
ALL_LIBS+=" oslo.serialization django_openstack_auth"
-ALL_LIBS+=" python-openstackclient oslo.rootwrap oslo.i18n"
-ALL_LIBS+=" oslo.utils python-swiftclient"
+ALL_LIBS+=" python-openstackclient osc-lib os-client-config oslo.rootwrap"
+ALL_LIBS+=" oslo.i18n oslo.utils python-swiftclient"
ALL_LIBS+=" python-neutronclient tooz ceilometermiddleware oslo.policy"
ALL_LIBS+=" debtcollector os-brick automaton futurist oslo.service"
ALL_LIBS+=" oslo.cache oslo.reports osprofiler"