From 41e36d6bcd3ab04cd3955aef68162c3266dc958e Mon Sep 17 00:00:00 2001 From: armando-migliaccio Date: Tue, 4 Feb 2014 13:39:32 -0800 Subject: [PATCH 0001/3949] Replace NvpPluginV2 with NsxPlugin The king is dead, long live the king! Partial-implements blueprint: nicira-plugin-renaming Change-Id: I9b71479a8d4228d45a6591b169c489c0107fb04c --- lib/neutron_plugins/vmware_nsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/neutron_plugins/vmware_nsx b/lib/neutron_plugins/vmware_nsx index d506cb6f8d..74f98df577 100644 --- a/lib/neutron_plugins/vmware_nsx +++ b/lib/neutron_plugins/vmware_nsx @@ -41,8 +41,7 @@ function neutron_plugin_configure_common() { Q_PLUGIN_CONF_PATH=etc/neutron/plugins/vmware Q_PLUGIN_CONF_FILENAME=nsx.ini Q_DB_NAME="neutron_nsx" - # TODO(armando-migliaccio): rename this once the code rename is complete - Q_PLUGIN_CLASS="neutron.plugins.nicira.NeutronPlugin.NvpPluginV2" + Q_PLUGIN_CLASS="neutron.plugins.vmware.plugin.NsxPlugin" } function neutron_plugin_configure_debug_command() { From c03f975150bf97b5aef42daa77fc419a9e241123 Mon Sep 17 00:00:00 2001 From: sukhdev Date: Thu, 27 Feb 2014 14:17:44 -0800 Subject: [PATCH 0002/3949] devstack (stack.sh) fails when extra config files are specified Latest merge of https://review.openstack.org/#/c/71996/ exposes an issue in stack.sh which did not surface before. Please see the details of the issue in the bug description. Closes bug: 1285884 Change-Id: Ie231c9835497c2a418a61d339dfd5df1aab9e3d7 --- lib/neutron | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/neutron b/lib/neutron index df276c71d5..07b21af336 100644 --- a/lib/neutron +++ b/lib/neutron @@ -586,11 +586,9 @@ function _configure_neutron_common() { # If additional config files exist, copy them over to neutron configuration # directory if [[ $Q_PLUGIN_EXTRA_CONF_PATH != '' ]]; then - mkdir -p /$Q_PLUGIN_EXTRA_CONF_PATH local f for (( f=0; $f < ${#Q_PLUGIN_EXTRA_CONF_FILES[@]}; f+=1 )); do Q_PLUGIN_EXTRA_CONF_FILES[$f]=$Q_PLUGIN_EXTRA_CONF_PATH/${Q_PLUGIN_EXTRA_CONF_FILES[$f]} - cp $NEUTRON_DIR/${Q_PLUGIN_EXTRA_CONF_FILES[$f]} /${Q_PLUGIN_EXTRA_CONF_FILES[$f]} done fi From d20f632a70565003ab8c72b2598201be79f4d782 Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Fri, 28 Feb 2014 09:22:37 +0900 Subject: [PATCH 0003/3949] Move some comments of variables to right place setup_develop*() in functions has been moved to functions-common. But some comments about the variables are still left. This commit moves it to the right place. Change-Id: Ic360454f1ee72f51c9979d0468dee0913e9b32e4 --- functions | 4 ---- functions-common | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/functions b/functions index 3101111c63..407a9e708c 100644 --- a/functions +++ b/functions @@ -6,10 +6,6 @@ # - ``ENABLED_SERVICES`` # - ``FILES`` # - ``GLANCE_HOSTPORT`` -# - ``REQUIREMENTS_DIR`` -# - ``STACK_USER`` -# - ``TRACK_DEPENDS`` -# - ``UNDO_REQUIREMENTS`` # # Include the common functions diff --git a/functions-common b/functions-common index c93dd855b3..a485cae9d9 100644 --- a/functions-common +++ b/functions-common @@ -26,7 +26,10 @@ # - ``PIP_DOWNLOAD_CACHE`` # - ``PIP_USE_MIRRORS`` # - ``RECLONE`` +# - ``REQUIREMENTS_DIR`` +# - ``STACK_USER`` # - ``TRACK_DEPENDS`` +# - ``UNDO_REQUIREMENTS`` # - ``http_proxy``, ``https_proxy``, ``no_proxy`` # Save trace setting From 9bbecb7fc45538bc83d7db5e33a55505a691b44d Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Fri, 28 Feb 2014 11:19:28 -0500 Subject: [PATCH 0004/3949] Source lib/neutron in boot_from_volume.sh Without lib/neutron, boot_from_volume.sh generates the following error: + _ping_check_neutron private 10.11.12.5 30 /devstack/functions: line 356: _ping_check_neutron: command not found Change-Id: Ib72c3f24d614570d69bf5dda35cbaf5847b1d1b9 --- exercises/boot_from_volume.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/boot_from_volume.sh b/exercises/boot_from_volume.sh index 79120460b8..f679669eea 100755 --- a/exercises/boot_from_volume.sh +++ b/exercises/boot_from_volume.sh @@ -32,6 +32,7 @@ source $TOP_DIR/functions # Import project functions source $TOP_DIR/lib/cinder +source $TOP_DIR/lib/neutron # Import configuration source $TOP_DIR/openrc From e994f5708d124ae71211876e9456499ac25646a3 Mon Sep 17 00:00:00 2001 From: Eric Windisch Date: Fri, 28 Feb 2014 15:13:37 -0500 Subject: [PATCH 0005/3949] Remove bm_poseur, unmaintained and obsolete The bm_poseur git repository link has been broken for over 11 months. The virtualized/fake baremetal environment is not working and has not worked in a long time. Now, on the tail of enabling 'enable -o errexit', this functionality now has a hard break. Change-Id: I3cbd8db58c422bc5273d2433278aaa5e449ecfd9 Closes-Bug: 1285954 --- lib/baremetal | 44 ++++---------------------------------------- stack.sh | 3 --- stackrc | 6 ------ unstack.sh | 5 ----- 4 files changed, 4 insertions(+), 54 deletions(-) diff --git a/lib/baremetal b/lib/baremetal index 473de0dd39..1d02e1e417 100644 --- a/lib/baremetal +++ b/lib/baremetal @@ -77,14 +77,6 @@ BM_POWER_MANAGER=${BM_POWER_MANAGER:-nova.virt.baremetal.fake.FakePowerManager} # These should be customized to your environment and hardware # ----------------------------------------------------------- -# whether to create a fake environment, eg. for devstack-gate -BM_USE_FAKE_ENV=`trueorfalse False $BM_USE_FAKE_ENV` - -# Extra options to pass to bm_poseur -# change the bridge name or IP: --bridge br99 --bridge-ip 192.0.2.1 -# change the virtualization type: --engine qemu -BM_POSEUR_EXTRA_OPTS=${BM_POSEUR_EXTRA_OPTS:-} - # To provide PXE, configure nova-network's dnsmasq rather than run the one # dedicated to baremetal. When enable this, make sure these conditions are # fulfilled: @@ -97,15 +89,10 @@ BM_POSEUR_EXTRA_OPTS=${BM_POSEUR_EXTRA_OPTS:-} BM_DNSMASQ_FROM_NOVA_NETWORK=`trueorfalse False $BM_DNSMASQ_FROM_NOVA_NETWORK` # BM_DNSMASQ_IFACE should match FLAT_NETWORK_BRIDGE -if [ "$BM_USE_FAKE_ENV" ]; then - BM_DNSMASQ_IFACE=${BM_DNSMASQ_IFACE:-br99} - BM_DNSMASQ_RANGE=${BM_DNSMASQ_RANGE:-192.0.2.32,192.0.2.48} -else - BM_DNSMASQ_IFACE=${BM_DNSMASQ_IFACE:-eth0} - # if testing on a physical network, - # BM_DNSMASQ_RANGE must be changed to suit your network - BM_DNSMASQ_RANGE=${BM_DNSMASQ_RANGE:-} -fi +BM_DNSMASQ_IFACE=${BM_DNSMASQ_IFACE:-eth0} +# if testing on a physical network, +# BM_DNSMASQ_RANGE must be changed to suit your network +BM_DNSMASQ_RANGE=${BM_DNSMASQ_RANGE:-} # BM_DNSMASQ_DNS provide dns server to bootstrap clients BM_DNSMASQ_DNS=${BM_DNSMASQ_DNS:-} @@ -143,7 +130,6 @@ BM_FLAVOR_ARCH=${BM_FLAVOR_ARCH:-$BM_CPU_ARCH} # Below this, we set some path and filenames. # Defaults are probably sufficient. BM_IMAGE_BUILD_DIR=${BM_IMAGE_BUILD_DIR:-$DEST/diskimage-builder} -BM_POSEUR_DIR=${BM_POSEUR_DIR:-$DEST/bm_poseur} # Use DIB to create deploy ramdisk and kernel. BM_BUILD_DEPLOY_RAMDISK=`trueorfalse True $BM_BUILD_DEPLOY_RAMDISK` @@ -177,7 +163,6 @@ function is_baremetal { # so that we can build the deployment kernel & ramdisk function prepare_baremetal_toolchain { git_clone $BM_IMAGE_BUILD_REPO $BM_IMAGE_BUILD_DIR $BM_IMAGE_BUILD_BRANCH - git_clone $BM_POSEUR_REPO $BM_POSEUR_DIR $BM_POSEUR_BRANCH local shellinabox_basename=$(basename $BM_SHELL_IN_A_BOX) if [[ ! -e $DEST/$shellinabox_basename ]]; then @@ -196,27 +181,6 @@ function prepare_baremetal_toolchain { fi } -# set up virtualized environment for devstack-gate testing -function create_fake_baremetal_env { - local bm_poseur="$BM_POSEUR_DIR/bm_poseur" - # TODO(deva): add support for >1 VM - sudo $bm_poseur $BM_POSEUR_EXTRA_OPTS create-bridge - sudo $bm_poseur $BM_POSEUR_EXTRA_OPTS create-vm - BM_FIRST_MAC=$(sudo $bm_poseur get-macs) - - # NOTE: there is currently a limitation in baremetal driver - # that requires second MAC even if it is not used. - # Passing a fake value allows this to work. - # TODO(deva): remove this after driver issue is fixed. - BM_SECOND_MAC='12:34:56:78:90:12' -} - -function cleanup_fake_baremetal_env { - local bm_poseur="$BM_POSEUR_DIR/bm_poseur" - sudo $bm_poseur $BM_POSEUR_EXTRA_OPTS destroy-vm - sudo $bm_poseur $BM_POSEUR_EXTRA_OPTS destroy-bridge -} - # prepare various directories needed by baremetal hypervisor function configure_baremetal_nova_dirs { # ensure /tftpboot is prepared diff --git a/stack.sh b/stack.sh index 0ec0e0dc93..5152b2a430 100755 --- a/stack.sh +++ b/stack.sh @@ -1052,9 +1052,6 @@ if is_service_enabled nova && is_baremetal; then echo_summary "Preparing for nova baremetal" prepare_baremetal_toolchain configure_baremetal_nova_dirs - if [[ "$BM_USE_FAKE_ENV" = "True" ]]; then - create_fake_baremetal_env - fi fi diff --git a/stackrc b/stackrc index f235cccb15..6bb6f37195 100644 --- a/stackrc +++ b/stackrc @@ -229,12 +229,6 @@ TEMPEST_BRANCH=${TEMPEST_BRANCH:-master} BM_IMAGE_BUILD_REPO=${BM_IMAGE_BUILD_REPO:-${GIT_BASE}/openstack/diskimage-builder.git} BM_IMAGE_BUILD_BRANCH=${BM_IMAGE_BUILD_BRANCH:-master} -# bm_poseur -# Used to simulate a hardware environment for baremetal -# Only used if BM_USE_FAKE_ENV is set -BM_POSEUR_REPO=${BM_POSEUR_REPO:-${GIT_BASE}/tripleo/bm_poseur.git} -BM_POSEUR_BRANCH=${BM_POSEUR_BRANCH:-master} - # a websockets/html5 or flash powered VNC console for vm instances NOVNC_REPO=${NOVNC_REPO:-https://github.com/kanaka/noVNC.git} NOVNC_BRANCH=${NOVNC_BRANCH:-master} diff --git a/unstack.sh b/unstack.sh index 6351fe0549..a5e7b879f9 100755 --- a/unstack.sh +++ b/unstack.sh @@ -127,11 +127,6 @@ if is_service_enabled tls-proxy; then killall stud fi -# baremetal might have created a fake environment -if is_service_enabled baremetal && [[ "$BM_USE_FAKE_ENV" = "True" ]]; then - cleanup_fake_baremetal_env -fi - SCSI_PERSIST_DIR=$CINDER_STATE_PATH/volumes/* # Get the iSCSI volumes From 8f084c6b855a747467274facb1218837e0f53c88 Mon Sep 17 00:00:00 2001 From: Nicolas Simonds Date: Fri, 28 Feb 2014 17:01:41 -0800 Subject: [PATCH 0006/3949] use "rabbit_hosts" config option instead of "rabbit_host" This allows for easy client configuration against clustered RabbitMQ setups. Does not break existing configs. Change-Id: I2b180f8860a727e35d7b465253689e5e8c44eb98 Closes-Bug: 1286411 --- lib/rpc_backend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rpc_backend b/lib/rpc_backend index a0424b1dee..e922daa078 100644 --- a/lib/rpc_backend +++ b/lib/rpc_backend @@ -186,7 +186,7 @@ function iniset_rpc_backend { fi elif is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then iniset $file $section rpc_backend ${package}.openstack.common.rpc.impl_kombu - iniset $file $section rabbit_host $RABBIT_HOST + iniset $file $section rabbit_hosts $RABBIT_HOST iniset $file $section rabbit_password $RABBIT_PASSWORD fi } From 12cb2299e8e4d933c7181ef1a9b97478214d2200 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 28 Feb 2014 19:53:50 -0500 Subject: [PATCH 0007/3949] nova changes for multinode working under -o errexit There was a stray inicomment on paste outside of a nova-api block. This fails under -o errexit because the paste.ini doesn't exist. Move this to inside the correct block. Change-Id: Iffbdae6716a1c2a8f650b68edd4faf436434eab1 --- lib/nova | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/nova b/lib/nova index 90b1ba4fde..583a5923ce 100644 --- a/lib/nova +++ b/lib/nova @@ -245,10 +245,9 @@ function configure_nova { inicomment $NOVA_API_PASTE_INI filter:authtoken cafile inicomment $NOVA_API_PASTE_INI filter:authtoken admin_user inicomment $NOVA_API_PASTE_INI filter:authtoken admin_password + inicomment $NOVA_API_PASTE_INI filter:authtoken signing_dir fi - inicomment $NOVA_API_PASTE_INI filter:authtoken signing_dir - if is_service_enabled n-cpu; then # Force IP forwarding on, just on case sudo sysctl -w net.ipv4.ip_forward=1 From 7083b8224dab423392e21b069a1a6ef54cd14a8f Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 28 Feb 2014 20:16:20 -0500 Subject: [PATCH 0008/3949] make ceilometer work if you don't enable ceilometer-api when doing ceilometer in a multihost devstack, you don't want ceilometer-api running on the computes. Under -o errexit this became fatal. Change-Id: Ie43c8724ba467b810f5a3b075dea45d66dde8648 --- lib/ceilometer | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/ceilometer b/lib/ceilometer index d20d628247..0be4184a37 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -206,9 +206,12 @@ function start_ceilometer { screen_it ceilometer-collector "cd ; ceilometer-collector --config-file $CEILOMETER_CONF" screen_it ceilometer-api "cd ; ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF" - echo "Waiting for ceilometer-api to start..." - if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl --noproxy '*' -s http://localhost:8777/v2/ >/dev/null; do sleep 1; done"; then - die $LINENO "ceilometer-api did not start" + # only die on API if it was actually intended to be turned on + if service_enabled ceilometer-api; then + echo "Waiting for ceilometer-api to start..." + if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl --noproxy '*' -s http://localhost:8777/v2/ >/dev/null; do sleep 1; done"; then + die $LINENO "ceilometer-api did not start" + fi fi screen_it ceilometer-alarm-notifier "cd ; ceilometer-alarm-notifier --config-file $CEILOMETER_CONF" From c921a95f63b00c549763c9968a103d44df590032 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 28 Feb 2014 21:09:33 -0500 Subject: [PATCH 0009/3949] only do a dbsync if on the database node ceilometer should only try to reset the database if it's actually on a node where there is a database. Change-Id: Ibcfec0556829bff0938e3769c19d34ae6c02b738 --- lib/ceilometer | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ceilometer b/lib/ceilometer index 0be4184a37..2e6e7c5a76 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -180,9 +180,11 @@ function init_ceilometer { sudo chown $STACK_USER $CEILOMETER_AUTH_CACHE_DIR rm -f $CEILOMETER_AUTH_CACHE_DIR/* - if [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] ; then - recreate_database ceilometer utf8 - $CEILOMETER_BIN_DIR/ceilometer-dbsync + if is_service_enabled mysql postgresql; then + if [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] ; then + recreate_database ceilometer utf8 + $CEILOMETER_BIN_DIR/ceilometer-dbsync + fi fi } From a8880cc22c540e88c43da4e49fa6c976361484e4 Mon Sep 17 00:00:00 2001 From: Eric Windisch Date: Sat, 1 Mar 2014 00:24:51 -0500 Subject: [PATCH 0010/3949] Use glance image-show to check for uploaded Docker images The behavior of the code being replaced was failing with '-o errexit' should that, as in the common case, the image has not been uploaded into Glance. While we could workaround this using a '|| :', the existing code also happened to overwrite the DOCKER_IMAGE global which is used elsewhere. It seemed prudent to either change this variable name or remove it altogether. Finally, using 'glance image-show' is more deterministic than grepping the output of 'glance image-list'. Change-Id: I23188155966ae9db64259b4a9d25a0d98c63c912 Closes-Bug: 1286443 --- lib/nova_plugins/hypervisor-docker | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/nova_plugins/hypervisor-docker b/lib/nova_plugins/hypervisor-docker index f8dc6afa19..cdbc4d172d 100644 --- a/lib/nova_plugins/hypervisor-docker +++ b/lib/nova_plugins/hypervisor-docker @@ -104,8 +104,7 @@ function start_nova_hypervisor { fi # Make sure we copied the image in Glance - DOCKER_IMAGE=$(glance image-list | egrep " $DOCKER_IMAGE_NAME ") - if ! is_set DOCKER_IMAGE ; then + if ! (glance image-show "$DOCKER_IMAGE"); then docker push $DOCKER_REPOSITORY_NAME fi } From 5a110d4e684d5cf936621608003f6b30eb75c2b1 Mon Sep 17 00:00:00 2001 From: fumihiko kakuma Date: Wed, 29 Jan 2014 14:42:06 +0900 Subject: [PATCH 0011/3949] Add configurations for the OpenFlow Agent mechanism driver This patch supports configurations for an environment of the OpenFlow Agent mechanism driver Set the following variables in a localrc to be ran this mechanism driver. Q_ML2_PLUGIN_MECHANISM_DRIVERS=ofagent Q_AGENT=ofagent Implements: blueprint ryu-ml2-driver Change-Id: I774da9a26f241487dfa4ec124b12f528704d860b --- lib/neutron_plugins/ofagent_agent | 94 +++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 lib/neutron_plugins/ofagent_agent diff --git a/lib/neutron_plugins/ofagent_agent b/lib/neutron_plugins/ofagent_agent new file mode 100644 index 0000000000..724df41d4c --- /dev/null +++ b/lib/neutron_plugins/ofagent_agent @@ -0,0 +1,94 @@ +# OpenFlow Agent 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 RYU_DIR, install_ryu, etc + +function neutron_plugin_create_nova_conf { + _neutron_ovs_base_configure_nova_vif_driver +} + +function neutron_plugin_install_agent_packages { + _neutron_ovs_base_install_agent_packages + + # This agent uses ryu to talk with switches + install_package $(get_packages "ryu") + install_ryu + configure_ryu +} + +function neutron_plugin_configure_debug_command { + _neutron_ovs_base_configure_debug_command +} + +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 { + _neutron_ovs_base_configure_l3_agent + iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport +} + +function neutron_plugin_configure_plugin_agent { + # Set up integration bridge + _neutron_ovs_base_setup_bridge $OVS_BRIDGE + _neutron_ovs_base_configure_firewall_driver + + # Check a supported openflow version + OF_VERSION=`ovs-ofctl --version | grep "OpenFlow versions" | awk '{print $3}' | cut -d':' -f2` + if [ `vercmp_numbers "$OF_VERSION" "0x3"` -lt "0" ]; then + die $LINENO "This agent requires OpenFlow 1.3+ capable switch." + fi + + # Enable tunnel networks if selected + if [[ "$OVS_ENABLE_TUNNELING" = "True" ]]; then + # Verify tunnels are supported + # REVISIT - also check kernel module support for GRE and patch ports + OVS_VERSION=`ovs-vsctl --version | head -n 1 | grep -E -o "[0-9]+\.[0-9]+"` + if [ `vercmp_numbers "$OVS_VERSION" "1.4"` -lt "0" ]; then + die $LINENO "You are running OVS version $OVS_VERSION. OVS 1.4+ is required for tunneling between multiple hosts." + fi + iniset /$Q_PLUGIN_CONF_FILE ovs enable_tunneling True + iniset /$Q_PLUGIN_CONF_FILE ovs local_ip $HOST_IP + fi + + # Setup physical network bridge mappings. Override + # ``OVS_VLAN_RANGES`` and ``OVS_BRIDGE_MAPPINGS`` in ``localrc`` for more + # complex physical network configurations. + if [[ "$OVS_BRIDGE_MAPPINGS" = "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]] && [[ "$OVS_PHYSICAL_BRIDGE" != "" ]]; then + OVS_BRIDGE_MAPPINGS=$PHYSICAL_NETWORK:$OVS_PHYSICAL_BRIDGE + + # Configure bridge manually with physical interface as port for multi-node + sudo ovs-vsctl --no-wait -- --may-exist add-br $OVS_PHYSICAL_BRIDGE + fi + if [[ "$OVS_BRIDGE_MAPPINGS" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE ovs bridge_mappings $OVS_BRIDGE_MAPPINGS + fi + AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-ofagent-agent" + + # Define extra "AGENT" configuration options when q-agt is configured by defining + # defining the array ``Q_AGENT_EXTRA_AGENT_OPTS``. + # For Example: ``Q_AGENT_EXTRA_AGENT_OPTS=(foo=true bar=2)`` + for I in "${Q_AGENT_EXTRA_AGENT_OPTS[@]}"; do + # Replace the first '=' with ' ' for iniset syntax + iniset /$Q_PLUGIN_CONF_FILE agent ${I/=/ } + done +} + +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 neutron_plugin_check_adv_test_requirements { + is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 +} + +# Restore xtrace +$MY_XTRACE From 46c688c1ae2bdb0fc923635392a602efa3fd38c2 Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Mon, 24 Feb 2014 18:42:37 +0900 Subject: [PATCH 0012/3949] Fix pep8 errors This commit fixes pep8 errors. Change-Id: Ia1f1d61081a86b8a58251918392171cbc60f5ab8 --- tools/jenkins/jenkins_home/print_summary.py | 17 ++++++++++++-- tools/uec/meta.py | 25 ++++++++++++++++----- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/tools/jenkins/jenkins_home/print_summary.py b/tools/jenkins/jenkins_home/print_summary.py index ea943e1caf..ee3790fcda 100755 --- a/tools/jenkins/jenkins_home/print_summary.py +++ b/tools/jenkins/jenkins_home/print_summary.py @@ -1,7 +1,20 @@ #!/usr/bin/python -import urllib + +# 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. + import json import sys +import urllib def print_usage(): @@ -42,4 +55,4 @@ def fetch_blob(url): 'logUrl': log_url, 'healthReport': config['healthReport']}) -print json.dumps(results) +print(json.dumps(results)) diff --git a/tools/uec/meta.py b/tools/uec/meta.py index 5b845d81a6..1d994a60d6 100644 --- a/tools/uec/meta.py +++ b/tools/uec/meta.py @@ -1,10 +1,23 @@ +# 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. + +import BaseHTTPServer +import SimpleHTTPServer import sys -from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler -from SimpleHTTPServer import SimpleHTTPRequestHandler -def main(host, port, HandlerClass = SimpleHTTPRequestHandler, - ServerClass = HTTPServer, protocol="HTTP/1.0"): - """simple http server that listens on a give address:port""" + +def main(host, port, HandlerClass=SimpleHTTPServer.SimpleHTTPRequestHandler, + ServerClass=BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"): + """simple http server that listens on a give address:port.""" server_address = (host, port) @@ -12,7 +25,7 @@ def main(host, port, HandlerClass = SimpleHTTPRequestHandler, httpd = ServerClass(server_address, HandlerClass) sa = httpd.socket.getsockname() - print "Serving HTTP on", sa[0], "port", sa[1], "..." + print("Serving HTTP on", sa[0], "port", sa[1], "...") httpd.serve_forever() if __name__ == '__main__': From 9b3602ccf64f1d690a0a3d4adff987a5a12594b1 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Fri, 28 Feb 2014 13:52:29 -0500 Subject: [PATCH 0013/3949] Fix intermittent error in exercises/floating_ips.sh Every once in a while I see this error running floating_ips.sh: /devstack/exercises/floating_ips.sh:184:ping_check /devstack/functions:356:_ping_check_neutron /devstack/lib/neutron:904:die [ERROR] /devstack/lib/neutron:904 [Fail] Could ping server I think the problem is that it immediately tries to ping right after the icmp rule is deleted. Add a timeout and check so we at least wait one second. Change-Id: I753ec257fa12f6d2ddff1a5b1909e32d8995e173 --- exercises/floating_ips.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh index 8dc44effbc..8b7b96197e 100755 --- a/exercises/floating_ips.sh +++ b/exercises/floating_ips.sh @@ -178,6 +178,10 @@ fi nova secgroup-delete-rule $SECGROUP icmp -1 -1 0.0.0.0/0 || \ die $LINENO "Failure deleting security group rule from $SECGROUP" +if ! timeout $ASSOCIATE_TIMEOUT sh -c "while nova secgroup-list-rules $SECGROUP | grep -q icmp; do sleep 1; done"; then + die $LINENO "Security group rule not deleted from $SECGROUP" +fi + # FIXME (anthony): make xs support security groups if [ "$VIRT_DRIVER" != "xenserver" -a "$VIRT_DRIVER" != "openvz" ]; then # Test we can aren't able to ping our floating ip within ASSOCIATE_TIMEOUT seconds From 729236ca1a38804b3c31ec39ef65592e0108f863 Mon Sep 17 00:00:00 2001 From: Mohammad Banikazemi Date: Wed, 5 Feb 2014 14:45:04 -0500 Subject: [PATCH 0014/3949] Adds support for IBM SDN-VE Neutron plugin This provides the support for the monolithic plugin for IBM SDN-VE that is being added to Neutron here: https://review.openstack.org/#/c/66453/ Implements: blueprint ibm-sdnve-plugin-support Depends-On: I92619a95bca2ae0c37e7fdd39da30119b43d1ad6 DocImpact Change-Id: I0958457355036fdab93156cd7fb4afd1a458918b --- lib/neutron_plugins/ibm | 133 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 lib/neutron_plugins/ibm diff --git a/lib/neutron_plugins/ibm b/lib/neutron_plugins/ibm new file mode 100644 index 0000000000..22c8578e64 --- /dev/null +++ b/lib/neutron_plugins/ibm @@ -0,0 +1,133 @@ +# Neutron IBM SDN-VE plugin +# --------------------------- + +# Save trace setting +MY_XTRACE=$(set +o | grep xtrace) +set +o xtrace + +source $TOP_DIR/lib/neutron_plugins/ovs_base + +function neutron_plugin_install_agent_packages { + _neutron_ovs_base_install_agent_packages +} + +function _neutron_interface_setup { + # Setup one interface on the integration bridge if needed + # The plugin agent to be used if more than one interface is used + local bridge=$1 + local interface=$2 + sudo ovs-vsctl --no-wait -- --may-exist add-port $bridge $interface +} + +function neutron_setup_integration_bridge { + # Setup integration bridge if needed + if [[ "$SDNVE_INTEGRATION_BRIDGE" != "" ]]; then + neutron_ovs_base_cleanup + _neutron_ovs_base_setup_bridge $SDNVE_INTEGRATION_BRIDGE + if [[ "$SDNVE_INTERFACE_MAPPINGS" != "" ]]; then + interfaces=(${SDNVE_INTERFACE_MAPPINGS//[,:]/ }) + _neutron_interface_setup $SDNVE_INTEGRATION_BRIDGE ${interfaces[1]} + fi + fi + + # Set controller to SDNVE controller (1st of list) if exists + if [[ "$SDNVE_CONTROLLER_IPS" != "" ]]; then + # Get the first controller + controllers=(${SDNVE_CONTROLLER_IPS//[\[,\]]/ }) + SDNVE_IP=${controllers[0]} + sudo ovs-vsctl set-controller $SDNVE_INTEGRATION_BRIDGE tcp:$SDNVE_IP + fi +} + +function neutron_plugin_create_nova_conf { + NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"} + # if n-cpu is enabled, then setup integration bridge + if is_service_enabled n-cpu; then + neutron_setup_integration_bridge + fi +} + +function is_neutron_ovs_base_plugin { + if [[ "$SDNVE_INTEGRATION_BRIDGE" != "" ]]; then + # Yes, we use OVS. + return 0 + else + # No, we do not use OVS. + return 1 + fi +} + +function neutron_plugin_configure_common { + Q_PLUGIN_CONF_PATH=etc/neutron/plugins/ibm + Q_PLUGIN_CONF_FILENAME=sdnve_neutron_plugin.ini + Q_DB_NAME="sdnve_neutron" + Q_PLUGIN_CLASS="neutron.plugins.ibm.sdnve_neutron_plugin.SdnvePluginV2" +} + +function neutron_plugin_configure_service { + # Define extra "SDNVE" configuration options when q-svc is configured + + iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver + + if [[ "$SDNVE_CONTROLLER_IPS" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE sdnve controller_ips $SDNVE_CONTROLLER_IPS + fi + + if [[ "$SDNVE_INTEGRATION_BRIDGE" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE sdnve integration_bridge $SDNVE_INTEGRATION_BRIDGE + fi + + if [[ "$SDNVE_RESET_BRIDGE" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE sdnve reset_bridge $SDNVE_RESET_BRIDGE + fi + + if [[ "$SDNVE_OUT_OF_BAND" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE sdnve out_of_band $SDNVE_OUT_OF_BAND + fi + + if [[ "$SDNVE_INTERFACE_MAPPINGS" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE sdnve interface_mappings $SDNVE_INTERFACE_MAPPINGS + fi + + if [[ "$SDNVE_FAKE_CONTROLLER" != "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE sdnve use_fake_controller $SDNVE_FAKE_CONTROLLER + fi + + + iniset $NEUTRON_CONF DEFAULT notification_driver neutron.openstack.common.notifier.no_op_notifier + +} + +function neutron_plugin_configure_plugin_agent { + AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-ibm-agent" +} + +function neutron_plugin_configure_debug_command { + : +} + +function neutron_plugin_setup_interface_driver { + return 0 +} + +function has_neutron_plugin_security_group { + # Does not support Security Groups + return 1 +} + +function neutron_ovs_base_cleanup { + if [[ "$SDNVE_RESET_BRIDGE" != False ]]; then + # 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 integration bridge created by Neutron + for bridge in $(sudo ovs-vsctl list-br | grep -o -e ${SDNVE_INTEGRATION_BRIDGE}); do + sudo ovs-vsctl del-br ${bridge} + done + fi +} + +# Restore xtrace +$MY_XTRACE From 91baef3e26994c64249453dd0b1d8998eda10eca Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 28 Feb 2014 11:11:45 -0600 Subject: [PATCH 0015/3949] Clarify deprecation of EXTRA_xxx_OPTS The various EXTRA_xxx_OPTS variables will be removed in the Juno development cycle, change the README to reflect the new way for the Neutron variables. Change-Id: Ic84da4a9b5a83e66cf0b57d643a87691f15517f0 --- README.md | 50 ++++++++++++++++++++++++++++++++++---------------- stack.sh | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 79 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 9914b1ed69..9304240f70 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ services are started in background and managed by `swift-init` tool. Basic Setup In order to enable Neutron a single node setup, you'll need the -following settings in your `localrc` section: +following settings in your `local.conf`: disable_service n-net enable_service q-svc @@ -172,7 +172,6 @@ following settings in your `localrc` section: enable_service q-l3 enable_service q-meta enable_service q-metering - enable_service neutron # Optional, to enable tempest configuration as part of DevStack enable_service tempest @@ -180,24 +179,44 @@ Then run `stack.sh` as normal. DevStack supports setting specific Neutron configuration flags to the service, Open vSwitch plugin and LinuxBridge plugin configuration files. -To make use of this feature, the following variables are defined and can -be configured in your `localrc` section: +To make use of this feature, the settings can be added to ``local.conf``. +The old ``Q_XXX_EXTRA_XXX_OPTS`` variables are deprecated and will be removed +in the near future. The ``local.conf`` headers for the replacements are: - Variable Name Config File Section Modified - ------------------------------------------------------------------------------------- - Q_SRV_EXTRA_OPTS Plugin `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge) - Q_AGENT_EXTRA_AGENT_OPTS Plugin AGENT - Q_AGENT_EXTRA_SRV_OPTS Plugin `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge) - Q_SRV_EXTRA_DEFAULT_OPTS Service DEFAULT +* ``Q_SRV_EXTRA_OPTS``: + + [[post-config|/$Q_PLUGIN_CONF_FILE]] + [linuxbridge] # or [ovs] + +* ``Q_AGENT_EXTRA_AGENT_OPTS``: + + [[post-config|/$Q_PLUGIN_CONF_FILE]] + [agent] + +* ``Q_AGENT_EXTRA_SRV_OPTS``: -An example of using the variables in your `localrc` section is below: + [[post-config|/$Q_PLUGIN_CONF_FILE]] + [linuxbridge] # or [ovs] + +* ``Q_SRV_EXTRA_DEFAULT_OPTS``: + + [[post-config|$NEUTRON_CONF]] + [DEFAULT] - Q_AGENT_EXTRA_AGENT_OPTS=(tunnel_type=vxlan vxlan_udp_port=8472) - Q_SRV_EXTRA_OPTS=(tenant_network_type=vxlan) +Example extra config in `local.conf`: + + [[post-config|/$Q_PLUGIN_CONF_FILE]] + [agent] + tunnel_type=vxlan + vxlan_udp_port=8472 + + [[post-config|$NEUTRON_CONF]] + [DEFAULT] + tenant_network_type=vxlan DevStack also supports configuring the Neutron ML2 plugin. The ML2 plugin -can run with the OVS, LinuxBridge, or Hyper-V agents on compute hosts. A -simple way to configure the ml2 plugin is shown below: +can run with the OVS, LinuxBridge, or Hyper-V agents on compute hosts. This +is a simple way to configure the ml2 plugin: # VLAN configuration Q_PLUGIN=ml2 @@ -223,7 +242,6 @@ To change this, set the `Q_AGENT` variable to the agent you want to run Q_ML2_PLUGIN_GRE_TYPE_OPTIONS GRE TypeDriver options. Defaults to none. Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS VXLAN TypeDriver options. Defaults to none. Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS VLAN TypeDriver options. Defaults to none. - Q_AGENT_EXTRA_AGENT_OPTS Extra configuration options to pass to the OVS or LinuxBridge Agent. # Heat diff --git a/stack.sh b/stack.sh index ccd567e0bc..988fda5ff1 100755 --- a/stack.sh +++ b/stack.sh @@ -1359,12 +1359,14 @@ if [[ -n "$DEPRECATED_TEXT" ]]; then echo_summary "WARNING: $DEPRECATED_TEXT" fi +# TODO(dtroyer): Remove EXTRA_OPTS after stable/icehouse branch is cut # Specific warning for deprecated configs if [[ -n "$EXTRA_OPTS" ]]; then echo "" echo_summary "WARNING: EXTRA_OPTS is used" echo "You are using EXTRA_OPTS to pass configuration into nova.conf." echo "Please convert that configuration in localrc to a nova.conf section in local.conf:" + echo "EXTRA_OPTS will be removed early in the Juno development cycle" echo " [[post-config|\$NOVA_CONF]] [DEFAULT] @@ -1375,11 +1377,13 @@ if [[ -n "$EXTRA_OPTS" ]]; then done fi +# TODO(dtroyer): Remove EXTRA_BAREMETAL_OPTS after stable/icehouse branch is cut if [[ -n "$EXTRA_BAREMETAL_OPTS" ]]; then echo "" - echo_summary "WARNING: EXTRA_OPTS is used" - echo "You are using EXTRA_OPTS to pass configuration into nova.conf." + echo_summary "WARNING: EXTRA_BAREMETAL_OPTS is used" + echo "You are using EXTRA_BAREMETAL_OPTS to pass configuration into nova.conf." echo "Please convert that configuration in localrc to a nova.conf section in local.conf:" + echo "EXTRA_BAREMETAL_OPTS will be removed early in the Juno development cycle" echo " [[post-config|\$NOVA_CONF]] [baremetal] @@ -1390,13 +1394,49 @@ if [[ -n "$EXTRA_BAREMETAL_OPTS" ]]; then done fi +# TODO(dtroyer): Remove Q_AGENT_EXTRA_AGENT_OPTS after stable/juno branch is cut +if [[ -n "$Q_AGENT_EXTRA_AGENT_OPTS" ]]; then + echo "" + echo_summary "WARNING: Q_AGENT_EXTRA_AGENT_OPTS is used" + echo "You are using Q_AGENT_EXTRA_AGENT_OPTS to pass configuration into $NEUTRON_CONF." + echo "Please convert that configuration in localrc to a $NEUTRON_CONF section in local.conf:" + echo "Q_AGENT_EXTRA_AGENT_OPTS will be removed early in the 'K' development cycle" + echo " +[[post-config|/\$Q_PLUGIN_CONF_FILE]] +[DEFAULT] +" + for I in "${Q_AGENT_EXTRA_AGENT_OPTS[@]}"; do + # Replace the first '=' with ' ' for iniset syntax + echo ${I} + done +fi + +# TODO(dtroyer): Remove Q_AGENT_EXTRA_SRV_OPTS after stable/juno branch is cut +if [[ -n "$Q_AGENT_EXTRA_SRV_OPTS" ]]; then + echo "" + echo_summary "WARNING: Q_AGENT_EXTRA_SRV_OPTS is used" + echo "You are using Q_AGENT_EXTRA_SRV_OPTS to pass configuration into $NEUTRON_CONF." + echo "Please convert that configuration in localrc to a $NEUTRON_CONF section in local.conf:" + echo "Q_AGENT_EXTRA_AGENT_OPTS will be removed early in the 'K' development cycle" + echo " +[[post-config|/\$Q_PLUGIN_CONF_FILE]] +[DEFAULT] +" + for I in "${Q_AGENT_EXTRA_SRV_OPTS[@]}"; do + # Replace the first '=' with ' ' for iniset syntax + echo ${I} + done +fi + +# TODO(dtroyer): Remove Q_DHCP_EXTRA_DEFAULT_OPTS after stable/icehouse branch is cut if [[ -n "$Q_DHCP_EXTRA_DEFAULT_OPTS" ]]; then echo "" echo_summary "WARNING: Q_DHCP_EXTRA_DEFAULT_OPTS is used" echo "You are using Q_DHCP_EXTRA_DEFAULT_OPTS to pass configuration into $Q_DHCP_CONF_FILE." echo "Please convert that configuration in localrc to a $Q_DHCP_CONF_FILE section in local.conf:" + echo "Q_DHCP_EXTRA_DEFAULT_OPTS will be removed early in the Juno development cycle" echo " -[[post-config|\$Q_DHCP_CONF_FILE]] +[[post-config|/\$Q_DHCP_CONF_FILE]] [DEFAULT] " for I in "${Q_DHCP_EXTRA_DEFAULT_OPTS[@]}"; do @@ -1405,11 +1445,13 @@ if [[ -n "$Q_DHCP_EXTRA_DEFAULT_OPTS" ]]; then done fi +# TODO(dtroyer): Remove Q_SRV_EXTRA_DEFAULT_OPTS after stable/icehouse branch is cut if [[ -n "$Q_SRV_EXTRA_DEFAULT_OPTS" ]]; then echo "" echo_summary "WARNING: Q_SRV_EXTRA_DEFAULT_OPTS is used" echo "You are using Q_SRV_EXTRA_DEFAULT_OPTS to pass configuration into $NEUTRON_CONF." echo "Please convert that configuration in localrc to a $NEUTRON_CONF section in local.conf:" + echo "Q_SRV_EXTRA_DEFAULT_OPTS will be removed early in the Juno development cycle" echo " [[post-config|\$NEUTRON_CONF]] [DEFAULT] From 57d478d87438912e1a33d4a2d00d4a300148e2fc Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Fri, 28 Feb 2014 16:37:43 +0000 Subject: [PATCH 0016/3949] Move heat keystone setup into lib/heat Move the heat setup which currently happens in files/keystone_data.sh to lib/heat, where we have create_heat_accounts. Move the user, role, service and endpoint creation as that is consistent with what other services, e.g lib/nova are doing. Change-Id: Iaa2c822cad581d6b2b4f22f8863daf81e25f8485 --- files/keystone_data.sh | 35 ---------------------------------- lib/heat | 43 +++++++++++++++++++++++++++++++++++++++++- stack.sh | 3 +-- 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/files/keystone_data.sh b/files/keystone_data.sh index 9a34c7616f..fc1e8136a4 100755 --- a/files/keystone_data.sh +++ b/files/keystone_data.sh @@ -53,41 +53,6 @@ if [[ "$ENABLED_SERVICES" =~ "n-api" ]] && [[ "$ENABLED_SERVICES" =~ "s-proxy" | --role ResellerAdmin fi -# Heat -if [[ "$ENABLED_SERVICES" =~ "heat" ]]; then - keystone user-create --name=heat \ - --pass="$SERVICE_PASSWORD" \ - --tenant $SERVICE_TENANT_NAME \ - --email=heat@example.com - keystone user-role-add --tenant $SERVICE_TENANT_NAME \ - --user heat \ - --role service - # heat_stack_user role is for users created by Heat - keystone role-create --name heat_stack_user - if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then - keystone service-create \ - --name=heat-cfn \ - --type=cloudformation \ - --description="Heat CloudFormation Service" - keystone endpoint-create \ - --region RegionOne \ - --service heat-cfn \ - --publicurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \ - --adminurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \ - --internalurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" - keystone service-create \ - --name=heat \ - --type=orchestration \ - --description="Heat Service" - keystone endpoint-create \ - --region RegionOne \ - --service heat \ - --publicurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \ - --adminurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \ - --internalurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" - fi -fi - # Glance if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then keystone user-create \ diff --git a/lib/heat b/lib/heat index d0c0302016..42d1057cbd 100644 --- a/lib/heat +++ b/lib/heat @@ -197,8 +197,49 @@ function disk_image_create { } # create_heat_accounts() - Set up common required heat accounts -# Note this is in addition to what is in files/keystone_data.sh function create_heat_accounts { + # migrated from files/keystone_data.sh + SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }") + ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }") + + HEAT_USER=$(openstack user create \ + heat \ + --password "$SERVICE_PASSWORD" \ + --project $SERVICE_TENANT \ + --email heat@example.com \ + | grep " id " | get_field 2) + openstack role add \ + $ADMIN_ROLE \ + --project $SERVICE_TENANT \ + --user $HEAT_USER + if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then + HEAT_SERVICE=$(openstack service create \ + heat \ + --type=orchestration \ + --description="Heat Orchestration Service" \ + | grep " id " | get_field 2) + openstack endpoint create \ + $HEAT_SERVICE \ + --region RegionOne \ + --publicurl "$SERVICE_PROTOCOL://$HEAT_API_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \ + --adminurl "$SERVICE_PROTOCOL://$HEAT_API_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \ + --internalurl "$SERVICE_PROTOCOL://$HEAT_API_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" + HEAT_CFN_SERVICE=$(openstack service create \ + heat \ + --type=cloudformation \ + --description="Heat CloudFormation Service" \ + | grep " id " | get_field 2) + openstack endpoint create \ + $HEAT_CFN_SERVICE \ + --region RegionOne \ + --publicurl "$SERVICE_PROTOCOL://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1" \ + --adminurl "$SERVICE_PROTOCOL://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1" \ + --internalurl "$SERVICE_PROTOCOL://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1" + fi + + # heat_stack_user role is for users created by Heat + openstack role create heat_stack_user + # Note we have to pass token/endpoint here because the current endpoint and # version negotiation in OSC means just --os-identity-api-version=3 won't work KS_ENDPOINT_V3="$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3" diff --git a/stack.sh b/stack.sh index ccd567e0bc..ec8de2d2dd 100755 --- a/stack.sh +++ b/stack.sh @@ -934,8 +934,7 @@ if is_service_enabled key; then ADMIN_PASSWORD=$ADMIN_PASSWORD SERVICE_TENANT_NAME=$SERVICE_TENANT_NAME SERVICE_PASSWORD=$SERVICE_PASSWORD \ SERVICE_TOKEN=$SERVICE_TOKEN SERVICE_ENDPOINT=$SERVICE_ENDPOINT SERVICE_HOST=$SERVICE_HOST \ S3_SERVICE_PORT=$S3_SERVICE_PORT KEYSTONE_CATALOG_BACKEND=$KEYSTONE_CATALOG_BACKEND \ - DEVSTACK_DIR=$TOP_DIR ENABLED_SERVICES=$ENABLED_SERVICES HEAT_API_CFN_PORT=$HEAT_API_CFN_PORT \ - HEAT_API_PORT=$HEAT_API_PORT \ + DEVSTACK_DIR=$TOP_DIR ENABLED_SERVICES=$ENABLED_SERVICES \ bash -x $FILES/keystone_data.sh # Set up auth creds now that keystone is bootstrapped From 2ca3bf18dd756621f012ebb7ffb338f2fa38d6f2 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Mon, 3 Mar 2014 18:07:33 +0000 Subject: [PATCH 0017/3949] Add heat_stack_owner role for heat trusts usage Heat supports deferred operations via keystone trusts, and we'd like to make that the default. To do this, we require a new role, which is the default role specified in heat.conf trusts_delegated_roles, heat_stack_owner. Add the role to the admin/demo users so they can create heat stacks when we make deferred_auth_method=trusts the default. Change-Id: Idfc70ee89428c23f5965e643486ff2ad9566471c Related-Bug: #1286157 --- lib/heat | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/heat b/lib/heat index 42d1057cbd..2d9d863f0c 100644 --- a/lib/heat +++ b/lib/heat @@ -240,6 +240,19 @@ function create_heat_accounts { # heat_stack_user role is for users created by Heat openstack role create heat_stack_user + # heat_stack_owner role is given to users who create Heat stacks, + # it's the default role used by heat to delegate to the heat service + # user (for performing deferred operations via trusts), see heat.conf + HEAT_OWNER_ROLE=$(openstack role create \ + heat_stack_owner \ + | grep " id " | get_field 2) + + # Give the role to the demo and admin users so they can create stacks + # in either of the projects created by devstack + openstack role add $HEAT_OWNER_ROLE --project demo --user demo + openstack role add $HEAT_OWNER_ROLE --project demo --user admin + openstack role add $HEAT_OWNER_ROLE --project admin --user admin + # Note we have to pass token/endpoint here because the current endpoint and # version negotiation in OSC means just --os-identity-api-version=3 won't work KS_ENDPOINT_V3="$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3" From de3b82037d863b55cc245c343a8697b5cf4b1904 Mon Sep 17 00:00:00 2001 From: Shweta P Date: Mon, 3 Mar 2014 13:38:37 -0500 Subject: [PATCH 0018/3949] NCCLIENT_REPO is using the wrong url NCCLIENT_REPO value in lib/neutron_plugins/cisco is pointing to a repo that does not exist. This fix corrects the url. Closes-Bug #1286302 Change-Id: I42db0b3f7a4bbf5d1d053e3da8b4fbb67d47de94 --- lib/neutron_plugins/cisco | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/neutron_plugins/cisco b/lib/neutron_plugins/cisco index 7728eb177f..a1b089e1a3 100644 --- a/lib/neutron_plugins/cisco +++ b/lib/neutron_plugins/cisco @@ -23,7 +23,7 @@ Q_CISCO_PLUGIN_VLAN_RANGES=${Q_CISCO_PLUGIN_VLAN_RANGES:-vlan:1:4094} # Specify ncclient package information NCCLIENT_DIR=$DEST/ncclient NCCLIENT_VERSION=${NCCLIENT_VERSION:-0.3.1} -NCCLIENT_REPO=${NCCLIENT_REPO:-${GIT_BASE}/CiscoSystems/ncclient.git} +NCCLIENT_REPO=${NCCLIENT_REPO:-git://github.com/CiscoSystems/ncclient.git} NCCLIENT_BRANCH=${NCCLIENT_BRANCH:-master} # This routine put a prefix on an existing function name From 753afeba7464464a3fd050eb2085e51580f9b5a7 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Thu, 13 Feb 2014 17:17:30 -0800 Subject: [PATCH 0019/3949] Use neutron security groups in BigSwitch plugin Configures the Big Switch third-party plugin to use neutron security groups instead of nova security groups. Change-Id: I6bc3046ff0e70b8288a7c3f3d6f975376adc081a Implements: blueprint bigswitch-neutron-security --- lib/neutron_plugins/bigswitch_floodlight | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/neutron_plugins/bigswitch_floodlight b/lib/neutron_plugins/bigswitch_floodlight index 4cb0da84ea..b1b77d7606 100644 --- a/lib/neutron_plugins/bigswitch_floodlight +++ b/lib/neutron_plugins/bigswitch_floodlight @@ -38,7 +38,12 @@ function neutron_plugin_configure_l3_agent { } function neutron_plugin_configure_plugin_agent { - : + # Set up integration bridge + _neutron_ovs_base_setup_bridge $OVS_BRIDGE + iniset /$Q_PLUGIN_CONF_FILE restproxyagent integration_bridge $OVS_BRIDGE + AGENT_BINARY="$NEUTRON_DIR/neutron/plugins/bigswitch/agent/restproxy_agent.py" + + _neutron_ovs_base_configure_firewall_driver } function neutron_plugin_configure_service { @@ -61,7 +66,7 @@ function neutron_plugin_setup_interface_driver { function has_neutron_plugin_security_group { # 1 means False here - return 1 + return 0 } function neutron_plugin_check_adv_test_requirements { From 8829acaf141ade6d5ac61ec3d0b15d80e3a09752 Mon Sep 17 00:00:00 2001 From: zhang-jinnan Date: Mon, 3 Mar 2014 10:55:33 +0800 Subject: [PATCH 0020/3949] Remove blank space after print Keep code clean and pleasure:) Change-Id: Ie0c0781eaeb57b32a9a6185a59353fc4b911afd6 --- tools/jenkins/jenkins_home/print_summary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/jenkins/jenkins_home/print_summary.py b/tools/jenkins/jenkins_home/print_summary.py index ea943e1caf..6310b1889f 100755 --- a/tools/jenkins/jenkins_home/print_summary.py +++ b/tools/jenkins/jenkins_home/print_summary.py @@ -5,8 +5,8 @@ def print_usage(): - print ("Usage: %s [jenkins_url (eg. http://50.56.12.202:8080/)]" - % sys.argv[0]) + print("Usage: %s [jenkins_url (eg. http://50.56.12.202:8080/)]" + % sys.argv[0]) sys.exit() From ccf60f75a2a5a0f10412b4f806ac7a123068909b Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 3 Mar 2014 22:48:31 -0500 Subject: [PATCH 0021/3949] Put tempest ipv6 option in the correct group This commit updates the location for the ipv6 option to be in the proper group. This depends on tempest change I35769cf4d18363fad56ed5150b4d01d8a5ad17e7 Change-Id: Ief5ea00649c8954282245e30c63c45557a28ea9f --- lib/tempest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tempest b/lib/tempest index 16f8744d85..1639ae60b4 100644 --- a/lib/tempest +++ b/lib/tempest @@ -293,7 +293,7 @@ function configure_tempest { iniset $TEMPEST_CONFIG network public_network_id "$public_network_id" iniset $TEMPEST_CONFIG network public_router_id "$public_router_id" iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE" - iniset $TEMPEST_CONFIG network ipv6_enabled "$IPV6_ENABLED" + iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED" # boto iniset $TEMPEST_CONFIG boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud" From 314af0a7a97b31ff2a803a77e1a92f5b67857f18 Mon Sep 17 00:00:00 2001 From: Sreeram Yerrapragada Date: Mon, 3 Mar 2014 21:34:45 -0800 Subject: [PATCH 0022/3949] Fix upload function for vmdk files Fix all grep statements failing under -o errexit. Change-Id: I0591a2ba7351d598eb5b29d68a83ce6290600938 --- functions | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/functions b/functions index a844b1c1af..ab8319b0ce 100644 --- a/functions +++ b/functions @@ -55,7 +55,7 @@ function upload_image { mkdir -p $FILES/images IMAGE_FNAME=`basename "$image_url"` if [[ $image_url != file* ]]; then - # Downloads the image (uec ami+aki style), then extracts it. + # Downloads the image (uec ami+akistyle), then extracts it. if [[ ! -f $FILES/$IMAGE_FNAME || "$(stat -c "%s" $FILES/$IMAGE_FNAME)" = "0" ]]; then wget -c $image_url -O $FILES/$IMAGE_FNAME if [[ $? -ne 0 ]]; then @@ -103,12 +103,12 @@ function upload_image { vmdk_net_adapter="" # vmdk adapter type - vmdk_adapter_type="$(head -25 $IMAGE | grep -a -F -m 1 'ddb.adapterType =' $IMAGE)" + vmdk_adapter_type="$(head -25 $IMAGE | { grep -a -F -m 1 'ddb.adapterType =' $IMAGE || true; })" vmdk_adapter_type="${vmdk_adapter_type#*\"}" vmdk_adapter_type="${vmdk_adapter_type%?}" # vmdk disk type - vmdk_create_type="$(head -25 $IMAGE | grep -a -F -m 1 'createType=' $IMAGE)" + vmdk_create_type="$(head -25 $IMAGE | { grep -a -F -m 1 'createType=' $IMAGE || true; })" vmdk_create_type="${vmdk_create_type#*\"}" vmdk_create_type="${vmdk_create_type%\"*}" @@ -119,7 +119,7 @@ function upload_image { elif [[ "$vmdk_create_type" = "monolithicFlat" || \ "$vmdk_create_type" = "vmfs" ]]; then # Attempt to retrieve the *-flat.vmdk - flat_fname="$(head -25 $IMAGE | grep -G 'RW\|RDONLY [0-9]+ FLAT\|VMFS' $IMAGE)" + flat_fname="$(head -25 $IMAGE | { grep -G 'RW\|RDONLY [0-9]+ FLAT\|VMFS' $IMAGE || true; })" flat_fname="${flat_fname#*\"}" flat_fname="${flat_fname%?}" if [[ -z "$flat_name" ]]; then @@ -190,7 +190,7 @@ function upload_image { fi if $descriptor_found; then vmdk_adapter_type="$(head -25 $descriptor_url |"` - `"grep -a -F -m 1 'ddb.adapterType =' $descriptor_url)" + `" { grep -a -F -m 1 'ddb.adapterType =' $descriptor_url || true; })" vmdk_adapter_type="${vmdk_adapter_type#*\"}" vmdk_adapter_type="${vmdk_adapter_type%?}" fi @@ -203,7 +203,7 @@ function upload_image { # NOTE: For backwards compatibility reasons, colons may be used in place # of semi-colons for property delimiters but they are not permitted # characters in NTFS filesystems. - property_string=`echo "$IMAGE_NAME" | grep -oP '(?<=-)(?!.*-).*[:;].*[:;].*$'` + property_string=`echo "$IMAGE_NAME" | { grep -oP '(?<=-)(?!.*-).*[:;].*[:;].*$' || true; }` IFS=':;' read -a props <<< "$property_string" vmdk_disktype="${props[0]:-$vmdk_disktype}" vmdk_adapter_type="${props[1]:-$vmdk_adapter_type}" From a439faa85b89b0d2c73085743426fd8741293cb6 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 24 Feb 2014 20:32:19 +0900 Subject: [PATCH 0023/3949] Update required packages for ryu Sync with the recent reality. Change-Id: I4c37d09e511f3763d2267267815387bd5c825e0e Closes-Bug: 1287541 --- files/apts/ryu | 4 +--- files/rpms-suse/ryu | 4 +--- files/rpms/ryu | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/files/apts/ryu b/files/apts/ryu index e8ed926c1e..9b850807e6 100644 --- a/files/apts/ryu +++ b/files/apts/ryu @@ -1,4 +1,2 @@ -python-gevent -python-gflags -python-netifaces +python-eventlet python-sphinx diff --git a/files/rpms-suse/ryu b/files/rpms-suse/ryu index 3797b6cb44..6b426fb163 100644 --- a/files/rpms-suse/ryu +++ b/files/rpms-suse/ryu @@ -1,4 +1,2 @@ python-Sphinx -python-gevent -python-netifaces -python-python-gflags +python-eventlet diff --git a/files/rpms/ryu b/files/rpms/ryu index e8ed926c1e..9b850807e6 100644 --- a/files/rpms/ryu +++ b/files/rpms/ryu @@ -1,4 +1,2 @@ -python-gevent -python-gflags -python-netifaces +python-eventlet python-sphinx From 0e598c3c81fc3d652415095101a095de69ec8a6d Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 24 Feb 2014 22:02:08 +0900 Subject: [PATCH 0024/3949] Stop running setup_devel for Ryu It doesn't work here for various reasons. - Ryu's setup.py is incompatible with global requirements - This code is called before install_infra. Ryu is not a part of OpenStack anyway. Closes-Bug: 1287569 Change-Id: I01a942411f7d06bdf8f1fec5d1a0bc319560f329 --- lib/neutron_thirdparty/ryu | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/neutron_thirdparty/ryu b/lib/neutron_thirdparty/ryu index 424a90041e..b2c1b613fe 100644 --- a/lib/neutron_thirdparty/ryu +++ b/lib/neutron_thirdparty/ryu @@ -18,14 +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 neutron_pluing/ryu may call -# this function for neutron-ryu-agent -_RYU_CONFIGURED=${_RYU_CONFIGURED:-False} function configure_ryu { - if [[ "$_RYU_CONFIGURED" == "False" ]]; then - setup_develop $RYU_DIR - _RYU_CONFIGURED=True - fi + : } function init_ryu { @@ -63,6 +57,7 @@ _RYU_INSTALLED=${_RYU_INSTALLED:-False} function install_ryu { if [[ "$_RYU_INSTALLED" == "False" ]]; then git_clone $RYU_REPO $RYU_DIR $RYU_BRANCH + export PYTHONPATH=$RYU_DIR:$PYTHONPATH _RYU_INSTALLED=True fi } From d5b52ca7557ec1aef71f21c71110455a6aea2505 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 4 Mar 2014 09:23:07 -0500 Subject: [PATCH 0025/3949] fix tgt to use 'service' instead of upstart calls the comments in here were largely about oneric, which we don't support any more. service is installed in a precise environment, and will support debian and the upcoming transition to systemd better, so use that instead. Change-Id: If15493549a8c93a7387df9b3bba31443aed46995 --- lib/cinder | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/cinder b/lib/cinder index d003f5dc7b..dd2956a5b4 100644 --- a/lib/cinder +++ b/lib/cinder @@ -491,10 +491,7 @@ function start_cinder { sudo rm -f /etc/tgt/conf.d/stack.conf _configure_tgt_for_config_d if is_ubuntu; then - # tgt in oneiric doesn't restart properly if tgtd isn't running - # do it in two steps - sudo stop tgt || true - sudo start tgt + sudo service tgt restart elif is_fedora; then if [[ $DISTRO =~ (rhel6) ]]; then sudo /sbin/service tgtd restart From a67cb1af4df6b5c758c319e0590a3188d951e68d Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Tue, 4 Mar 2014 18:38:33 +0400 Subject: [PATCH 0026/3949] Fix typo in ironic configure function IRONIC_CONF should be replaced by IRONIC_CONF_FILE Change-Id: Ie43e376f42f14c46d21df7dbb19db923521f438b --- lib/ironic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ironic b/lib/ironic index 4e5edc90cf..b346de1e69 100644 --- a/lib/ironic +++ b/lib/ironic @@ -124,7 +124,7 @@ function configure_ironic_conductor { cp $IRONIC_DIR/etc/ironic/rootwrap.conf $IRONIC_ROOTWRAP_CONF cp -r $IRONIC_DIR/etc/ironic/rootwrap.d $IRONIC_CONF_DIR - iniset $IRONIC_CONF DEFAULT rootwrap_config $IRONIC_ROOTWRAP_CONF + iniset $IRONIC_CONF_FILE DEFAULT rootwrap_config $IRONIC_ROOTWRAP_CONF } # create_ironic_cache_dir() - Part of the init_ironic() process From 3d2bdf50bc0110c718de39606c8b803696a31285 Mon Sep 17 00:00:00 2001 From: Eric Windisch Date: Sat, 1 Mar 2014 00:17:32 -0500 Subject: [PATCH 0027/3949] Use cat instead of read Date: Tue, 4 Mar 2014 15:02:04 -0500 Subject: [PATCH 0028/3949] fix typo in lib/ceilometer this should be is_service_enabled and not service_enabled. Not sure why it passes in the gate, but it fails in stackforge jobs. Change-Id: I876f72cd98ff9c8e4ea28832bc9ac6bbdc3b865d --- lib/ceilometer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ceilometer b/lib/ceilometer index 2e6e7c5a76..04c1a34b8b 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -209,7 +209,7 @@ function start_ceilometer { screen_it ceilometer-api "cd ; ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF" # only die on API if it was actually intended to be turned on - if service_enabled ceilometer-api; then + if is_service_enabled ceilometer-api; then echo "Waiting for ceilometer-api to start..." if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl --noproxy '*' -s http://localhost:8777/v2/ >/dev/null; do sleep 1; done"; then die $LINENO "ceilometer-api did not start" From e2aa91b237e7e23f70847cba60a54a40560a5a3c Mon Sep 17 00:00:00 2001 From: Malini Kamalambal Date: Tue, 4 Mar 2014 04:40:19 -0500 Subject: [PATCH 0029/3949] Enable marconi-server to run when USE_SCREEN=false This patch, 1. adds log_file option to marconi.conf 2. redirects the output from marconi-server, in the same precedent set by another project. Change-Id: Ib273a03625d5a4edf8bb3ed7d522d2b087975acd --- lib/marconi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/marconi b/lib/marconi index 29ae386d9f..a96137fc04 100644 --- a/lib/marconi +++ b/lib/marconi @@ -34,7 +34,8 @@ MARCONI_DIR=$DEST/marconi MARCONICLIENT_DIR=$DEST/python-marconiclient MARCONI_CONF_DIR=/etc/marconi MARCONI_CONF=$MARCONI_CONF_DIR/marconi.conf -MARCONI_API_LOG_DIR=/var/log/marconi-api +MARCONI_API_LOG_DIR=/var/log/marconi +MARCONI_API_LOG_FILE=$MARCONI_API_LOG_DIR/queues.log MARCONI_AUTH_CACHE_DIR=${MARCONI_AUTH_CACHE_DIR:-/var/cache/marconi} # Support potential entry-points console scripts @@ -96,6 +97,7 @@ function configure_marconi { iniset $MARCONI_CONF DEFAULT verbose True iniset $MARCONI_CONF DEFAULT use_syslog $SYSLOG + iniset $MARCONI_CONF DEFAULT log_file $MARCONI_API_LOG_FILE iniset $MARCONI_CONF 'drivers:transport:wsgi' bind $MARCONI_SERVICE_HOST iniset $MARCONI_CONF keystone_authtoken auth_protocol http @@ -148,7 +150,7 @@ function install_marconiclient { # start_marconi() - Start running processes, including screen function start_marconi { - screen_it marconi-server "marconi-server --config-file $MARCONI_CONF" + screen_it marconi-server "marconi-server --config-file $MARCONI_CONF 2>&1" echo "Waiting for Marconi to start..." if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- $MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT/v1/health; do sleep 1; done"; then die $LINENO "Marconi did not start" From ae1728917373986b68d2b0abe2e7052fb78e5903 Mon Sep 17 00:00:00 2001 From: ronak Date: Tue, 4 Mar 2014 15:48:22 -0800 Subject: [PATCH 0030/3949] Supporting Nuage Networks' Plugin through devstack Nuage networks' plugin specific configuration setting file for devstack Change-Id: I936f87b8fbc6f90130514b2fc0d111eab861da7c Implements: blueprint nuage-networks-plugin --- lib/neutron_plugins/nuage | 69 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 lib/neutron_plugins/nuage diff --git a/lib/neutron_plugins/nuage b/lib/neutron_plugins/nuage new file mode 100644 index 0000000000..3649f39bfd --- /dev/null +++ b/lib/neutron_plugins/nuage @@ -0,0 +1,69 @@ +# Nuage Neutron Plugin +# ---------------------- + +# Save trace setting +MY_XTRACE=$(set +o | grep xtrace) +set +o xtrace + +function neutron_plugin_create_nova_conf { + NOVA_OVS_BRIDGE=${NOVA_OVS_BRIDGE:-"br-int"} + iniset $NOVA_CONF DEFAULT neutron_ovs_bridge $NOVA_OVS_BRIDGE + NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"} + LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver + iniset $NOVA_CONF DEFAULT firewall_driver $LIBVIRT_FIREWALL_DRIVER +} + +function neutron_plugin_install_agent_packages { + : +} + +function neutron_plugin_configure_common { + Q_PLUGIN_CONF_PATH=etc/neutron/plugins/nuage + Q_PLUGIN_CONF_FILENAME=nuage_plugin.ini + Q_DB_NAME="nuage_neutron" + Q_PLUGIN_CLASS="neutron.plugins.nuage.plugin.NuagePlugin" + Q_PLUGIN_EXTENSIONS_PATH=neutron/plugins/nuage/extensions + #Nuage specific Neutron defaults. Actual value must be set and sourced + NUAGE_CNA_SERVERS=${NUAGE_CNA_SERVERS:-'localhost:8443'} + NUAGE_CNA_SERVER_AUTH=${NUAGE_CNA_SERVER_AUTH:-'username:password'} + NUAGE_CNA_ORGANIZATION=${NUAGE_CNA_ORGANIZATION:-'org'} + NUAGE_CNA_SERVER_SSL=${NUAGE_CNA_SERVER_SSL:-'True'} + NUAGE_CNA_BASE_URI=${NUAGE_CNA_BASE_URI:-'/'} + NUAGE_CNA_AUTH_RESOURCE=${NUAGE_CNA_AUTH_RESOURCE:-'/'} + NUAGE_CNA_DEF_NETPART_NAME=${NUAGE_CNA_DEF_NETPART_NAME:-''} +} + +function neutron_plugin_configure_debug_command { + : +} + +function neutron_plugin_configure_dhcp_agent { + : +} + +function neutron_plugin_configure_l3_agent { + : +} + +function neutron_plugin_configure_plugin_agent { + : +} + +function neutron_plugin_configure_service { + iniset $NEUTRON_CONF DEFAULT api_extensions_path neutron/plugins/nuage/extensions/ + iniset /$Q_PLUGIN_CONF_FILE restproxy base_uri $NUAGE_CNA_BASE_URI + iniset /$Q_PLUGIN_CONF_FILE restproxy serverssl $NUAGE_CNA_SERVER_SSL + iniset /$Q_PLUGIN_CONF_FILE restproxy serverauth $NUAGE_CNA_SERVER_AUTH + iniset /$Q_PLUGIN_CONF_FILE restproxy organization $NUAGE_CNA_ORGANIZATION + iniset /$Q_PLUGIN_CONF_FILE restproxy server $NUAGE_CNA_SERVERS + iniset /$Q_PLUGIN_CONF_FILE restproxy auth_resource $NUAGE_CNA_AUTH_RESOURCE + iniset /$Q_PLUGIN_CONF_FILE restproxy default_net_partition_name $NUAGE_CNA_DEF_NETPART_NAME +} + +function has_neutron_plugin_security_group { + # 1 means False here + return 1 +} + +# Restore xtrace +$MY_XTRACE From 8068455a023063b615fc66ee038211a9ae300a81 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 5 Mar 2014 11:50:23 -0600 Subject: [PATCH 0031/3949] Close all logging file descriptors This has lingered for a long time, finally do something about it... Change-Id: Ib90408187698d5d4c23ffb0e527011446efc3c7e --- stack.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stack.sh b/stack.sh index ab1e8fe94d..32dac0f443 100755 --- a/stack.sh +++ b/stack.sh @@ -1419,3 +1419,9 @@ fi # Indicate how long this took to run (bash maintained variable ``SECONDS``) echo_summary "stack.sh completed in $SECONDS seconds." + +# Restore/close logging file descriptors +exec 1>&3 +exec 2>&3 +exec 3>&- +exec 6>&- From 961328fc4622b16135d6d580429dc3e5db01ded5 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Wed, 5 Mar 2014 18:45:56 +0100 Subject: [PATCH 0032/3949] Fix marconi's storage setting for MongoDB The storage driver should be set to mongodb and the driver's uri to the mongodb:// uri. Change-Id: I6193a5d78f6cd7283b4e3b1831978883b9e99b06 --- lib/marconi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/marconi b/lib/marconi index 29ae386d9f..8f4f3c6bbc 100644 --- a/lib/marconi +++ b/lib/marconi @@ -105,7 +105,8 @@ function configure_marconi { iniset $MARCONI_CONF keystone_authtoken signing_dir $MARCONI_AUTH_CACHE_DIR if [[ "$MARCONI_BACKEND" = 'mongodb' ]]; then - iniset $MARCONI_CONF database connection mongodb://localhost:27017/marconi + iniset $MARCONI_CONF drivers storage mongodb + iniset $MARCONI_CONF 'drivers:storage:mongodb' uri mongodb://localhost:27017/marconi configure_mongodb cleanup_marconi fi From 5fc5b7e231710c2d67522d1bcabdc448dadd0f94 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Wed, 5 Mar 2014 18:49:02 +0100 Subject: [PATCH 0033/3949] Add support for sqlalchemy to Marconi This patch adds a way to setup a marconi instance using sqlalchemy. Change-Id: Ia694b76286835ca2ca935814370aa43544fe84fa --- lib/marconi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/marconi b/lib/marconi index 8f4f3c6bbc..1e0cc7df08 100644 --- a/lib/marconi +++ b/lib/marconi @@ -104,7 +104,10 @@ function configure_marconi { iniset $MARCONI_CONF keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME iniset $MARCONI_CONF keystone_authtoken signing_dir $MARCONI_AUTH_CACHE_DIR - if [[ "$MARCONI_BACKEND" = 'mongodb' ]]; then + if [ "$MARCONI_BACKEND" = 'mysql' ] || [ "$MARCONI_BACKEND" = 'postgresql' ] ; then + iniset $MARCONI_CONF drivers storage sqlalchemy + iniset $MARCONI_CONF 'drivers:storage:sqlalchemy' uri `database_connection_url marconi` + else iniset $MARCONI_CONF drivers storage mongodb iniset $MARCONI_CONF 'drivers:storage:mongodb' uri mongodb://localhost:27017/marconi configure_mongodb From d46d9dd8de00d07eee9170365b1a025f0fc01ed9 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Wed, 5 Mar 2014 13:38:19 +0000 Subject: [PATCH 0034/3949] Inject all account details in tempest.conf The tempest configuration function did not inject all account details in tempest.conf. The only reason why it worked, was because tempest uses default config values which are valid for the current devstack setup. To remove this dependency, two patches are needed: - this one in devstack, to inject all values - https://review.openstack.org/#/c/77602/ in tempest, to change default values to None Partially fixes bug 1287191 Change-Id: I01507b142703a1ff66707464b9a743e9d0ca3e01 --- lib/tempest | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/tempest b/lib/tempest index 16f8744d85..8455aae170 100644 --- a/lib/tempest +++ b/lib/tempest @@ -149,8 +149,12 @@ function configure_tempest { password=${ADMIN_PASSWORD:-secrete} - # See files/keystone_data.sh where alt_demo user - # and tenant are set up... + # See files/keystone_data.sh and stack.sh where admin, demo and alt_demo + # user and tenant are set up... + ADMIN_USERNAME=${ADMIN_USERNAME:-admin} + ADMIN_TENANT_NAME=${ADMIN_TENANT_NAME:-admin} + TEMPEST_USERNAME=${TEMPEST_USERNAME:-demo} + TEMPEST_TENANT_NAME=${TEMPEST_TENANT_NAME:-demo} ALT_USERNAME=${ALT_USERNAME:-alt_demo} ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo} @@ -254,11 +258,15 @@ function configure_tempest { # Identity iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/" iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v3/" + iniset $TEMPEST_CONFIG identity username $TEMPEST_USERNAME iniset $TEMPEST_CONFIG identity password "$password" + iniset $TEMPEST_CONFIG identity tenant_name $TEMPEST_TENANT_NAME iniset $TEMPEST_CONFIG identity alt_username $ALT_USERNAME iniset $TEMPEST_CONFIG identity alt_password "$password" iniset $TEMPEST_CONFIG identity alt_tenant_name $ALT_TENANT_NAME + iniset $TEMPEST_CONFIG identity admin_username $ADMIN_USERNAME iniset $TEMPEST_CONFIG identity admin_password "$password" + iniset $TEMPEST_CONFIG identity admin_tenant_name $ADMIN_TENANT_NAME # Image # for the gate we want to be able to override this variable so we aren't @@ -285,7 +293,9 @@ function configure_tempest { iniset $TEMPEST_CONFIG compute ssh_connect_method $ssh_connect_method # Compute admin + iniset $TEMPEST_CONFIG "compute-admin" username $USERNAME iniset $TEMPEST_CONFIG "compute-admin" password "$password" # DEPRECATED + iniset $TEMPEST_CONFIG "compute-admin" tenant_name $TENANT_NAME # Network iniset $TEMPEST_CONFIG network api_version 2.0 From 99b622a936c0b6f5b6283f3bcdca3bd7d0628e29 Mon Sep 17 00:00:00 2001 From: Ryan Hsu Date: Wed, 5 Mar 2014 15:35:49 -0800 Subject: [PATCH 0035/3949] Refactor vmdk upload code A syntax error is hit when trying to upload a flat vmdk file that is accompanied by a descriptor file. The code block that handles this has some unneeded characters that cause the error. Also, an else-block has been removed so that we can remove an extra indent. Change-Id: Iaf5c914e09da6831eeeec141228b39554a1e2216 Closes-bug: #1288471 --- functions | 51 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/functions b/functions index ab8319b0ce..1d30922916 100644 --- a/functions +++ b/functions @@ -163,38 +163,37 @@ function upload_image { if [[ ${IMAGE_NAME: -5} != "-flat" ]]; then warn $LINENO "Expected filename suffix: '-flat'."` `" Filename provided: ${IMAGE_NAME}" - else - descriptor_fname="${IMAGE_NAME:0:${#IMAGE_NAME} - 5}.vmdk" - path_len=`expr ${#image_url} - ${#IMAGE_FNAME}` - flat_path="${image_url:0:$path_len}" - descriptor_url=$flat_path$descriptor_fname - warn $LINENO "$descriptor_data_pair_msg"` - `" Attempt to retrieve the descriptor *.vmdk: $descriptor_url" - if [[ $flat_path != file* ]]; then - if [[ ! -f $FILES/$descriptor_fname || \ - "$(stat -c "%s" $FILES/$descriptor_fname)" = "0" ]]; then - wget -c $descriptor_url -O $FILES/$descriptor_fname - if [[ $? -ne 0 ]]; then - warn $LINENO "Descriptor not found $descriptor_url" - descriptor_found=false - fi - fi - descriptor_url="$FILES/$descriptor_fname" - else - descriptor_url=$(echo $descriptor_url | sed "s/^file:\/\///g") - if [[ ! -f $descriptor_url || \ - "$(stat -c "%s" $descriptor_url)" == "0" ]]; then + fi + + descriptor_fname="${IMAGE_NAME:0:${#IMAGE_NAME} - 5}.vmdk" + path_len=`expr ${#image_url} - ${#IMAGE_FNAME}` + flat_path="${image_url:0:$path_len}" + descriptor_url=$flat_path$descriptor_fname + warn $LINENO "$descriptor_data_pair_msg"` + `" Attempt to retrieve the descriptor *.vmdk: $descriptor_url" + if [[ $flat_path != file* ]]; then + if [[ ! -f $FILES/$descriptor_fname || \ + "$(stat -c "%s" $FILES/$descriptor_fname)" = "0" ]]; then + wget -c $descriptor_url -O $FILES/$descriptor_fname + if [[ $? -ne 0 ]]; then warn $LINENO "Descriptor not found $descriptor_url" descriptor_found=false fi fi - if $descriptor_found; then - vmdk_adapter_type="$(head -25 $descriptor_url |"` - `" { grep -a -F -m 1 'ddb.adapterType =' $descriptor_url || true; })" - vmdk_adapter_type="${vmdk_adapter_type#*\"}" - vmdk_adapter_type="${vmdk_adapter_type%?}" + descriptor_url="$FILES/$descriptor_fname" + else + descriptor_url=$(echo $descriptor_url | sed "s/^file:\/\///g") + if [[ ! -f $descriptor_url || \ + "$(stat -c "%s" $descriptor_url)" == "0" ]]; then + warn $LINENO "Descriptor not found $descriptor_url" + descriptor_found=false fi fi + if $descriptor_found; then + vmdk_adapter_type="$(head -25 $descriptor_url | { grep -a -F -m 1 'ddb.adapterType =' $descriptor_url || true; })" + vmdk_adapter_type="${vmdk_adapter_type#*\"}" + vmdk_adapter_type="${vmdk_adapter_type%?}" + fi vmdk_disktype="preallocated" else vmdk_disktype="preallocated" From 581f0ee48510d8eead8a95888ad9b56d89009a76 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Thu, 20 Feb 2014 16:28:15 +0100 Subject: [PATCH 0036/3949] Add a few missing package for SUSE Additionally rearranged the package list to be alphabetically sorrted Change-Id: I52cea97da60437250d0b7cf86a71e4a05d765568 --- files/rpms-suse/baremetal | 1 + files/rpms-suse/general | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 files/rpms-suse/baremetal diff --git a/files/rpms-suse/baremetal b/files/rpms-suse/baremetal new file mode 100644 index 0000000000..61f73eeae3 --- /dev/null +++ b/files/rpms-suse/baremetal @@ -0,0 +1 @@ +dnsmasq diff --git a/files/rpms-suse/general b/files/rpms-suse/general index 704947ea53..6d994eaf7a 100644 --- a/files/rpms-suse/general +++ b/files/rpms-suse/general @@ -1,15 +1,20 @@ +bc bridge-utils ca-certificates-mozilla curl euca2ools +findutils-locate # useful when debugging git-core iputils +libopenssl-devel # to rebuild pyOpenSSL if needed +lsof # useful when debugging +make openssh openssl psmisc -python-setuptools # instead of python-distribute; dist:sle11sp2 python-cmd2 # dist:opensuse-12.3 python-pylint +python-setuptools # instead of python-distribute; dist:sle11sp2 python-unittest2 screen tar @@ -17,7 +22,3 @@ tcpdump unzip vim-enhanced wget -bc - -findutils-locate # useful when debugging -lsof # useful when debugging From 4d8af4aa05a76219b634d02485ae637a404b399f Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Thu, 6 Mar 2014 15:07:53 +0400 Subject: [PATCH 0037/3949] Add n-obj to stop_nova Add missing nova-object service to nova services list Change-Id: Ib26204b69356ad030ba3d03f095993370fbb2676 --- lib/nova | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nova b/lib/nova index 583a5923ce..2d8715ba48 100644 --- a/lib/nova +++ b/lib/nova @@ -731,7 +731,7 @@ function stop_nova { # Kill the nova screen windows # Some services are listed here twice since more than one instance # of a service may be running in certain configs. - for serv in n-api n-cpu n-crt n-net n-sch n-novnc n-xvnc n-cauth n-spice n-cond n-cell n-cell n-api-meta; do + for serv in n-api n-cpu n-crt n-net n-sch n-novnc n-xvnc n-cauth n-spice n-cond n-cell n-cell n-api-meta n-obj; do screen_stop $serv done if is_service_enabled n-cpu && [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then From 423d7901a4cd6bc95188e023625b4e21251fad28 Mon Sep 17 00:00:00 2001 From: Nadya Privalova Date: Thu, 6 Mar 2014 15:14:59 +0400 Subject: [PATCH 0038/3949] Add an ability to configure debug-level for ceilometer Change-Id: Ibe9dd2391202a5af291d2eed1559bae60370f9a8 --- lib/ceilometer | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ceilometer b/lib/ceilometer index 04c1a34b8b..b0899e2f24 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -129,6 +129,7 @@ function configure_ceilometer { iniset $CEILOMETER_CONF DEFAULT notification_topics 'notifications' iniset $CEILOMETER_CONF DEFAULT verbose True + iniset $CEILOMETER_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL" # Install the policy file for the API server cp $CEILOMETER_DIR/etc/ceilometer/policy.json $CEILOMETER_CONF_DIR From d44517dfcfacb5aa9e1952847a1505fd3a92580b Mon Sep 17 00:00:00 2001 From: Kyle Mestery Date: Tue, 28 Jan 2014 20:29:18 +0000 Subject: [PATCH 0039/3949] Add support for configuring OVS to work with OpenDaylight This adds support for running OpenDaylight as an OpenStack Neutron plugin under devstack. This entails downloading the latest version of OpenDaylight, configuring it, and running it as a service under devstack. This code also includes pieces which configure Open vSwitch on each devstack node to point at OpenDaylight as their OpenFlow and OVSDB control interface. This is required for compute hosts, which will not be running any Neutron software on them at all. This post-devstack configuration is handled in the extras directory because of the fact there is no Neutron code running on the compute hosts themselves. Closes-bug: #1273917 Change-Id: I696e7c7fe63c835f90c56105775def305a702877 --- extras.d/80-opendaylight.sh | 67 ++++++++++++++ files/apts/opendaylight | 2 + files/rpms-suse/opendaylight | 4 + files/rpms/opendaylight | 1 + lib/opendaylight | 167 +++++++++++++++++++++++++++++++++++ 5 files changed, 241 insertions(+) create mode 100644 extras.d/80-opendaylight.sh create mode 100644 files/apts/opendaylight create mode 100644 files/rpms-suse/opendaylight create mode 100644 files/rpms/opendaylight create mode 100644 lib/opendaylight diff --git a/extras.d/80-opendaylight.sh b/extras.d/80-opendaylight.sh new file mode 100644 index 0000000000..cc5c8dec1a --- /dev/null +++ b/extras.d/80-opendaylight.sh @@ -0,0 +1,67 @@ +# opendaylight.sh - DevStack extras script + +# Need this first to get the is_***_enabled for ODL +source $TOP_DIR/lib/opendaylight + +if is_service_enabled odl-server; then + if [[ "$1" == "source" ]]; then + # no-op + : + elif [[ "$1" == "stack" && "$2" == "install" ]]; then + install_opendaylight + configure_opendaylight + init_opendaylight + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + # This has to start before Neutron + start_opendaylight + elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then + # no-op + : + fi + + if [[ "$1" == "unstack" ]]; then + stop_opendaylight + cleanup_opendaylight + fi + + if [[ "$1" == "clean" ]]; then + # no-op + : + fi +fi + +if is_service_enabled odl-compute; then + if [[ "$1" == "source" ]]; then + # no-op + : + elif [[ "$1" == "stack" && "$2" == "install" ]]; then + install_opendaylight-compute + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + create_nova_conf_neutron + elif [[ "$1" == "stack" && "$2" == "extra" ]]; then + echo_summary "Initializing OpenDaylight" + ODL_LOCAL_IP=${ODL_LOCAL_IP:-$HOST_IP} + ODL_MGR_PORT=${ODL_MGR_PORT:-6640} + read ovstbl <<< $(sudo ovs-vsctl get Open_vSwitch . _uuid) + sudo ovs-vsctl set-manager tcp:$ODL_MGR_IP:$ODL_MGR_PORT + sudo ovs-vsctl set Open_vSwitch $ovstbl other_config={"local_ip"="$ODL_LOCAL_IP"} + elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then + # no-op + : + fi + + if [[ "$1" == "unstack" ]]; then + sudo ovs-vsctl del-manager + BRIDGES=$(sudo ovs-vsctl list-br) + for bridge in $BRIDGES ; do + sudo ovs-vsctl del-controller $bridge + done + + stop_opendaylight-compute + fi + + if [[ "$1" == "clean" ]]; then + # no-op + : + fi +fi diff --git a/files/apts/opendaylight b/files/apts/opendaylight new file mode 100644 index 0000000000..ec3cc9daf8 --- /dev/null +++ b/files/apts/opendaylight @@ -0,0 +1,2 @@ +openvswitch-datapath-dkms # NOPRIME +openvswitch-switch # NOPRIME diff --git a/files/rpms-suse/opendaylight b/files/rpms-suse/opendaylight new file mode 100644 index 0000000000..d6c7146331 --- /dev/null +++ b/files/rpms-suse/opendaylight @@ -0,0 +1,4 @@ +openvswitch # NOPRIME +openvswitch-controller # NOPRIME +openvswitch-switch # NOPRIME + diff --git a/files/rpms/opendaylight b/files/rpms/opendaylight new file mode 100644 index 0000000000..98aaaf48f7 --- /dev/null +++ b/files/rpms/opendaylight @@ -0,0 +1 @@ +openvswitch # NOPRIME diff --git a/lib/opendaylight b/lib/opendaylight new file mode 100644 index 0000000000..ca81c20e55 --- /dev/null +++ b/lib/opendaylight @@ -0,0 +1,167 @@ +# lib/opendaylight +# Functions to control the configuration and operation of the opendaylight service + +# Dependencies: +# +# - ``functions`` file +# # ``DEST`` must be defined +# # ``STACK_USER`` must be defined + +# ``stack.sh`` calls the entry points in this order: +# +# - is_opendaylight_enabled +# - is_opendaylight-compute_enabled +# - install_opendaylight +# - install_opendaylight-compute +# - configure_opendaylight +# - init_opendaylight +# - start_opendaylight +# - stop_opendaylight-compute +# - stop_opendaylight +# - cleanup_opendaylight + +# Save trace setting +XTRACE=$(set +o | grep xtrace) +set +o xtrace + + +# For OVS_BRIDGE and PUBLIC_BRIDGE +source $TOP_DIR/lib/neutron_plugins/ovs_base + +# Defaults +# -------- + +# The IP address of ODL. Set this in local.conf. +# ODL_MGR_IP= +ODL_MGR_IP=${ODL_MGR_IP:-$SERVICE_HOST} + +# +ODL_DIR=$DEST/opendaylight + +# The OpenDaylight Package, currently using 'Hydrogen' release +ODL_PKG=${ODL_PKG:-distributions-virtualization-0.1.1-osgipackage.zip} + +# The OpenDaylight URL +ODL_URL=${ODL_URL:-https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distributions-virtualization/0.1.1} + +# Default arguments for OpenDaylight. This is typically used to set +# Java memory options. +# ODL_ARGS=Xmx1024m -XX:MaxPermSize=512m +ODL_ARGS=${ODL_ARGS:-"-XX:MaxPermSize=384m"} + +# How long to pause after ODL starts to let it complete booting +ODL_BOOT_WAIT=${ODL_BOOT_WAIT:-60} + +# Set up default directories + + +# Entry Points +# ------------ + +# Test if OpenDaylight is enabled +# is_opendaylight_enabled +function is_opendaylight_enabled { + [[ ,${ENABLED_SERVICES} =~ ,"odl-" ]] && return 0 + return 1 +} + +# cleanup_opendaylight() - Remove residual data files, anything left over from previous +# runs that a clean run would need to clean up +function cleanup_opendaylight { + : +} + +# configure_opendaylight() - Set config files, create data dirs, etc +function configure_opendaylight { + # Remove simple forwarder + rm -f $ODL_DIR/opendaylight/plugins/org.opendaylight.controller.samples.simpleforwarding* + + # Configure OpenFlow 1.3 + echo "ovsdb.of.version=1.3" >> $ODL_DIR/opendaylight/configuration/config.ini +} + +# init_opendaylight() - Initialize databases, etc. +function init_opendaylight { + # clean up from previous (possibly aborted) runs + # create required data files + : +} + +# install_opendaylight() - Collect source and prepare +function install_opendaylight { + local _pwd=$(pwd) + + if is_ubuntu; then + install_package maven openjdk-7-jre openjdk-7-jdk + else + yum_install maven java-1.7.0-openjdk + fi + + # Download OpenDaylight + mkdir -p $ODL_DIR + cd $ODL_DIR + wget -N $ODL_URL/$ODL_PKG + unzip -u $ODL_PKG +} + +# install_opendaylight-compute - Make sure OVS is install +function install_opendaylight-compute { + local kernel_version + # Install deps + # 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 + elif is_fedora; then + install_package openvswitch + # Ensure that the service is started + restart_service openvswitch + elif is_suse; then + install_package openvswitch + restart_service openvswitch-switch + restart_service openvswitch-controller + fi +} + +# start_opendaylight() - Start running processes, including screen +function start_opendaylight { + if is_ubuntu; then + JHOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64 + else + JHOME=/usr/lib/jvm/java-1.7.0-openjdk + fi + + # The flags to ODL have the following meaning: + # -of13: runs ODL using OpenFlow 1.3 protocol support. + # -virt ovsdb: Runs ODL in "virtualization" mode with OVSDB support + screen_it odl-server "cd $ODL_DIR/opendaylight && JAVE_HOME=$JHOME ./run.sh $ODL_ARGS -of13 -virt ovsdb" + + # Sleep a bit to let OpenDaylight finish starting up + sleep $ODL_BOOT_WAIT +} + +# stop_opendaylight() - Stop running processes (non-screen) +function stop_opendaylight { + screen_stop odl-server +} + +# stop_opendaylight-compute() - Remove OVS bridges +function stop_opendaylight-compute { + # 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 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 +} + +# Restore xtrace +$XTRACE + +# Tell emacs to use shell-script-mode +## Local variables: +## mode: shell-script +## End: From a99b869d3c14b33d0cf59877f3ae60686763f8ae Mon Sep 17 00:00:00 2001 From: Sergey Skripnick Date: Wed, 5 Mar 2014 14:47:58 +0200 Subject: [PATCH 0040/3949] Do not restart libvirt if n-cpu is disabled If this service is disable in localrc, libvirt does not installed at all, and should not be restarted. Change-Id: Iaf482d4a82a26546c25249b3e32c7e629d862a1b Closes: bug 1288236 --- lib/nova | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nova b/lib/nova index 583a5923ce..2f6d04db78 100644 --- a/lib/nova +++ b/lib/nova @@ -308,7 +308,7 @@ function configure_nova { # Rebuild the config file from scratch create_nova_conf - if [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then + if is_service_enabled n-cpu && [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then # Configure hypervisor plugin configure_nova_hypervisor fi From b44a8ef14f4e177aef0528db2b7721030f76b290 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 6 Mar 2014 11:25:04 -0600 Subject: [PATCH 0041/3949] Fix errexit in lib/ldap clear_ldap_state() deletes an object from the DIT that doesn't exist on the first run, this is OK but fails with errexit enabled. Change-Id: I3b881eedc891caa6b2dfd5913e43f3babcfa7d47 --- lib/ldap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ldap b/lib/ldap index 51d02519af..efe2f096d7 100644 --- a/lib/ldap +++ b/lib/ldap @@ -154,7 +154,7 @@ function stop_ldap { # clear_ldap_state() - Clear LDAP State function clear_ldap_state { - ldapdelete -x -w $LDAP_PASSWORD -D "$LDAP_MANAGER_DN" -H $LDAP_URL -r "$LDAP_BASE_DN" + ldapdelete -x -w $LDAP_PASSWORD -D "$LDAP_MANAGER_DN" -H $LDAP_URL -r "$LDAP_BASE_DN" || : } # Restore xtrace From 1eae3e155a25faa8e0bb6ddba77e580c774fd265 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 6 Mar 2014 11:49:22 -0600 Subject: [PATCH 0042/3949] Make stop_swift() more robust for Grenade stop_swift() wasn't calling screen_stop() so the pid files and screen sessions were not being cleaned up. DevStack doesn't really care but Grenade does for the 'base' copy of DevStack. This should be backported to stable/havana for this reason. Change-Id: Ib5afb321cef2b7ad74e69a3fd0d1dad469f78b11 --- lib/swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/swift b/lib/swift index 5d4d4ef506..b8bc1b66e7 100644 --- a/lib/swift +++ b/lib/swift @@ -687,6 +687,11 @@ function stop_swift { swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true fi # Dump all of the servers + # Maintain the iteration as screen_stop() has some desirable side-effects + for type in proxy object container account; do + screen_stop s-${type} + done + # Blast out any stragglers pkill -f swift- } From f5d2a5ceb4030aa0868b11ef84b5055b70693702 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 6 Mar 2014 13:45:42 -0500 Subject: [PATCH 0043/3949] test for adding crazy branches as found by dansmith's clever hack, if devstack lands a crazy branch name in stackrc, we'd break the devstack gate. While it's doubtful anyone would do this, add a basic sanity check. Change-Id: Ib3b1881ed4fd520a1828ed073a7c8353e6f0a839 --- run_tests.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/run_tests.sh b/run_tests.sh index a0bfbee0c0..685b2037f0 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -27,3 +27,16 @@ fi echo "Running bash8..." ./tools/bash8.py -v $FILES + + +# Test that no one is trying to land crazy refs as branches + +echo "Ensuring we don't have crazy refs" + +REFS=`grep BRANCH stackrc | grep -v -- '-master'` +rc=$? +if [[ $rc -eq 0 ]]; then + echo "Branch defaults must be master. Found:" + echo $REFS + exit 1 +fi From 07f1d0ef3d638d2289a45a17546e976907e004ee Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Thu, 6 Mar 2014 23:23:01 +0000 Subject: [PATCH 0044/3949] Iniset keystone auth version Introduces support for suth_version config flag in lib/tempest. The variable is named TEMPEST_AUTH_VERSION, and it can be set via localrc, so that the devstack-vm-gate-wrap may control it. The aim is to setup a keystone v3 based experimental check job in tempest experimental pipeline. Partially implements bp multi-keystone-api-version-tests Change-Id: Ia6832d87308c6c7109e6ae0dbd8dff61134718ee --- lib/tempest | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tempest b/lib/tempest index 8455aae170..b90988d1d9 100644 --- a/lib/tempest +++ b/lib/tempest @@ -267,6 +267,7 @@ function configure_tempest { iniset $TEMPEST_CONFIG identity admin_username $ADMIN_USERNAME iniset $TEMPEST_CONFIG identity admin_password "$password" iniset $TEMPEST_CONFIG identity admin_tenant_name $ADMIN_TENANT_NAME + iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2} # Image # for the gate we want to be able to override this variable so we aren't From e530ba30a6965c016934819be5b1cfcaa6879b75 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 7 Mar 2014 05:58:18 -0500 Subject: [PATCH 0045/3949] make compute-admin correct we lost the admin tenant at some point in the last couple of days which disabled 500 tempest tests. Bring this back. Change-Id: I5cab2074777cab99982ae8fc4a83663e9d128284 --- lib/tempest | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tempest b/lib/tempest index 8455aae170..b3736da963 100644 --- a/lib/tempest +++ b/lib/tempest @@ -293,9 +293,9 @@ function configure_tempest { iniset $TEMPEST_CONFIG compute ssh_connect_method $ssh_connect_method # Compute admin - iniset $TEMPEST_CONFIG "compute-admin" username $USERNAME - iniset $TEMPEST_CONFIG "compute-admin" password "$password" # DEPRECATED - iniset $TEMPEST_CONFIG "compute-admin" tenant_name $TENANT_NAME + iniset $TEMPEST_CONFIG "compute-admin" username $ADMIN_USERNAME + iniset $TEMPEST_CONFIG "compute-admin" password "$password" + iniset $TEMPEST_CONFIG "compute-admin" tenant_name $ADMIN_TENANT_NAME # Network iniset $TEMPEST_CONFIG network api_version 2.0 From bb1e07859cce688e3beed2c573e9073a72f778fb Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Thu, 6 Mar 2014 09:40:27 -0800 Subject: [PATCH 0046/3949] Don't install vim or locate by default Devstack doesn't need vim or locate, if someone wants to use them, they can just install them afterwards. Change-Id: I00f27c20c86d89465e4aefc67ed645a309c09a03 --- files/apts/general | 2 -- files/rpms-suse/general | 2 -- tools/xen/prepare_guest.sh | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/files/apts/general b/files/apts/general index 32d31f0642..995c0c6f88 100644 --- a/files/apts/general +++ b/files/apts/general @@ -9,8 +9,6 @@ git lsof # useful when debugging openssh-server openssl -vim-nox -locate # useful when debugging python-virtualenv python-unittest2 iputils-ping diff --git a/files/rpms-suse/general b/files/rpms-suse/general index 6d994eaf7a..ff27a3aac7 100644 --- a/files/rpms-suse/general +++ b/files/rpms-suse/general @@ -3,7 +3,6 @@ bridge-utils ca-certificates-mozilla curl euca2ools -findutils-locate # useful when debugging git-core iputils libopenssl-devel # to rebuild pyOpenSSL if needed @@ -20,5 +19,4 @@ screen tar tcpdump unzip -vim-enhanced wget diff --git a/tools/xen/prepare_guest.sh b/tools/xen/prepare_guest.sh index 440774ec5b..2b5e418a6a 100755 --- a/tools/xen/prepare_guest.sh +++ b/tools/xen/prepare_guest.sh @@ -73,7 +73,7 @@ EOF # Install basics apt-get update apt-get install -y cracklib-runtime curl wget ssh openssh-server tcpdump ethtool -apt-get install -y curl wget ssh openssh-server python-pip git vim-nox sudo python-netaddr +apt-get install -y curl wget ssh openssh-server python-pip git sudo python-netaddr pip install xenapi # Install XenServer guest utilities From b27f16d71660f75fcd82a035cdaf2b2eddec99ce Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 28 Feb 2014 14:29:02 +1100 Subject: [PATCH 0047/3949] Detect missing packages with yum yum -y doesn't report an error when packages are missing (see [1] for upstream discussion). Thus we run the output of yum through a small awk script looking for missing packages output. The one change required for RHEL is that python-wsgiref is included in the distro python, so doesn't need a separate package. [1] https://bugzilla.redhat.com/show_bug.cgi?id=965567 Change-Id: I9908ff4edbf2b0d961d25837a08a34e1417bbb02 --- files/rpms/glance | 2 +- functions-common | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/files/rpms/glance b/files/rpms/glance index 25c5d3902b..534097a92f 100644 --- a/files/rpms/glance +++ b/files/rpms/glance @@ -13,6 +13,6 @@ python-lxml #dist:f18,f19,f20,rhel7 python-paste-deploy #dist:f18,f19,f20,rhel7 python-routes python-sqlalchemy -python-wsgiref +python-wsgiref #dist:f18,f19,f20 pyxattr zlib-devel # testonly diff --git a/functions-common b/functions-common index 0db3ff3e7c..ed3d8832fd 100644 --- a/functions-common +++ b/functions-common @@ -938,9 +938,24 @@ function yum_install { [[ "$OFFLINE" = "True" ]] && return local sudo="sudo" [[ "$(id -u)" = "0" ]] && sudo="env" + + # The manual check for missing packages is because yum -y assumes + # missing packages are OK. See + # https://bugzilla.redhat.com/show_bug.cgi?id=965567 $sudo http_proxy=$http_proxy https_proxy=$https_proxy \ no_proxy=$no_proxy \ - yum install -y "$@" + yum install -y "$@" 2>&1 | \ + awk ' + BEGIN { fail=0 } + /No package/ { fail=1 } + { print } + END { exit fail }' || \ + die $LINENO "Missing packages detected" + + # also ensure we catch a yum failure + if [[ ${PIPESTATUS[0]} != 0 ]]; then + die $LINENO "Yum install failure" + fi } # zypper wrapper to set arguments correctly From f19ccb63593e4c3e6c1c2a7d4f2552c30ca1ee62 Mon Sep 17 00:00:00 2001 From: Samuel Merritt Date: Sat, 8 Mar 2014 07:54:05 -0800 Subject: [PATCH 0048/3949] Take tempurl out of Swift pipeline additions Swift commit 165dd44 added tempurl to the sample config, so now it appears twice in the default devstack-installed configuration. This commit removes tempurl from $SWIFT_EXTRAS_MIDDLEWARE so that it only appears once in the generated proxy pipeline. Change-Id: I4204b2a444312ab87c17f5fb296a43818a4528a6 --- lib/swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/swift b/lib/swift index b8bc1b66e7..b65544046a 100644 --- a/lib/swift +++ b/lib/swift @@ -67,8 +67,8 @@ fi SWIFT_LOOPBACK_DISK_SIZE=${SWIFT_LOOPBACK_DISK_SIZE:-$SWIFT_LOOPBACK_DISK_SIZE_DEFAULT} # Set ``SWIFT_EXTRAS_MIDDLEWARE`` to extras middlewares. -# Default is ``staticweb, tempurl, formpost`` -SWIFT_EXTRAS_MIDDLEWARE=${SWIFT_EXTRAS_MIDDLEWARE:-tempurl formpost staticweb} +# Default is ``staticweb, formpost`` +SWIFT_EXTRAS_MIDDLEWARE=${SWIFT_EXTRAS_MIDDLEWARE:-formpost staticweb} # Set ``SWIFT_EXTRAS_MIDDLEWARE_LAST`` to extras middlewares that need to be at # the end of the pipeline. From 11b36c9b0a0a04ff3a53ae95c6de94fdd457f5e7 Mon Sep 17 00:00:00 2001 From: Roey Chen Date: Mon, 10 Mar 2014 11:25:50 +0200 Subject: [PATCH 0049/3949] Fixed unconditioned source phase in OpenDaylight extras Should source ``lib/opendaylight`` in ``extras.d/80-opendaylight.sh`` only when appropriate services are enabled. Fix for bug/1290033 Change-Id: Ifa470e1e132029f3c5bf255f27c4e96373b339a8 Signed-off-by: Roey Chen --- extras.d/80-opendaylight.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extras.d/80-opendaylight.sh b/extras.d/80-opendaylight.sh index cc5c8dec1a..57b43288e0 100644 --- a/extras.d/80-opendaylight.sh +++ b/extras.d/80-opendaylight.sh @@ -1,7 +1,9 @@ # opendaylight.sh - DevStack extras script -# Need this first to get the is_***_enabled for ODL -source $TOP_DIR/lib/opendaylight +if is_service_enabled odl-server odl-compute; then + # Initial source + [[ "$1" == "source" ]] && source $TOP_DIR/lib/opendaylight +fi if is_service_enabled odl-server; then if [[ "$1" == "source" ]]; then From d9259ea466e54349fa87e7f76b7dfd061b19423c Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 10 Mar 2014 08:39:15 -0400 Subject: [PATCH 0050/3949] remove distros that are out of support by their upstream raring EOL was - 27 Jan 2014 f18 EOL was - 14 Jan 2014 opensuse 12.2 was - 15 Jan 2014 if their upstream isn't going to support them, we shouldn't be in devstack. this additionally leaves us in an interesting situation that there is no longer *any* opensuse version listed as supported. if the opensuse community doesn't step up here we should probably look at removing it. Change-Id: Ibb883930b430477dfd3b5126c5db04f95a50d3a7 --- stack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index 148ce04e28..e76a55c534 100755 --- a/stack.sh +++ b/stack.sh @@ -142,7 +142,7 @@ disable_negated_services # Warn users who aren't on an explicitly supported distro, but allow them to # override check and attempt installation with ``FORCE=yes ./stack`` -if [[ ! ${DISTRO} =~ (precise|raring|saucy|trusty|7.0|wheezy|sid|testing|jessie|f18|f19|f20|opensuse-12.2|rhel6) ]]; then +if [[ ! ${DISTRO} =~ (precise|saucy|trusty|7.0|wheezy|sid|testing|jessie|f19|f20|rhel6) ]]; then echo "WARNING: this script has not been tested on $DISTRO" if [[ "$FORCE" != "yes" ]]; then die $LINENO "If you wish to run this script anyway run with FORCE=yes" From 353c4f1240d974e9ce93ba1f00a4bc7fe2c5856e Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 10 Mar 2014 08:44:18 -0400 Subject: [PATCH 0051/3949] remove additional f18 references f18 has been EOL for 6 weeks now, time to purge it from devstack Change-Id: I5aac2c63b2f4cd8b01ae685b1acf4c188637558b --- files/rpms/cinder | 2 +- files/rpms/glance | 4 ++-- files/rpms/horizon | 4 ++-- files/rpms/keystone | 8 ++++---- files/rpms/neutron | 4 ++-- files/rpms/nova | 6 +++--- files/rpms/swift | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/files/rpms/cinder b/files/rpms/cinder index 199ae10b79..423d57cd98 100644 --- a/files/rpms/cinder +++ b/files/rpms/cinder @@ -4,4 +4,4 @@ qemu-img python-devel postgresql-devel iscsi-initiator-utils -python-lxml #dist:f18,f19,f20,rhel7 +python-lxml #dist:f19,f20,rhel7 diff --git a/files/rpms/glance b/files/rpms/glance index 25c5d3902b..c886ecee10 100644 --- a/files/rpms/glance +++ b/files/rpms/glance @@ -9,8 +9,8 @@ python-argparse python-devel python-eventlet python-greenlet -python-lxml #dist:f18,f19,f20,rhel7 -python-paste-deploy #dist:f18,f19,f20,rhel7 +python-lxml #dist:f19,f20,rhel7 +python-paste-deploy #dist:f19,f20,rhel7 python-routes python-sqlalchemy python-wsgiref diff --git a/files/rpms/horizon b/files/rpms/horizon index 59503cc9aa..2dd24e0763 100644 --- a/files/rpms/horizon +++ b/files/rpms/horizon @@ -16,8 +16,8 @@ python-kombu python-migrate python-mox python-nose -python-paste #dist:f18,f19,f20 -python-paste-deploy #dist:f18,f19,f20 +python-paste #dist:f19,f20 +python-paste-deploy #dist:f19,f20 python-routes python-sphinx python-sqlalchemy diff --git a/files/rpms/keystone b/files/rpms/keystone index 99e8524628..7182091b31 100644 --- a/files/rpms/keystone +++ b/files/rpms/keystone @@ -1,9 +1,9 @@ python-greenlet libxslt-devel # dist:f20 -python-lxml #dist:f18,f19,f20 -python-paste #dist:f18,f19,f20 -python-paste-deploy #dist:f18,f19,f20 -python-paste-script #dist:f18,f19,f20 +python-lxml #dist:f19,f20 +python-paste #dist:f19,f20 +python-paste-deploy #dist:f19,f20 +python-paste-script #dist:f19,f20 python-routes python-sqlalchemy python-webob diff --git a/files/rpms/neutron b/files/rpms/neutron index 42d7f68d37..06ea0ea35d 100644 --- a/files/rpms/neutron +++ b/files/rpms/neutron @@ -11,8 +11,8 @@ python-greenlet python-iso8601 python-kombu #rhel6 gets via pip -python-paste # dist:f18,f19,f20,rhel7 -python-paste-deploy # dist:f18,f19,f20,rhel7 +python-paste # dist:f19,f20,rhel7 +python-paste-deploy # dist:f19,f20,rhel7 python-qpid python-routes python-sqlalchemy diff --git a/files/rpms/nova b/files/rpms/nova index a607d925e1..45d6e0bfb1 100644 --- a/files/rpms/nova +++ b/files/rpms/nova @@ -28,11 +28,11 @@ python-kombu python-lockfile python-migrate python-mox -python-paramiko # dist:f18,f19,f20,rhel7 +python-paramiko # dist:f19,f20,rhel7 # ^ on RHEL6, brings in python-crypto which conflicts with version from # pip we need -python-paste # dist:f18,f19,f20,rhel7 -python-paste-deploy # dist:f18,f19,f20,rhel7 +python-paste # dist:f19,f20,rhel7 +python-paste-deploy # dist:f19,f20,rhel7 python-qpid python-routes python-sqlalchemy diff --git a/files/rpms/swift b/files/rpms/swift index 72253f7752..bf29ea29b7 100644 --- a/files/rpms/swift +++ b/files/rpms/swift @@ -9,7 +9,7 @@ python-eventlet python-greenlet python-netifaces python-nose -python-paste-deploy # dist:f18,f19,f20,rhel7 +python-paste-deploy # dist:f19,f20,rhel7 python-simplejson python-webob pyxattr From 13349080b11383697f7c5312c357cc6c336ff9ba Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 10 Mar 2014 11:27:23 -0400 Subject: [PATCH 0052/3949] put libvirt debug in the right place libvirt debug setting was happening in a place where we weren't actually resetting the daemon. Move it to into the hypervisor plugin where we do. Change-Id: Ia79b0ef50f6b8fb007a20ce5cb4e510a5e4600a5 --- lib/nova | 11 ----------- lib/nova_plugins/hypervisor-libvirt | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/nova b/lib/nova index 583a5923ce..f5e0d11281 100644 --- a/lib/nova +++ b/lib/nova @@ -665,17 +665,6 @@ function start_nova_compute { fi if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then - # Enable client side traces for libvirt - local log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 1:util" - local log_outputs="1:file:/var/log/libvirt/libvirtd.log" - # Enable server side traces for libvirtd - if ! grep -q "log_filters=\"$log_filters\"" /etc/libvirt/libvirtd.conf; then - echo "log_filters=\"$log_filters\"" | sudo tee -a /etc/libvirt/libvirtd.conf - fi - if ! grep -q "log_outputs=\"$log_outputs\"" /etc/libvirt/libvirtd.conf; then - echo "log_outputs=\"$log_outputs\"" | sudo tee -a /etc/libvirt/libvirtd.conf - fi - # The group **$LIBVIRT_GROUP** is added to the current user in this script. # Use 'sg' to execute nova-compute as a member of the **$LIBVIRT_GROUP** group. screen_it n-cpu "cd $NOVA_DIR && sg $LIBVIRT_GROUP '$NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf'" diff --git a/lib/nova_plugins/hypervisor-libvirt b/lib/nova_plugins/hypervisor-libvirt index bbf65546f7..26880e5850 100644 --- a/lib/nova_plugins/hypervisor-libvirt +++ b/lib/nova_plugins/hypervisor-libvirt @@ -103,6 +103,16 @@ EOF fi add_user_to_group $STACK_USER $LIBVIRT_GROUP + # Enable server side traces for libvirtd + local log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 1:util" + local log_outputs="1:file:/var/log/libvirt/libvirtd.log" + if ! grep -q "log_filters=\"$log_filters\"" /etc/libvirt/libvirtd.conf; then + echo "log_filters=\"$log_filters\"" | sudo tee -a /etc/libvirt/libvirtd.conf + fi + if ! grep -q "log_outputs=\"$log_outputs\"" /etc/libvirt/libvirtd.conf; then + echo "log_outputs=\"$log_outputs\"" | sudo tee -a /etc/libvirt/libvirtd.conf + fi + # libvirt detects various settings on startup, as we potentially changed # the system configuration (modules, filesystems), we need to restart # libvirt to detect those changes. From 2983474e37d6c97c482e154a1f0d1f60a709915b Mon Sep 17 00:00:00 2001 From: Attila Fazekas Date: Sun, 9 Mar 2014 18:36:42 +0100 Subject: [PATCH 0053/3949] Use the $SERVICE_HOST in backup_swift_url The $SERVICE_HOST is used to specify the swift proxy endpoint, the c-bak should use the same endpoint. Change-Id: Ia815f514839b0d1ec3fb9bb40992637c4f123e06 --- lib/cinder | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cinder b/lib/cinder index dd2956a5b4..dadbe40a3b 100644 --- a/lib/cinder +++ b/lib/cinder @@ -274,6 +274,10 @@ function configure_cinder { iniset $CINDER_CONF DEFAULT lock_path $CINDER_STATE_PATH iniset $CINDER_CONF DEFAULT periodic_interval $CINDER_PERIODIC_INTERVAL + if is_service_enabled swift; then + iniset $CINDER_CONF DEFAULT backup_swift_url "http://$SERVICE_HOST:8080/v1/AUTH_" + fi + if is_service_enabled ceilometer; then iniset $CINDER_CONF DEFAULT notification_driver "cinder.openstack.common.notifier.rpc_notifier" fi From cea32b1f86631761e170413124dbf80972234a8c Mon Sep 17 00:00:00 2001 From: Aaron Rosen Date: Tue, 4 Mar 2014 16:20:14 -0800 Subject: [PATCH 0054/3949] Configuration needed for neutron nova callback Change-Id: I07cb476f5e87e967cd6fbbfc82881e8a147453b4 --- lib/neutron | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/neutron b/lib/neutron index bb591abb0b..84e827761a 100644 --- a/lib/neutron +++ b/lib/neutron @@ -110,6 +110,10 @@ Q_USE_DEBUG_COMMAND=${Q_USE_DEBUG_COMMAND:-False} Q_ROUTER_NAME=${Q_ROUTER_NAME:-router1} # nova vif driver that all plugins should use NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"} +Q_NOTIFY_NOVA_PORT_STATUS_CHANGE=${Q_NOTIFY_NOVA_PORT_STATUS_CHANGE:-True} +Q_NOTIFY_NOVA_ON_PORT_DATA_CHANGES=${Q_NOTIFY_NOVA_PORT_CHANGE:-True} +VIF_PLUGGING_IS_FATAL=${VIF_PLUGGING_IS_FATAL:-True} +VIF_PLUGGING_TIMEOUT=${VIF_PLUGGING_TIMEOUT:-300} # The next two variables are configured by plugin # e.g. _configure_neutron_l3_agent or lib/neutron_plugins/* @@ -313,6 +317,9 @@ function create_nova_conf_neutron { if is_service_enabled q-meta; then iniset $NOVA_CONF DEFAULT service_neutron_metadata_proxy "True" fi + + iniset $NOVA_CONF DEFAULT vif_plugging_is_fatal "$VIF_PLUGGING_IS_FATAL" + iniset $NOVA_CONF DEFAULT vif_plugging_timeout "$VIF_PLUGGING_TIMEOUT" } # create_neutron_cache_dir() - Part of the _neutron_setup_keystone() process @@ -754,6 +761,16 @@ function _configure_neutron_service { iniset $NEUTRON_CONF DEFAULT ${I/=/ } done + # Configuration for neutron notifations to nova. + iniset $NEUTRON_CONF DEFAULT notify_nova_port_status_change $Q_NOTIFY_NOVA_PORT_STATUS_CHANGE + iniset $NEUTRON_CONF DEFAULT notify_nova_on_port_data_changes $Q_NOTIFY_NOVA_ON_PORT_DATA_CHANGES + iniset $NEUTRON_CONF DEFAULT nova_url "$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT/v2" + iniset $NEUTRON_CONF DEFAULT nova_admin_username nova $NOVA_USER + iniset $NEUTRON_CONF DEFAULT nova_admin_password $SERVICE_PASSWORD + ADMIN_TENANT_ID=$(openstack project list | awk "/ service / { print \$2 }") + iniset $NEUTRON_CONF DEFAULT nova_admin_tenant_id $ADMIN_TENANT_ID + iniset $NEUTRON_CONF DEFAULT nova_admin_auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0" + # Configure plugin neutron_plugin_configure_service } From 42a59c2bfae69eca5520748d6b45803a387fdb88 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Mon, 3 Mar 2014 14:31:29 -0600 Subject: [PATCH 0055/3949] Complete moving Keystone setup out of keystone_data.sh * Move remaining role creation to create_keystone_accounts() * Move glance creation to create_glance_accounts() * Move nova/ec2/s3 creation to create_nova_accounts() * Move ceilometer creation to create_ceilometer_accounts() * Move tempest creation to create_tempest_accounts() * Convert moved code to use OpenStackClient for setup * files/keystone_data.sh is removed Note that the SERVICE_TENANT and ADMIN_ROLE lookups in the other service implementations are not necessary with OSC, all operations can be done using names rather than requiring IDs. Change-Id: I4283ca0036ae39fd44ed2eed834b69d78e4f8257 --- extras.d/80-tempest.sh | 2 +- files/keystone_data.sh | 146 ----------------------------------------- lib/ceilometer | 12 ++++ lib/glance | 43 ++++++++++++ lib/keystone | 19 ++++-- lib/nova | 47 ++++++++++++- lib/tempest | 24 +++++++ stack.sh | 21 ++---- 8 files changed, 146 insertions(+), 168 deletions(-) delete mode 100755 files/keystone_data.sh diff --git a/extras.d/80-tempest.sh b/extras.d/80-tempest.sh index 0186e36aee..74f4c60d10 100644 --- a/extras.d/80-tempest.sh +++ b/extras.d/80-tempest.sh @@ -9,7 +9,7 @@ if is_service_enabled tempest; then install_tempest elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then # Tempest config must come after layer 2 services are running - : + create_tempest_accounts elif [[ "$1" == "stack" && "$2" == "extra" ]]; then echo_summary "Initializing Tempest" configure_tempest diff --git a/files/keystone_data.sh b/files/keystone_data.sh deleted file mode 100755 index fc1e8136a4..0000000000 --- a/files/keystone_data.sh +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/bash -# -# Initial data for Keystone using python-keystoneclient -# -# Tenant User Roles -# ------------------------------------------------------------------ -# service glance service -# service glance-swift ResellerAdmin -# service heat service # if enabled -# service ceilometer admin # if enabled -# Tempest Only: -# alt_demo alt_demo Member -# -# Variables set before calling this script: -# SERVICE_TOKEN - aka admin_token in keystone.conf -# SERVICE_ENDPOINT - local Keystone admin endpoint -# SERVICE_TENANT_NAME - name of tenant containing service accounts -# SERVICE_HOST - host used for endpoint creation -# ENABLED_SERVICES - stack.sh's list of services to start -# DEVSTACK_DIR - Top-level DevStack directory -# KEYSTONE_CATALOG_BACKEND - used to determine service catalog creation - -# Defaults -# -------- - -ADMIN_PASSWORD=${ADMIN_PASSWORD:-secrete} -SERVICE_PASSWORD=${SERVICE_PASSWORD:-$ADMIN_PASSWORD} -export SERVICE_TOKEN=$SERVICE_TOKEN -export SERVICE_ENDPOINT=$SERVICE_ENDPOINT -SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service} - -# Roles -# ----- - -# The ResellerAdmin role is used by Nova and Ceilometer so we need to keep it. -# The admin role in swift allows a user to act as an admin for their tenant, -# but ResellerAdmin is needed for a user to act as any tenant. The name of this -# role is also configurable in swift-proxy.conf -keystone role-create --name=ResellerAdmin -# Service role, so service users do not have to be admins -keystone role-create --name=service - - -# Services -# -------- - -if [[ "$ENABLED_SERVICES" =~ "n-api" ]] && [[ "$ENABLED_SERVICES" =~ "s-proxy" || "$ENABLED_SERVICES" =~ "swift" ]]; then - # Nova needs ResellerAdmin role to download images when accessing - # swift through the s3 api. - keystone user-role-add \ - --tenant $SERVICE_TENANT_NAME \ - --user nova \ - --role ResellerAdmin -fi - -# Glance -if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then - keystone user-create \ - --name=glance \ - --pass="$SERVICE_PASSWORD" \ - --tenant $SERVICE_TENANT_NAME \ - --email=glance@example.com - keystone user-role-add \ - --tenant $SERVICE_TENANT_NAME \ - --user glance \ - --role service - # required for swift access - if [[ "$ENABLED_SERVICES" =~ "s-proxy" ]]; then - keystone user-create \ - --name=glance-swift \ - --pass="$SERVICE_PASSWORD" \ - --tenant $SERVICE_TENANT_NAME \ - --email=glance-swift@example.com - keystone user-role-add \ - --tenant $SERVICE_TENANT_NAME \ - --user glance-swift \ - --role ResellerAdmin - fi - if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then - keystone service-create \ - --name=glance \ - --type=image \ - --description="Glance Image Service" - keystone endpoint-create \ - --region RegionOne \ - --service glance \ - --publicurl "http://$SERVICE_HOST:9292" \ - --adminurl "http://$SERVICE_HOST:9292" \ - --internalurl "http://$SERVICE_HOST:9292" - fi -fi - -# Ceilometer -if [[ "$ENABLED_SERVICES" =~ "ceilometer" ]] && [[ "$ENABLED_SERVICES" =~ "s-proxy" || "$ENABLED_SERVICES" =~ "swift" ]]; then - # Ceilometer needs ResellerAdmin role to access swift account stats. - keystone user-role-add --tenant $SERVICE_TENANT_NAME \ - --user ceilometer \ - --role ResellerAdmin -fi - -# EC2 -if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then - if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then - keystone service-create \ - --name=ec2 \ - --type=ec2 \ - --description="EC2 Compatibility Layer" - keystone endpoint-create \ - --region RegionOne \ - --service ec2 \ - --publicurl "http://$SERVICE_HOST:8773/services/Cloud" \ - --adminurl "http://$SERVICE_HOST:8773/services/Admin" \ - --internalurl "http://$SERVICE_HOST:8773/services/Cloud" - fi -fi - -# S3 -if [[ "$ENABLED_SERVICES" =~ "n-obj" || "$ENABLED_SERVICES" =~ "swift3" ]]; then - if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then - keystone service-create \ - --name=s3 \ - --type=s3 \ - --description="S3" - keystone endpoint-create \ - --region RegionOne \ - --service s3 \ - --publicurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" \ - --adminurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" \ - --internalurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" - fi -fi - -if [[ "$ENABLED_SERVICES" =~ "tempest" ]]; then - # Tempest has some tests that validate various authorization checks - # between two regular users in separate tenants - keystone tenant-create \ - --name=alt_demo - keystone user-create \ - --name=alt_demo \ - --pass="$ADMIN_PASSWORD" \ - --email=alt_demo@example.com - keystone user-role-add \ - --tenant alt_demo \ - --user alt_demo \ - --role Member -fi diff --git a/lib/ceilometer b/lib/ceilometer index 04c1a34b8b..b8305b1e9e 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -69,6 +69,11 @@ function is_ceilometer_enabled { # create_ceilometer_accounts() - Set up common required ceilometer accounts +# Project User Roles +# ------------------------------------------------------------------ +# SERVICE_TENANT_NAME ceilometer admin +# SERVICE_TENANT_NAME ceilometer ResellerAdmin (if Swift is enabled) + create_ceilometer_accounts() { SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }") @@ -99,6 +104,13 @@ create_ceilometer_accounts() { --adminurl "$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \ --internalurl "$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" fi + if is_service_enabled swift; then + # Ceilometer needs ResellerAdmin role to access swift account stats. + openstack role add \ + --project $SERVICE_TENANT_NAME \ + --user ceilometer \ + ResellerAdmin + fi fi } diff --git a/lib/glance b/lib/glance index 8a4c21b3f2..51e4399388 100644 --- a/lib/glance +++ b/lib/glance @@ -159,6 +159,49 @@ function configure_glance { cp -p $GLANCE_DIR/etc/schema-image.json $GLANCE_SCHEMA_JSON } +# create_glance_accounts() - Set up common required glance accounts + +# Project User Roles +# ------------------------------------------------------------------ +# SERVICE_TENANT_NAME glance service +# SERVICE_TENANT_NAME glance-swift ResellerAdmin (if Swift is enabled) + +function create_glance_accounts { + if is_service_enabled g-api; then + openstack user create \ + --password "$SERVICE_PASSWORD" \ + --project $SERVICE_TENANT_NAME \ + glance + openstack role add \ + --project $SERVICE_TENANT_NAME \ + --user glance \ + service + # required for swift access + if is_service_enabled s-proxy; then + openstack user create \ + --password "$SERVICE_PASSWORD" \ + --project $SERVICE_TENANT_NAME \ + glance-swift + openstack role add \ + --project $SERVICE_TENANT_NAME \ + --user glance-swift \ + ResellerAdmin + fi + if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then + openstack service create \ + --type image \ + --description "Glance Image Service" \ + glance + openstack endpoint create \ + --region RegionOne \ + --publicurl "http://$GLANCE_HOSTPORT" \ + --adminurl "http://$GLANCE_HOSTPORT" \ + --internalurl "http://$GLANCE_HOSTPORT" \ + glance + fi + fi +} + # create_glance_cache_dir() - Part of the init_glance() process function create_glance_cache_dir { # Create cache dir diff --git a/lib/keystone b/lib/keystone index c6856c95c3..b31cc57a56 100644 --- a/lib/keystone +++ b/lib/keystone @@ -266,9 +266,11 @@ function configure_keystone { # Tenant User Roles # ------------------------------------------------------------------ +# admin admin admin # service -- -- +# -- -- service +# -- -- ResellerAdmin # -- -- Member -# admin admin admin # demo admin admin # demo demo Member, anotherrole # invisible_to_admin demo Member @@ -294,10 +296,17 @@ function create_keystone_accounts { --project $ADMIN_TENANT \ --user $ADMIN_USER - # service - SERVICE_TENANT=$(openstack project create \ - $SERVICE_TENANT_NAME \ - | grep " id " | get_field 2) + # Create service project/role + openstack project create $SERVICE_TENANT_NAME + + # Service role, so service users do not have to be admins + openstack role create service + + # The ResellerAdmin role is used by Nova and Ceilometer so we need to keep it. + # The admin role in swift allows a user to act as an admin for their tenant, + # but ResellerAdmin is needed for a user to act as any tenant. The name of this + # role is also configurable in swift-proxy.conf + openstack role create ResellerAdmin # The Member role is used by Horizon and Swift so we need to keep it: MEMBER_ROLE=$(openstack role create \ diff --git a/lib/nova b/lib/nova index 583a5923ce..a7c44211ca 100644 --- a/lib/nova +++ b/lib/nova @@ -316,9 +316,10 @@ function configure_nova { # create_nova_accounts() - Set up common required nova accounts -# Tenant User Roles +# Project User Roles # ------------------------------------------------------------------ -# service nova admin, [ResellerAdmin (swift only)] +# SERVICE_TENANT_NAME nova admin +# SERVICE_TENANT_NAME nova ResellerAdmin (if Swift is enabled) # Migrated from keystone_data.sh create_nova_accounts() { @@ -363,6 +364,48 @@ create_nova_accounts() { --internalurl "$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT/v3" fi fi + + if is_service_enabled n-api; then + # Swift + if is_service_enabled swift; then + # Nova needs ResellerAdmin role to download images when accessing + # swift through the s3 api. + openstack role add \ + --project $SERVICE_TENANT_NAME \ + --user nova \ + ResellerAdmin + fi + + # EC2 + if [[ "$KEYSTONE_CATALOG_BACKEND" = "sql" ]]; then + openstack service create \ + --type ec2 \ + --description "EC2 Compatibility Layer" \ + ec2 + openstack endpoint create \ + --region RegionOne \ + --publicurl "http://$SERVICE_HOST:8773/services/Cloud" \ + --adminurl "http://$SERVICE_HOST:8773/services/Admin" \ + --internalurl "http://$SERVICE_HOST:8773/services/Cloud" \ + ec2 + fi + fi + + # S3 + if is_service_enabled n-obj swift3; then + if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then + openstack service create \ + --type s3 \ + --description "S3" \ + s3 + openstack endpoint create \ + --region RegionOne \ + --publicurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" \ + --adminurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" \ + --internalurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" \ + s3 + fi + fi } # create_nova_conf() - Create a new nova.conf file diff --git a/lib/tempest b/lib/tempest index 16f8744d85..897efa8a8f 100644 --- a/lib/tempest +++ b/lib/tempest @@ -358,6 +358,30 @@ function configure_tempest { $errexit } +# create_tempest_accounts() - Set up common required tempest accounts + +# Project User Roles +# ------------------------------------------------------------------ +# alt_demo alt_demo Member + +# Migrated from keystone_data.sh +function create_tempest_accounts { + if is_service_enabled tempest; then + # Tempest has some tests that validate various authorization checks + # between two regular users in separate tenants + openstack project create \ + alt_demo + openstack user create \ + --project alt_demo \ + --password "$ADMIN_PASSWORD" \ + alt_demo + openstack role add \ + --project alt_demo \ + --user alt_demo \ + Member + fi +} + # install_tempest() - Collect source and prepare function install_tempest { git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH diff --git a/stack.sh b/stack.sh index c990a1c6ca..f8973ee98f 100755 --- a/stack.sh +++ b/stack.sh @@ -907,14 +907,13 @@ if is_service_enabled key; then SERVICE_ENDPOINT=http://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT_INT/v2.0 fi - # Do the keystone-specific bits from keystone_data.sh - export OS_SERVICE_TOKEN=$SERVICE_TOKEN - export OS_SERVICE_ENDPOINT=$SERVICE_ENDPOINT - # Add temporarily to make openstackclient work + # Setup OpenStackclient token-flow auth export OS_TOKEN=$SERVICE_TOKEN export OS_URL=$SERVICE_ENDPOINT + create_keystone_accounts create_nova_accounts + create_glance_accounts create_cinder_accounts create_neutron_accounts @@ -922,7 +921,7 @@ if is_service_enabled key; then create_ceilometer_accounts fi - if is_service_enabled swift || is_service_enabled s-proxy; then + if is_service_enabled swift; then create_swift_accounts fi @@ -930,20 +929,14 @@ if is_service_enabled key; then create_heat_accounts fi - # ``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 \ - SERVICE_TOKEN=$SERVICE_TOKEN SERVICE_ENDPOINT=$SERVICE_ENDPOINT SERVICE_HOST=$SERVICE_HOST \ - S3_SERVICE_PORT=$S3_SERVICE_PORT KEYSTONE_CATALOG_BACKEND=$KEYSTONE_CATALOG_BACKEND \ - DEVSTACK_DIR=$TOP_DIR ENABLED_SERVICES=$ENABLED_SERVICES \ - bash -x $FILES/keystone_data.sh - - # Set up auth creds now that keystone is bootstrapped + # Begone token-flow auth unset OS_TOKEN OS_URL + + # Set up password-flow auth creds now that keystone is bootstrapped export OS_AUTH_URL=$SERVICE_ENDPOINT export OS_TENANT_NAME=admin export OS_USERNAME=admin export OS_PASSWORD=$ADMIN_PASSWORD - unset OS_SERVICE_TOKEN OS_SERVICE_ENDPOINT fi From 936284b02ab6365bb0bcde49b617a57a902d491c Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 11 Mar 2014 09:35:55 +1100 Subject: [PATCH 0056/3949] Make mongo install for ceilometer NOPRIME mongodb packages are missing on some platforms, so we switch to a manual install. Also gate the mongo call in cleanup Change-Id: I1755e461c66be30da3db2a0994f908503c4c38ea --- files/apts/ceilometer-collector | 4 ++-- files/rpms/ceilometer-collector | 4 ++-- lib/ceilometer | 21 ++++++++++++++++++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/files/apts/ceilometer-collector b/files/apts/ceilometer-collector index 71007ba4c5..f1b692ac71 100644 --- a/files/apts/ceilometer-collector +++ b/files/apts/ceilometer-collector @@ -1,5 +1,5 @@ -python-pymongo -mongodb-server +python-pymongo #NOPRIME +mongodb-server #NOPRIME libnspr4-dev pkg-config libxml2-dev diff --git a/files/rpms/ceilometer-collector b/files/rpms/ceilometer-collector index c91bac36a2..9cf580d22d 100644 --- a/files/rpms/ceilometer-collector +++ b/files/rpms/ceilometer-collector @@ -1,4 +1,4 @@ selinux-policy-targeted -mongodb-server -pymongo +mongodb-server #NOPRIME +pymongo # NOPRIME mongodb # NOPRIME diff --git a/lib/ceilometer b/lib/ceilometer index b0899e2f24..6aaddcefad 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -106,7 +106,9 @@ create_ceilometer_accounts() { # cleanup_ceilometer() - Remove residual data files, anything left over from previous # runs that a clean run would need to clean up function cleanup_ceilometer { - mongo ceilometer --eval "db.dropDatabase();" + if [ "$CEILOMETER_BACKEND" != 'mysql' ] && [ "$CEILOMETER_BACKEND" != 'postgresql' ] ; then + mongo ceilometer --eval "db.dropDatabase();" + fi } # configure_ceilometerclient() - Set config files, create data dirs, etc @@ -164,14 +166,27 @@ function configure_ceilometer { } function configure_mongodb { + # server package is the same on all + local packages=mongodb-server + + if is_fedora; then + # mongodb client + python bindings + packages="${packages} mongodb pymongo" + else + packages="${packages} python-pymongo" + fi + + install_package ${packages} + if is_fedora; then - # install mongodb client - install_package mongodb # ensure smallfiles selected to minimize freespace requirements sudo sed -i '/--smallfiles/!s/OPTIONS=\"/OPTIONS=\"--smallfiles /' /etc/sysconfig/mongod restart_service mongod fi + + # give mongodb time to start-up + sleep 5 } # init_ceilometer() - Initialize etc. From ccb3d10e04f7be773daf1bddd0bc2bff024ce6f4 Mon Sep 17 00:00:00 2001 From: Newell Jensen Date: Mon, 10 Mar 2014 14:28:52 -0700 Subject: [PATCH 0057/3949] Makes error message easier to understand. If the host ip address is indeterminate while executing stack.sh, an error message is displayed. This error message could be a source of confusion since it references localrc, which is depreciated. This patch makes the error message clearer and easier to understand. It does this by taking out the reference to localrc. It also points the user towards local.conf where there are suggestions on how to set HOST_IP. Change-Id: I41f14a2de85449d2a08ab7eb2849844a1087b147 Closes-Bug: #1290556 --- stack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index 148ce04e28..817da26a8e 100755 --- a/stack.sh +++ b/stack.sh @@ -289,7 +289,7 @@ FIXED_NETWORK_SIZE=${FIXED_NETWORK_SIZE:-256} HOST_IP=$(get_default_host_ip $FIXED_RANGE $FLOATING_RANGE "$HOST_IP_IFACE" "$HOST_IP") if [ "$HOST_IP" == "" ]; then - die $LINENO "Could not determine host ip address. Either localrc specified dhcp on ${HOST_IP_IFACE} or defaulted" + die $LINENO "Could not determine host ip address. See local.conf for suggestions on setting HOST_IP." fi # Allow the use of an alternate hostname (such as localhost/127.0.0.1) for service endpoints. From c20bab89c47e02d88fb314d4d0a8dbfc73fca20e Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Tue, 11 Mar 2014 11:38:24 +0100 Subject: [PATCH 0058/3949] Use the python-pyOpenSSL package openSUSE Recent pyOpenSSL releases when installed from pip depend on cryptography>=0.2.1, which itself depends on cffi>=0.8. That is conflicting with the python-cffi (0.7.2) package on openSUSE-13.1 which is required by the installed python-xattr. Change-Id: I721ce5288d150a3b01fb2558f7ca86028d734138 --- files/rpms-suse/glance | 1 + 1 file changed, 1 insertion(+) diff --git a/files/rpms-suse/glance b/files/rpms-suse/glance index dd68ac08c8..d9844e9bb4 100644 --- a/files/rpms-suse/glance +++ b/files/rpms-suse/glance @@ -8,5 +8,6 @@ python-devel python-eventlet python-greenlet python-iso8601 +python-pyOpenSSL python-wsgiref python-xattr From 3b1f2e4e885559957a939f8a260b4cff9938bc80 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 24 Feb 2014 20:30:07 +0900 Subject: [PATCH 0059/3949] Fix inverted conditionals in setup_develop This fixes regressions introduced by: Change-Id: Ic97e68348f46245b271567893b447fcedbd7bd6e ("Handle non-zero exit code from git diff") Change-Id: I053a292c287f3035eef37db2264eda06a170f9bc Closes-Bug: 1287513 --- functions-common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions-common b/functions-common index ed3d8832fd..90cd3dfa72 100644 --- a/functions-common +++ b/functions-common @@ -1248,7 +1248,7 @@ function setup_develop { # ``errexit`` requires us to trap the exit code when the repo is changed local update_requirements=$(cd $project_dir && git diff --exit-code >/dev/null || echo "changed") - if [[ $update_requirements = "changed" ]]; then + if [[ $update_requirements != "changed" ]]; then (cd $REQUIREMENTS_DIR; \ $SUDO_CMD python update.py $project_dir) fi @@ -1264,7 +1264,7 @@ function setup_develop { # a variable that tells us whether or not we should UNDO the requirements # changes (this will be set to False in the OpenStack ci gate) if [ $UNDO_REQUIREMENTS = "True" ]; then - if [[ $update_requirements = "changed" ]]; then + if [[ $update_requirements != "changed" ]]; then (cd $project_dir && git reset --hard) fi fi From dd304603e011160f7f796ec4af7dcaf50008372c Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 11 Mar 2014 16:38:57 -0400 Subject: [PATCH 0060/3949] put libvirt debug behind a flag only turn on the libvirt debugging if we really need it, which we could control in the gate via devstack-gate. Change-Id: I5e6d41d5333357608ab6a614610c060400f70a10 --- lib/nova_plugins/hypervisor-libvirt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/nova_plugins/hypervisor-libvirt b/lib/nova_plugins/hypervisor-libvirt index 26880e5850..5a51f33808 100644 --- a/lib/nova_plugins/hypervisor-libvirt +++ b/lib/nova_plugins/hypervisor-libvirt @@ -25,6 +25,8 @@ set +o xtrace # File injection is disabled by default in Nova. This will turn it back on. ENABLE_FILE_INJECTION=${ENABLE_FILE_INJECTION:-False} +# if we should turn on massive libvirt debugging +DEBUG_LIBVIRT=$(trueorfalse False $DEBUG_LIBVIRT) # Entry Points @@ -104,13 +106,15 @@ EOF add_user_to_group $STACK_USER $LIBVIRT_GROUP # Enable server side traces for libvirtd - local log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 1:util" - local log_outputs="1:file:/var/log/libvirt/libvirtd.log" - if ! grep -q "log_filters=\"$log_filters\"" /etc/libvirt/libvirtd.conf; then - echo "log_filters=\"$log_filters\"" | sudo tee -a /etc/libvirt/libvirtd.conf - fi - if ! grep -q "log_outputs=\"$log_outputs\"" /etc/libvirt/libvirtd.conf; then - echo "log_outputs=\"$log_outputs\"" | sudo tee -a /etc/libvirt/libvirtd.conf + if [[ "$DEBUG_LIBVIRT" = "True" ]] ; then + local log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 1:util" + local log_outputs="1:file:/var/log/libvirt/libvirtd.log" + if ! grep -q "log_filters=\"$log_filters\"" /etc/libvirt/libvirtd.conf; then + echo "log_filters=\"$log_filters\"" | sudo tee -a /etc/libvirt/libvirtd.conf + fi + if ! grep -q "log_outputs=\"$log_outputs\"" /etc/libvirt/libvirtd.conf; then + echo "log_outputs=\"$log_outputs\"" | sudo tee -a /etc/libvirt/libvirtd.conf + fi fi # libvirt detects various settings on startup, as we potentially changed From d78c4057d4ae53a994eefb4d4b0ee01a9365e5d5 Mon Sep 17 00:00:00 2001 From: Hemanth Ravi Date: Sun, 26 Jan 2014 17:30:11 -0800 Subject: [PATCH 0061/3949] Install script for One Convergence Neutron plugin. Change-Id: I1dcc625a7c986e7533820b01af9eee5b8addcffe Implements: install for blueprint oc-nvsd-neutron-plugin --- lib/neutron_plugins/oneconvergence | 76 ++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 lib/neutron_plugins/oneconvergence diff --git a/lib/neutron_plugins/oneconvergence b/lib/neutron_plugins/oneconvergence new file mode 100644 index 0000000000..0aebff629c --- /dev/null +++ b/lib/neutron_plugins/oneconvergence @@ -0,0 +1,76 @@ +# Neutron One Convergence plugin +# --------------------------- +# Save trace setting +MY_XTRACE=$(set +o | grep xtrace) +set +o xtrace + +source $TOP_DIR/lib/neutron_plugins/ovs_base + +Q_L3_ENABLED=true +Q_L3_ROUTER_PER_TENANT=true +Q_USE_NAMESPACE=true + +function neutron_plugin_install_agent_packages { + _neutron_ovs_base_install_agent_packages +} +# Configure common parameters +function neutron_plugin_configure_common { + + Q_PLUGIN_CONF_PATH=etc/neutron/plugins/oneconvergence + Q_PLUGIN_CONF_FILENAME=nvsdplugin.ini + Q_PLUGIN_CLASS="neutron.plugins.oneconvergence.plugin.OneConvergencePluginV2" + Q_DB_NAME='oc_nvsd_neutron' +} + +# Configure plugin specific information +function neutron_plugin_configure_service { + iniset /$Q_PLUGIN_CONF_FILE nvsd nvsd_ip $NVSD_IP + iniset /$Q_PLUGIN_CONF_FILE nvsd nvsd_port $NVSD_PORT + iniset /$Q_PLUGIN_CONF_FILE nvsd nvsd_user $NVSD_USER + iniset /$Q_PLUGIN_CONF_FILE nvsd nvsd_passwd $NVSD_PASSWD +} + +function neutron_plugin_configure_debug_command { + _neutron_ovs_base_configure_debug_command +} + +function neutron_plugin_setup_interface_driver { + local conf_file=$1 + iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver +} + +function has_neutron_plugin_security_group { + # 1 means False here + return 0 +} + +function setup_integration_bridge { + _neutron_ovs_base_setup_bridge $OVS_BRIDGE +} + +function neutron_plugin_configure_dhcp_agent { + setup_integration_bridge + iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport +} + +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 neutron_plugin_configure_plugin_agent { + + AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-nvsd-agent" + + _neutron_ovs_base_configure_firewall_driver +} + +function neutron_plugin_create_nova_conf { + NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"} + if ( is_service_enabled n-cpu && ! ( is_service_enabled q-dhcp )) ; then + setup_integration_bridge + fi +} + +# Restore xtrace +$MY_XTRACE From 7d4c7e09b4882077471c3b2cb097c237c2016f96 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 12 Mar 2014 08:05:08 -0400 Subject: [PATCH 0062/3949] remove docker from devstack with I1c9bea2fdeebc4199c4f7d8fca4580a6fb7fed5b nova removed docker from it's driver tree. We shouldn't have driver support inside of devstack that's not part of upstream projects (this has been a line we've been pretty clear on with Neutron drivers in the past). Remove docker driver accordingly. Change-Id: Ib91d415ea1616d99a5c5e7bc3b9015392fda5847 --- README.md | 6 +- exercises/boot_from_volume.sh | 3 - exercises/euca.sh | 3 - exercises/floating_ips.sh | 3 - exercises/sec_groups.sh | 3 - exercises/volumes.sh | 3 - lib/nova_plugins/hypervisor-docker | 132 ----------------------------- stackrc | 3 - tools/docker/README.md | 13 --- tools/docker/install_docker.sh | 68 --------------- 10 files changed, 1 insertion(+), 236 deletions(-) delete mode 100644 lib/nova_plugins/hypervisor-docker delete mode 100644 tools/docker/README.md delete mode 100755 tools/docker/install_docker.sh diff --git a/README.md b/README.md index 9914b1ed69..a0f5b2689d 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ does not run if started as root. This is a recent change (Oct 2013) from the previous behaviour of automatically creating a ``stack`` user. Automatically creating user accounts is not the right response to running as root, so -that bit is now an explicit step using ``tools/create-stack-user.sh``. +that bit is now an explicit step using ``tools/create-stack-user.sh``. Run that (as root!) or just check it out to see what DevStack's expectations are for the account it runs under. Many people simply use their usual login (the default 'ubuntu' login on a UEC image @@ -253,10 +253,6 @@ If tempest has been successfully configured, a basic set of smoke tests can be r If you would like to use Xenserver as the hypervisor, please refer to the instructions in `./tools/xen/README.md`. -# DevStack on Docker - -If you would like to use Docker as the hypervisor, please refer to the instructions in `./tools/docker/README.md`. - # Additional Projects DevStack has a hook mechanism to call out to a dispatch script at specific diff --git a/exercises/boot_from_volume.sh b/exercises/boot_from_volume.sh index f679669eea..dff8e7a632 100755 --- a/exercises/boot_from_volume.sh +++ b/exercises/boot_from_volume.sh @@ -44,9 +44,6 @@ source $TOP_DIR/exerciserc # the exercise is skipped is_service_enabled cinder || exit 55 -# Also skip if the hypervisor is Docker -[[ "$VIRT_DRIVER" == "docker" ]] && exit 55 - # Instance type to create DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny} diff --git a/exercises/euca.sh b/exercises/euca.sh index ad852a4f79..3768b56d4e 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -40,9 +40,6 @@ source $TOP_DIR/exerciserc # the exercise is skipped is_service_enabled n-api || exit 55 -# Skip if the hypervisor is Docker -[[ "$VIRT_DRIVER" == "docker" ]] && exit 55 - # Instance type to create DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny} diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh index 8b7b96197e..1416d4dc6a 100755 --- a/exercises/floating_ips.sh +++ b/exercises/floating_ips.sh @@ -40,9 +40,6 @@ source $TOP_DIR/exerciserc # the exercise is skipped is_service_enabled n-api || exit 55 -# Skip if the hypervisor is Docker -[[ "$VIRT_DRIVER" == "docker" ]] && exit 55 - # Instance type to create DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny} diff --git a/exercises/sec_groups.sh b/exercises/sec_groups.sh index d71a1e0755..5f8b0a4d5d 100755 --- a/exercises/sec_groups.sh +++ b/exercises/sec_groups.sh @@ -37,9 +37,6 @@ source $TOP_DIR/exerciserc # the exercise is skipped is_service_enabled n-api || exit 55 -# Skip if the hypervisor is Docker -[[ "$VIRT_DRIVER" == "docker" ]] && exit 55 - # Testing Security Groups # ======================= diff --git a/exercises/volumes.sh b/exercises/volumes.sh index 83d25c779c..0d556df9e7 100755 --- a/exercises/volumes.sh +++ b/exercises/volumes.sh @@ -41,9 +41,6 @@ source $TOP_DIR/exerciserc # exercise is skipped. is_service_enabled cinder || exit 55 -# Also skip if the hypervisor is Docker -[[ "$VIRT_DRIVER" == "docker" ]] && exit 55 - # Instance type to create DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny} diff --git a/lib/nova_plugins/hypervisor-docker b/lib/nova_plugins/hypervisor-docker deleted file mode 100644 index fd3c4fefc8..0000000000 --- a/lib/nova_plugins/hypervisor-docker +++ /dev/null @@ -1,132 +0,0 @@ -# lib/nova_plugins/docker -# Configure the Docker hypervisor - -# Enable with: -# -# VIRT_DRIVER=docker - -# Dependencies: -# -# - ``functions`` file -# - ``nova`` and ``glance`` configurations - -# install_nova_hypervisor - install any external requirements -# configure_nova_hypervisor - make configuration changes, including those to other services -# start_nova_hypervisor - start any external services -# stop_nova_hypervisor - stop any external services -# cleanup_nova_hypervisor - remove transient data and cache - -# Save trace setting -MY_XTRACE=$(set +o | grep xtrace) -set +o xtrace - - -# Defaults -# -------- - -# Set up default directories -DOCKER_DIR=$DEST/docker - -DOCKER_UNIX_SOCKET=/var/run/docker.sock -DOCKER_PID_FILE=/var/run/docker.pid -DOCKER_REGISTRY_PORT=${DOCKER_REGISTRY_PORT:-5042} - -DOCKER_IMAGE=${DOCKER_IMAGE:-cirros:latest} -DOCKER_IMAGE_NAME=$DEFAULT_IMAGE_NAME -DOCKER_REGISTRY_IMAGE=${DOCKER_REGISTRY_IMAGE:-registry:latest} -DOCKER_REGISTRY_IMAGE_NAME=registry -DOCKER_REPOSITORY_NAME=${SERVICE_HOST}:${DOCKER_REGISTRY_PORT}/${DOCKER_IMAGE_NAME} - -DOCKER_APT_REPO=${DOCKER_APT_REPO:-https://get.docker.io/ubuntu} - - -# Entry Points -# ------------ - -# clean_nova_hypervisor - Clean up an installation -function cleanup_nova_hypervisor { - stop_service docker - - # Clean out work area - sudo rm -rf /var/lib/docker -} - -# configure_nova_hypervisor - Set config files, create data dirs, etc -function configure_nova_hypervisor { - iniset $NOVA_CONF DEFAULT compute_driver docker.DockerDriver - iniset $GLANCE_API_CONF DEFAULT container_formats ami,ari,aki,bare,ovf,docker -} - -# is_docker_running - Return 0 (true) if Docker is running, otherwise 1 -function is_docker_running { - local docker_pid - if [ -f "$DOCKER_PID_FILE" ]; then - docker_pid=$(cat "$DOCKER_PID_FILE") - fi - if [[ -z "$docker_pid" ]] || ! ps -p "$docker_pid" | grep [d]ocker; then - return 1 - fi - return 0 -} - -# install_nova_hypervisor() - Install external components -function install_nova_hypervisor { - # So far this is Ubuntu only - if ! is_ubuntu; then - die $LINENO "Docker is only supported on Ubuntu at this time" - fi - - # Make sure Docker is installed - if ! is_package_installed lxc-docker; then - die $LINENO "Docker is not installed. Please run tools/docker/install_docker.sh" - fi - - if ! (is_docker_running); then - die $LINENO "Docker not running" - fi -} - -# start_nova_hypervisor - Start any required external services -function start_nova_hypervisor { - if ! (is_docker_running); then - die $LINENO "Docker not running" - fi - - # Start the Docker registry container - docker run -d -p ${DOCKER_REGISTRY_PORT}:5000 \ - -e SETTINGS_FLAVOR=openstack -e OS_USERNAME=${OS_USERNAME} \ - -e OS_PASSWORD=${OS_PASSWORD} -e OS_TENANT_NAME=${OS_TENANT_NAME} \ - -e OS_GLANCE_URL="${SERVICE_PROTOCOL}://${GLANCE_HOSTPORT}" \ - -e OS_AUTH_URL=${OS_AUTH_URL} \ - $DOCKER_REGISTRY_IMAGE_NAME ./docker-registry/run.sh - - echo "Waiting for docker registry to start..." - DOCKER_REGISTRY=${SERVICE_HOST}:${DOCKER_REGISTRY_PORT} - if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl -s $DOCKER_REGISTRY; do sleep 1; done"; then - die $LINENO "docker-registry did not start" - fi - - # Tag image if not already tagged - if ! docker images | grep $DOCKER_REPOSITORY_NAME; then - docker tag $DOCKER_IMAGE_NAME $DOCKER_REPOSITORY_NAME - fi - - # Make sure we copied the image in Glance - if ! (glance image-show "$DOCKER_IMAGE"); then - docker push $DOCKER_REPOSITORY_NAME - fi -} - -# stop_nova_hypervisor - Stop any external services -function stop_nova_hypervisor { - # Stop the docker registry container - docker kill $(docker ps | grep docker-registry | cut -d' ' -f1) -} - - -# Restore xtrace -$MY_XTRACE - -# Local variables: -# mode: shell-script -# End: diff --git a/stackrc b/stackrc index 6bb6f37195..756ec275dc 100644 --- a/stackrc +++ b/stackrc @@ -320,9 +320,6 @@ case "$VIRT_DRIVER" in openvz) DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-ubuntu-12.04-x86_64} IMAGE_URLS=${IMAGE_URLS:-"http://download.openvz.org/template/precreated/ubuntu-12.04-x86_64.tar.gz"};; - docker) - DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros} - IMAGE_URLS=${IMAGE_URLS:-};; libvirt) case "$LIBVIRT_TYPE" in lxc) # the cirros root disk in the uec tarball is empty, so it will not work for lxc diff --git a/tools/docker/README.md b/tools/docker/README.md deleted file mode 100644 index 976111f750..0000000000 --- a/tools/docker/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# DevStack on Docker - -Using Docker as Nova's hypervisor requries two steps: - -* Configure DevStack by adding the following to `localrc`:: - - VIRT_DRIVER=docker - -* Download and install the Docker service and images:: - - tools/docker/install_docker.sh - -After this, `stack.sh` should run as normal. diff --git a/tools/docker/install_docker.sh b/tools/docker/install_docker.sh deleted file mode 100755 index 27c8c8210b..0000000000 --- a/tools/docker/install_docker.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash - -# **install_docker.sh** - Do the initial Docker installation and configuration - -# install_docker.sh -# -# Install docker package and images -# * downloads a base busybox image and a glance registry image if necessary -# * install the images in Docker's image cache - - -# Keep track of the current directory -SCRIPT_DIR=$(cd $(dirname "$0") && pwd) -TOP_DIR=$(cd $SCRIPT_DIR/../..; pwd) - -# Import common functions -source $TOP_DIR/functions - -# Load local configuration -source $TOP_DIR/stackrc - -FILES=$TOP_DIR/files - -# Get our defaults -source $TOP_DIR/lib/nova_plugins/hypervisor-docker - -SERVICE_TIMEOUT=${SERVICE_TIMEOUT:-60} - - -# Install Docker Service -# ====================== - -if is_fedora; then - install_package docker-io socat -else - # Stop the auto-repo updates and do it when required here - NO_UPDATE_REPOS=True - - # Set up home repo - curl https://get.docker.io/gpg | sudo apt-key add - - install_package python-software-properties && \ - sudo sh -c "echo deb $DOCKER_APT_REPO docker main > /etc/apt/sources.list.d/docker.list" - apt_get update - install_package --force-yes lxc-docker socat -fi - -# Start the daemon - restart just in case the package ever auto-starts... -restart_service docker - -echo "Waiting for docker daemon to start..." -DOCKER_GROUP=$(groups | cut -d' ' -f1) -CONFIGURE_CMD="while ! /bin/echo -e 'GET /v1.3/version HTTP/1.0\n\n' | socat - unix-connect:$DOCKER_UNIX_SOCKET 2>/dev/null | grep -q '200 OK'; do - # Set the right group on docker unix socket before retrying - sudo chgrp $DOCKER_GROUP $DOCKER_UNIX_SOCKET - sudo chmod g+rw $DOCKER_UNIX_SOCKET - sleep 1 -done" -if ! timeout $SERVICE_TIMEOUT sh -c "$CONFIGURE_CMD"; then - die $LINENO "docker did not start" -fi - -# Get guest container image -docker pull $DOCKER_IMAGE -docker tag $DOCKER_IMAGE $DOCKER_IMAGE_NAME - -# Get docker-registry image -docker pull $DOCKER_REGISTRY_IMAGE -docker tag $DOCKER_REGISTRY_IMAGE $DOCKER_REGISTRY_IMAGE_NAME From 1749106c3abb17ee7cf30eb69bc9b744f3fc5a95 Mon Sep 17 00:00:00 2001 From: Attila Fazekas Date: Wed, 12 Mar 2014 14:38:25 +0100 Subject: [PATCH 0063/3949] Remove unused package dependencies * /sbin/vconfig command is not used by either nova or neutron. * Now the AMQP carrot is not used, not even optionally by the oslo.messaging. * python-gfalgs just referenced as a similar configuration style, by neutron. Change-Id: Idde5446e47e7da1dd204ea518ab816e2cce77c7d --- files/apts/nova | 2 -- files/rpms-suse/nova | 2 -- files/rpms/neutron | 1 - files/rpms/nova | 3 --- 4 files changed, 8 deletions(-) diff --git a/files/apts/nova b/files/apts/nova index ae925c3293..dfb25c7f37 100644 --- a/files/apts/nova +++ b/files/apts/nova @@ -25,7 +25,6 @@ socat # used by ajaxterm python-mox python-paste python-migrate -python-gflags python-greenlet python-libvirt # NOPRIME python-libxml2 @@ -34,7 +33,6 @@ python-numpy # used by websockify for spice console python-pastedeploy python-eventlet python-cheetah -python-carrot python-tempita python-sqlalchemy python-suds diff --git a/files/rpms-suse/nova b/files/rpms-suse/nova index ee4917d702..c3c878fb4a 100644 --- a/files/rpms-suse/nova +++ b/files/rpms-suse/nova @@ -24,7 +24,6 @@ python-Routes python-SQLAlchemy python-Tempita python-boto -python-carrot python-cheetah python-eventlet python-feedparser @@ -37,7 +36,6 @@ python-mox python-mysql python-numpy # needed by websockify for spice console python-paramiko -python-python-gflags python-sqlalchemy-migrate python-suds python-xattr # needed for glance which is needed for nova --- this shouldn't be here diff --git a/files/rpms/neutron b/files/rpms/neutron index 42d7f68d37..e5c901be37 100644 --- a/files/rpms/neutron +++ b/files/rpms/neutron @@ -21,4 +21,3 @@ rabbitmq-server # NOPRIME qpid-cpp-server # NOPRIME sqlite sudo -vconfig diff --git a/files/rpms/nova b/files/rpms/nova index a607d925e1..61b0e9a0d1 100644 --- a/files/rpms/nova +++ b/files/rpms/nova @@ -17,11 +17,9 @@ mysql-server # NOPRIME parted polkit python-boto -python-carrot python-cheetah python-eventlet python-feedparser -python-gflags python-greenlet python-iso8601 python-kombu @@ -42,4 +40,3 @@ rabbitmq-server # NOPRIME qpid-cpp-server # NOPRIME sqlite sudo -vconfig From 64bd01652e6fd7c593498b1fd2bf50bfdf64ce40 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 12 Mar 2014 13:04:22 -0400 Subject: [PATCH 0064/3949] make git_clone safer the ensures that if the function returns early, we return to a sane directory, and not hang out somewhere that a future git call might modify a directory in a weird way. This is especially important in the case of stable branches where were are hopping between stable for servers and master for clients. Change-Id: Ib8ebbc23b1813bc1bfb31d0a079f1b882135bd39 --- functions-common | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions-common b/functions-common index 90cd3dfa72..c6fd5c7163 100644 --- a/functions-common +++ b/functions-common @@ -517,12 +517,14 @@ function git_clone { GIT_DEST=$2 GIT_REF=$3 RECLONE=$(trueorfalse False $RECLONE) + local orig_dir=`pwd` if [[ "$OFFLINE" = "True" ]]; then echo "Running in offline mode, clones already exist" # print out the results so we know what change was used in the logs cd $GIT_DEST git show --oneline | head -1 + cd $orig_dir return fi @@ -572,6 +574,7 @@ function git_clone { # print out the results so we know what change was used in the logs cd $GIT_DEST git show --oneline | head -1 + cd $orig_dir } # git can sometimes get itself infinitely stuck with transient network From 767b5a45b7c6a91a449e0cb41baf16221a7de5e1 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Wed, 12 Mar 2014 10:33:15 -0700 Subject: [PATCH 0065/3949] Split up stop_nova to match start_nova Split stop_nova into: stop_nova_compute and stop_nova_rest. This is needed to support the partial-ncpu grenade test where we want to stop everything but nova_compute. Change-Id: I6a21821277e56897d705ca5746806e2211632d12 --- lib/nova | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/nova b/lib/nova index 55103e8dcc..15f56d336b 100644 --- a/lib/nova +++ b/lib/nova @@ -715,17 +715,25 @@ function start_nova { start_nova_rest } -# stop_nova() - Stop running processes (non-screen) -function stop_nova { +function stop_nova_compute { + if is_service_enabled n-cpu && [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then + stop_nova_hypervisor + fi +} + +function stop_nova_rest { # Kill the nova screen windows # Some services are listed here twice since more than one instance # of a service may be running in certain configs. for serv in n-api n-cpu n-crt n-net n-sch n-novnc n-xvnc n-cauth n-spice n-cond n-cell n-cell n-api-meta n-obj; do screen_stop $serv done - if is_service_enabled n-cpu && [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then - stop_nova_hypervisor - fi +} + +# stop_nova() - Stop running processes (non-screen) +function stop_nova { + stop_nova_rest + stop_nova_compute } From 9c6d2840fdb67eb7af34be241bdb2fbebaf67c87 Mon Sep 17 00:00:00 2001 From: Sreeram Yerrapragada Date: Mon, 10 Mar 2014 14:12:58 -0700 Subject: [PATCH 0066/3949] fix failing wget statements under -o errexit in vmdk upload routine Fix the case when uploaded image has no descriptor. Refactored the code a bit Tested: 1. monithic Sparse 2. monolithic flat 2.1 flat file name mentioned in descriptor file 2.1 flat file name not mentioned in descriptor file 3. descriptor header not found in the file 3.1 image file name is *-flat, download descriptor 3.2 image file name does not end with *-flat 4. file name contains all image properties Change-Id: I0df9be5c2a1b9ed53cdb22d5cd40b94e56c48f37 Closes-bug: #1289664 --- functions | 63 ++++++++++++++++++++----------------------------------- 1 file changed, 23 insertions(+), 40 deletions(-) diff --git a/functions b/functions index 1d30922916..e0d2b01d0c 100644 --- a/functions +++ b/functions @@ -122,7 +122,7 @@ function upload_image { flat_fname="$(head -25 $IMAGE | { grep -G 'RW\|RDONLY [0-9]+ FLAT\|VMFS' $IMAGE || true; })" flat_fname="${flat_fname#*\"}" flat_fname="${flat_fname%?}" - if [[ -z "$flat_name" ]]; then + if [[ -z "$flat_fname" ]]; then flat_fname="$IMAGE_NAME-flat.vmdk" fi path_len=`expr ${#image_url} - ${#IMAGE_FNAME}` @@ -133,27 +133,16 @@ function upload_image { if [[ ! -f $FILES/$flat_fname || \ "$(stat -c "%s" $FILES/$flat_fname)" = "0" ]]; then wget -c $flat_url -O $FILES/$flat_fname - if [[ $? -ne 0 ]]; then - echo "Flat disk not found: $flat_url" - flat_found=false - fi - fi - if $flat_found; then - IMAGE="$FILES/${flat_fname}" fi + IMAGE="$FILES/${flat_fname}" else IMAGE=$(echo $flat_url | sed "s/^file:\/\///g") if [[ ! -f $IMAGE || "$(stat -c "%s" $IMAGE)" == "0" ]]; then echo "Flat disk not found: $flat_url" - flat_found=false + return 1 fi - if ! $flat_found; then - IMAGE=$(echo $image_url | sed "s/^file:\/\///g") - fi - fi - if $flat_found; then - IMAGE_NAME="${flat_fname}" fi + IMAGE_NAME="${flat_fname}" vmdk_disktype="preallocated" elif [[ "$vmdk_create_type" = "streamOptimized" ]]; then vmdk_disktype="streamOptimized" @@ -163,33 +152,27 @@ function upload_image { if [[ ${IMAGE_NAME: -5} != "-flat" ]]; then warn $LINENO "Expected filename suffix: '-flat'."` `" Filename provided: ${IMAGE_NAME}" - fi - - descriptor_fname="${IMAGE_NAME:0:${#IMAGE_NAME} - 5}.vmdk" - path_len=`expr ${#image_url} - ${#IMAGE_FNAME}` - flat_path="${image_url:0:$path_len}" - descriptor_url=$flat_path$descriptor_fname - warn $LINENO "$descriptor_data_pair_msg"` - `" Attempt to retrieve the descriptor *.vmdk: $descriptor_url" - if [[ $flat_path != file* ]]; then - if [[ ! -f $FILES/$descriptor_fname || \ - "$(stat -c "%s" $FILES/$descriptor_fname)" = "0" ]]; then - wget -c $descriptor_url -O $FILES/$descriptor_fname - if [[ $? -ne 0 ]]; then - warn $LINENO "Descriptor not found $descriptor_url" - descriptor_found=false - fi - fi - descriptor_url="$FILES/$descriptor_fname" else - descriptor_url=$(echo $descriptor_url | sed "s/^file:\/\///g") - if [[ ! -f $descriptor_url || \ - "$(stat -c "%s" $descriptor_url)" == "0" ]]; then - warn $LINENO "Descriptor not found $descriptor_url" - descriptor_found=false + descriptor_fname="${IMAGE_NAME:0:${#IMAGE_NAME} - 5}.vmdk" + path_len=`expr ${#image_url} - ${#IMAGE_FNAME}` + flat_path="${image_url:0:$path_len}" + descriptor_url=$flat_path$descriptor_fname + warn $LINENO "$descriptor_data_pair_msg"` + `" Attempt to retrieve the descriptor *.vmdk: $descriptor_url" + if [[ $flat_path != file* ]]; then + if [[ ! -f $FILES/$descriptor_fname || \ + "$(stat -c "%s" $FILES/$descriptor_fname)" = "0" ]]; then + wget -c $descriptor_url -O $FILES/$descriptor_fname + fi + descriptor_url="$FILES/$descriptor_fname" + else + descriptor_url=$(echo $descriptor_url | sed "s/^file:\/\///g") + if [[ ! -f $descriptor_url || \ + "$(stat -c "%s" $descriptor_url)" == "0" ]]; then + echo "Descriptor not found: $descriptor_url" + return 1 + fi fi - fi - if $descriptor_found; then vmdk_adapter_type="$(head -25 $descriptor_url | { grep -a -F -m 1 'ddb.adapterType =' $descriptor_url || true; })" vmdk_adapter_type="${vmdk_adapter_type#*\"}" vmdk_adapter_type="${vmdk_adapter_type%?}" From 7ff8443e46c94562822895b86b24122bc7474cfd Mon Sep 17 00:00:00 2001 From: Sergey Lukjanov Date: Mon, 10 Mar 2014 20:04:51 +0400 Subject: [PATCH 0067/3949] Rename all Savanna usages to Sahara There are several backward compatibility nits. Change-Id: I93cac543375896602d158860cc557f86e41bcb63 --- exercises/{savanna.sh => sahara.sh} | 8 +- extras.d/70-sahara.sh | 37 ++++++ extras.d/70-savanna.sh | 37 ------ lib/sahara | 177 ++++++++++++++++++++++++++++ lib/sahara-dashboard | 72 +++++++++++ lib/savanna | 173 --------------------------- lib/savanna-dashboard | 72 ----------- 7 files changed, 290 insertions(+), 286 deletions(-) rename exercises/{savanna.sh => sahara.sh} (88%) create mode 100644 extras.d/70-sahara.sh delete mode 100644 extras.d/70-savanna.sh create mode 100644 lib/sahara create mode 100644 lib/sahara-dashboard delete mode 100644 lib/savanna delete mode 100644 lib/savanna-dashboard diff --git a/exercises/savanna.sh b/exercises/sahara.sh similarity index 88% rename from exercises/savanna.sh rename to exercises/sahara.sh index fc3f9760e5..867920ed31 100755 --- a/exercises/savanna.sh +++ b/exercises/sahara.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -# **savanna.sh** +# **sahara.sh** -# Sanity check that Savanna started if enabled +# Sanity check that Sahara started if enabled echo "*********************************************************************" echo "Begin DevStack Exercise: $0" @@ -33,9 +33,9 @@ source $TOP_DIR/openrc # Import exercise configuration source $TOP_DIR/exerciserc -is_service_enabled savanna || exit 55 +is_service_enabled sahara || exit 55 -curl http://$SERVICE_HOST:8386/ 2>/dev/null | grep -q 'Auth' || die $LINENO "Savanna API not functioning!" +curl http://$SERVICE_HOST:8386/ 2>/dev/null | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!" set +o xtrace echo "*********************************************************************" diff --git a/extras.d/70-sahara.sh b/extras.d/70-sahara.sh new file mode 100644 index 0000000000..80e07ff7b9 --- /dev/null +++ b/extras.d/70-sahara.sh @@ -0,0 +1,37 @@ +# sahara.sh - DevStack extras script to install Sahara + +if is_service_enabled sahara; then + if [[ "$1" == "source" ]]; then + # Initial source + source $TOP_DIR/lib/sahara + source $TOP_DIR/lib/sahara-dashboard + elif [[ "$1" == "stack" && "$2" == "install" ]]; then + echo_summary "Installing sahara" + install_sahara + cleanup_sahara + if is_service_enabled horizon; then + install_sahara_dashboard + fi + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + echo_summary "Configuring sahara" + configure_sahara + create_sahara_accounts + if is_service_enabled horizon; then + configure_sahara_dashboard + fi + elif [[ "$1" == "stack" && "$2" == "extra" ]]; then + echo_summary "Initializing sahara" + start_sahara + fi + + if [[ "$1" == "unstack" ]]; then + stop_sahara + if is_service_enabled horizon; then + cleanup_sahara_dashboard + fi + fi + + if [[ "$1" == "clean" ]]; then + cleanup_sahara + fi +fi diff --git a/extras.d/70-savanna.sh b/extras.d/70-savanna.sh deleted file mode 100644 index edc1376deb..0000000000 --- a/extras.d/70-savanna.sh +++ /dev/null @@ -1,37 +0,0 @@ -# savanna.sh - DevStack extras script to install Savanna - -if is_service_enabled savanna; then - if [[ "$1" == "source" ]]; then - # Initial source - source $TOP_DIR/lib/savanna - source $TOP_DIR/lib/savanna-dashboard - elif [[ "$1" == "stack" && "$2" == "install" ]]; then - echo_summary "Installing Savanna" - install_savanna - cleanup_savanna - if is_service_enabled horizon; then - install_savanna_dashboard - fi - elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then - echo_summary "Configuring Savanna" - configure_savanna - create_savanna_accounts - if is_service_enabled horizon; then - configure_savanna_dashboard - fi - elif [[ "$1" == "stack" && "$2" == "extra" ]]; then - echo_summary "Initializing Savanna" - start_savanna - fi - - if [[ "$1" == "unstack" ]]; then - stop_savanna - if is_service_enabled horizon; then - cleanup_savanna_dashboard - fi - fi - - if [[ "$1" == "clean" ]]; then - cleanup_savanna - fi -fi diff --git a/lib/sahara b/lib/sahara new file mode 100644 index 0000000000..4cb04ecd3a --- /dev/null +++ b/lib/sahara @@ -0,0 +1,177 @@ +# lib/sahara + +# Dependencies: +# ``functions`` file +# ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined + +# ``stack.sh`` calls the entry points in this order: +# +# install_sahara +# configure_sahara +# start_sahara +# stop_sahara +# cleanup_sahara + +# Save trace setting +XTRACE=$(set +o | grep xtrace) +set +o xtrace + + +# Defaults +# -------- + +# Set up default repos +SAHARA_REPO=${SAHARA_REPO:-${GIT_BASE}/openstack/sahara.git} +SAHARA_BRANCH=${SAHARA_BRANCH:-master} + +# Set up default directories +SAHARA_DIR=$DEST/sahara +SAHARA_CONF_DIR=${SAHARA_CONF_DIR:-/etc/sahara} +SAHARA_CONF_FILE=${SAHARA_CONF_DIR}/sahara.conf +SAHARA_DEBUG=${SAHARA_DEBUG:-True} + +SAHARA_SERVICE_HOST=${SAHARA_SERVICE_HOST:-$SERVICE_HOST} +SAHARA_SERVICE_PORT=${SAHARA_SERVICE_PORT:-8386} +SAHARA_SERVICE_PROTOCOL=${SAHARA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} + +SAHARA_AUTH_CACHE_DIR=${SAHARA_AUTH_CACHE_DIR:-/var/cache/sahara} + +# Support entry points installation of console scripts +if [[ -d $SAHARA_DIR/bin ]]; then + SAHARA_BIN_DIR=$SAHARA_DIR/bin +else + SAHARA_BIN_DIR=$(get_python_exec_prefix) +fi + +# Tell Tempest this project is present +TEMPEST_SERVICES+=,sahara + +# For backward compatibility with current tests in Tempest +TEMPEST_SERVICES+=,savanna + + +# Functions +# --------- + +# create_sahara_accounts() - Set up common required sahara accounts +# +# Tenant User Roles +# ------------------------------ +# service sahara admin +function create_sahara_accounts { + + SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }") + ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }") + + SAHARA_USER=$(openstack user create \ + sahara \ + --password "$SERVICE_PASSWORD" \ + --project $SERVICE_TENANT \ + --email sahara@example.com \ + | grep " id " | get_field 2) + openstack role add \ + $ADMIN_ROLE \ + --project $SERVICE_TENANT \ + --user $SAHARA_USER + + if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then + SAHARA_SERVICE=$(openstack service create \ + sahara \ + --type=data_processing \ + --description="Sahara Data Processing" \ + | grep " id " | get_field 2) + openstack endpoint create \ + $SAHARA_SERVICE \ + --region RegionOne \ + --publicurl "$SAHARA_SERVICE_PROTOCOL://$SAHARA_SERVICE_HOST:$SAHARA_SERVICE_PORT/v1.1/\$(tenant_id)s" \ + --adminurl "$SAHARA_SERVICE_PROTOCOL://$SAHARA_SERVICE_HOST:$SAHARA_SERVICE_PORT/v1.1/\$(tenant_id)s" \ + --internalurl "$SAHARA_SERVICE_PROTOCOL://$SAHARA_SERVICE_HOST:$SAHARA_SERVICE_PORT/v1.1/\$(tenant_id)s" + fi +} + +# cleanup_sahara() - Remove residual data files, anything left over from +# previous runs that would need to clean up. +function cleanup_sahara { + + # Cleanup auth cache dir + sudo rm -rf $SAHARA_AUTH_CACHE_DIR +} + +# configure_sahara() - Set config files, create data dirs, etc +function configure_sahara { + + if [[ ! -d $SAHARA_CONF_DIR ]]; then + sudo mkdir -p $SAHARA_CONF_DIR + fi + sudo chown $STACK_USER $SAHARA_CONF_DIR + + # Copy over sahara configuration file and configure common parameters. + # TODO(slukjanov): rename when sahara internals will be updated + cp $SAHARA_DIR/etc/savanna/savanna.conf.sample $SAHARA_CONF_FILE + + # Create auth cache dir + sudo mkdir -p $SAHARA_AUTH_CACHE_DIR + sudo chown $STACK_USER $SAHARA_AUTH_CACHE_DIR + rm -rf $SAHARA_AUTH_CACHE_DIR/* + + # Set obsolete keystone auth configs for backward compatibility + iniset $SAHARA_CONF_FILE DEFAULT os_auth_host $KEYSTONE_SERVICE_HOST + iniset $SAHARA_CONF_FILE DEFAULT os_auth_port $KEYSTONE_SERVICE_PORT + iniset $SAHARA_CONF_FILE DEFAULT os_auth_protocol $KEYSTONE_SERVICE_PROTOCOL + iniset $SAHARA_CONF_FILE DEFAULT os_admin_password $SERVICE_PASSWORD + iniset $SAHARA_CONF_FILE DEFAULT os_admin_username sahara + iniset $SAHARA_CONF_FILE DEFAULT os_admin_tenant_name $SERVICE_TENANT_NAME + + # Set actual keystone auth configs + iniset $SAHARA_CONF_FILE keystone_authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/ + iniset $SAHARA_CONF_FILE keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME + iniset $SAHARA_CONF_FILE keystone_authtoken admin_user sahara + iniset $SAHARA_CONF_FILE keystone_authtoken admin_password $SERVICE_PASSWORD + iniset $SAHARA_CONF_FILE keystone_authtoken signing_dir $SAHARA_AUTH_CACHE_DIR + iniset $SAHARA_CONF_FILE keystone_authtoken cafile $KEYSTONE_SSL_CA + + iniset $SAHARA_CONF_FILE DEFAULT debug $SAHARA_DEBUG + + iniset $SAHARA_CONF_FILE database connection `database_connection_url sahara` + + if is_service_enabled neutron; then + iniset $SAHARA_CONF_FILE DEFAULT use_neutron true + iniset $SAHARA_CONF_FILE DEFAULT use_floating_ips true + fi + + if is_service_enabled heat; then + iniset $SAHARA_CONF_FILE DEFAULT infrastructure_engine heat + else + iniset $SAHARA_CONF_FILE DEFAULT infrastructure_engine direct + fi + + iniset $SAHARA_CONF_FILE DEFAULT use_syslog $SYSLOG + + recreate_database sahara utf8 + $SAHARA_BIN_DIR/sahara-db-manage --config-file $SAHARA_CONF_FILE upgrade head +} + +# install_sahara() - Collect source and prepare +function install_sahara { + git_clone $SAHARA_REPO $SAHARA_DIR $SAHARA_BRANCH + setup_develop $SAHARA_DIR +} + +# start_sahara() - Start running processes, including screen +function start_sahara { + screen_it sahara "cd $SAHARA_DIR && $SAHARA_BIN_DIR/sahara-api --config-file $SAHARA_CONF_FILE" +} + +# stop_sahara() - Stop running processes +function stop_sahara { + # Kill the Sahara screen windows + screen -S $SCREEN_NAME -p sahara -X kill +} + + +# Restore xtrace +$XTRACE + +# Local variables: +# mode: shell-script +# End: diff --git a/lib/sahara-dashboard b/lib/sahara-dashboard new file mode 100644 index 0000000000..a81df0f7a8 --- /dev/null +++ b/lib/sahara-dashboard @@ -0,0 +1,72 @@ +# lib/sahara-dashboard + +# Dependencies: +# +# - ``functions`` file +# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined +# - ``SERVICE_HOST`` + +# ``stack.sh`` calls the entry points in this order: +# +# - install_sahara_dashboard +# - configure_sahara_dashboard +# - cleanup_sahara_dashboard + +# Save trace setting +XTRACE=$(set +o | grep xtrace) +set +o xtrace + +source $TOP_DIR/lib/horizon + +# Defaults +# -------- + +# Set up default repos +SAHARA_DASHBOARD_REPO=${SAHARA_DASHBOARD_REPO:-${GIT_BASE}/openstack/sahara-dashboard.git} +SAHARA_DASHBOARD_BRANCH=${SAHARA_DASHBOARD_BRANCH:-master} + +SAHARA_PYTHONCLIENT_REPO=${SAHARA_PYTHONCLIENT_REPO:-${GIT_BASE}/openstack/python-saharaclient.git} +SAHARA_PYTHONCLIENT_BRANCH=${SAHARA_PYTHONCLIENT_BRANCH:-master} + +# Set up default directories +SAHARA_DASHBOARD_DIR=$DEST/sahara-dashboard +SAHARA_PYTHONCLIENT_DIR=$DEST/python-saharaclient + +# Functions +# --------- + +function configure_sahara_dashboard { + + echo -e "AUTO_ASSIGNMENT_ENABLED = False" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py + echo -e "HORIZON_CONFIG['dashboards'] += ('sahara',)" >> $HORIZON_DIR/openstack_dashboard/settings.py + echo -e "INSTALLED_APPS += ('saharadashboard',)" >> $HORIZON_DIR/openstack_dashboard/settings.py + + if is_service_enabled neutron; then + echo -e "SAHARA_USE_NEUTRON = True" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py + fi +} + +# install_sahara_dashboard() - Collect source and prepare +function install_sahara_dashboard { + install_python_saharaclient + git_clone $SAHARA_DASHBOARD_REPO $SAHARA_DASHBOARD_DIR $SAHARA_DASHBOARD_BRANCH + setup_develop $SAHARA_DASHBOARD_DIR +} + +function install_python_saharaclient { + git_clone $SAHARA_PYTHONCLIENT_REPO $SAHARA_PYTHONCLIENT_DIR $SAHARA_PYTHONCLIENT_BRANCH + setup_develop $SAHARA_PYTHONCLIENT_DIR +} + +# Cleanup file settings.py from Sahara +function cleanup_sahara_dashboard { + sed -i '/sahara/d' $HORIZON_DIR/openstack_dashboard/settings.py +} + +# Restore xtrace +$XTRACE + +# Local variables: +# mode: shell-script +# End: + diff --git a/lib/savanna b/lib/savanna deleted file mode 100644 index 2cb092c96c..0000000000 --- a/lib/savanna +++ /dev/null @@ -1,173 +0,0 @@ -# lib/savanna - -# Dependencies: -# ``functions`` file -# ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined - -# ``stack.sh`` calls the entry points in this order: -# -# install_savanna -# configure_savanna -# start_savanna -# stop_savanna -# cleanup_savanna - -# Save trace setting -XTRACE=$(set +o | grep xtrace) -set +o xtrace - - -# Defaults -# -------- - -# Set up default repos -SAVANNA_REPO=${SAVANNA_REPO:-${GIT_BASE}/openstack/savanna.git} -SAVANNA_BRANCH=${SAVANNA_BRANCH:-master} - -# Set up default directories -SAVANNA_DIR=$DEST/savanna -SAVANNA_CONF_DIR=${SAVANNA_CONF_DIR:-/etc/savanna} -SAVANNA_CONF_FILE=${SAVANNA_CONF_DIR}/savanna.conf -SAVANNA_DEBUG=${SAVANNA_DEBUG:-True} - -SAVANNA_SERVICE_HOST=${SAVANNA_SERVICE_HOST:-$SERVICE_HOST} -SAVANNA_SERVICE_PORT=${SAVANNA_SERVICE_PORT:-8386} -SAVANNA_SERVICE_PROTOCOL=${SAVANNA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} - -SAVANNA_AUTH_CACHE_DIR=${SAVANNA_AUTH_CACHE_DIR:-/var/cache/savanna} - -# Support entry points installation of console scripts -if [[ -d $SAVANNA_DIR/bin ]]; then - SAVANNA_BIN_DIR=$SAVANNA_DIR/bin -else - SAVANNA_BIN_DIR=$(get_python_exec_prefix) -fi - -# Tell Tempest this project is present -TEMPEST_SERVICES+=,savanna - - -# Functions -# --------- - -# create_savanna_accounts() - Set up common required savanna accounts -# -# Tenant User Roles -# ------------------------------ -# service savanna admin -function create_savanna_accounts { - - SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }") - ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }") - - SAVANNA_USER=$(openstack user create \ - savanna \ - --password "$SERVICE_PASSWORD" \ - --project $SERVICE_TENANT \ - --email savanna@example.com \ - | grep " id " | get_field 2) - openstack role add \ - $ADMIN_ROLE \ - --project $SERVICE_TENANT \ - --user $SAVANNA_USER - - if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then - SAVANNA_SERVICE=$(openstack service create \ - savanna \ - --type=data_processing \ - --description="Savanna Data Processing" \ - | grep " id " | get_field 2) - openstack endpoint create \ - $SAVANNA_SERVICE \ - --region RegionOne \ - --publicurl "$SAVANNA_SERVICE_PROTOCOL://$SAVANNA_SERVICE_HOST:$SAVANNA_SERVICE_PORT/v1.1/\$(tenant_id)s" \ - --adminurl "$SAVANNA_SERVICE_PROTOCOL://$SAVANNA_SERVICE_HOST:$SAVANNA_SERVICE_PORT/v1.1/\$(tenant_id)s" \ - --internalurl "$SAVANNA_SERVICE_PROTOCOL://$SAVANNA_SERVICE_HOST:$SAVANNA_SERVICE_PORT/v1.1/\$(tenant_id)s" - fi -} - -# cleanup_savanna() - Remove residual data files, anything left over from -# previous runs that would need to clean up. -function cleanup_savanna { - - # Cleanup auth cache dir - sudo rm -rf $SAVANNA_AUTH_CACHE_DIR -} - -# configure_savanna() - Set config files, create data dirs, etc -function configure_savanna { - - if [[ ! -d $SAVANNA_CONF_DIR ]]; then - sudo mkdir -p $SAVANNA_CONF_DIR - fi - sudo chown $STACK_USER $SAVANNA_CONF_DIR - - # Copy over savanna configuration file and configure common parameters. - cp $SAVANNA_DIR/etc/savanna/savanna.conf.sample $SAVANNA_CONF_FILE - - # Create auth cache dir - sudo mkdir -p $SAVANNA_AUTH_CACHE_DIR - sudo chown $STACK_USER $SAVANNA_AUTH_CACHE_DIR - rm -rf $SAVANNA_AUTH_CACHE_DIR/* - - # Set obsolete keystone auth configs for backward compatibility - iniset $SAVANNA_CONF_FILE DEFAULT os_auth_host $KEYSTONE_SERVICE_HOST - iniset $SAVANNA_CONF_FILE DEFAULT os_auth_port $KEYSTONE_SERVICE_PORT - iniset $SAVANNA_CONF_FILE DEFAULT os_auth_protocol $KEYSTONE_SERVICE_PROTOCOL - iniset $SAVANNA_CONF_FILE DEFAULT os_admin_password $SERVICE_PASSWORD - iniset $SAVANNA_CONF_FILE DEFAULT os_admin_username savanna - iniset $SAVANNA_CONF_FILE DEFAULT os_admin_tenant_name $SERVICE_TENANT_NAME - - # Set actual keystone auth configs - iniset $SAVANNA_CONF_FILE keystone_authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/ - iniset $SAVANNA_CONF_FILE keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME - iniset $SAVANNA_CONF_FILE keystone_authtoken admin_user savanna - iniset $SAVANNA_CONF_FILE keystone_authtoken admin_password $SERVICE_PASSWORD - iniset $SAVANNA_CONF_FILE keystone_authtoken signing_dir $SAVANNA_AUTH_CACHE_DIR - iniset $SAVANNA_CONF_FILE keystone_authtoken cafile $KEYSTONE_SSL_CA - - iniset $SAVANNA_CONF_FILE DEFAULT debug $SAVANNA_DEBUG - - iniset $SAVANNA_CONF_FILE database connection `database_connection_url savanna` - - if is_service_enabled neutron; then - iniset $SAVANNA_CONF_FILE DEFAULT use_neutron true - iniset $SAVANNA_CONF_FILE DEFAULT use_floating_ips true - fi - - if is_service_enabled heat; then - iniset $SAVANNA_CONF_FILE DEFAULT infrastructure_engine heat - else - iniset $SAVANNA_CONF_FILE DEFAULT infrastructure_engine savanna - fi - - iniset $SAVANNA_CONF_FILE DEFAULT use_syslog $SYSLOG - - recreate_database savanna utf8 - $SAVANNA_BIN_DIR/savanna-db-manage --config-file $SAVANNA_CONF_FILE upgrade head -} - -# install_savanna() - Collect source and prepare -function install_savanna { - git_clone $SAVANNA_REPO $SAVANNA_DIR $SAVANNA_BRANCH - setup_develop $SAVANNA_DIR -} - -# start_savanna() - Start running processes, including screen -function start_savanna { - screen_it savanna "cd $SAVANNA_DIR && $SAVANNA_BIN_DIR/savanna-api --config-file $SAVANNA_CONF_FILE" -} - -# stop_savanna() - Stop running processes -function stop_savanna { - # Kill the Savanna screen windows - screen -S $SCREEN_NAME -p savanna -X kill -} - - -# Restore xtrace -$XTRACE - -# Local variables: -# mode: shell-script -# End: diff --git a/lib/savanna-dashboard b/lib/savanna-dashboard deleted file mode 100644 index 6fe15a3c81..0000000000 --- a/lib/savanna-dashboard +++ /dev/null @@ -1,72 +0,0 @@ -# lib/savanna-dashboard - -# Dependencies: -# -# - ``functions`` file -# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined -# - ``SERVICE_HOST`` - -# ``stack.sh`` calls the entry points in this order: -# -# - install_savanna_dashboard -# - configure_savanna_dashboard -# - cleanup_savanna_dashboard - -# Save trace setting -XTRACE=$(set +o | grep xtrace) -set +o xtrace - -source $TOP_DIR/lib/horizon - -# Defaults -# -------- - -# Set up default repos -SAVANNA_DASHBOARD_REPO=${SAVANNA_DASHBOARD_REPO:-${GIT_BASE}/openstack/savanna-dashboard.git} -SAVANNA_DASHBOARD_BRANCH=${SAVANNA_DASHBOARD_BRANCH:-master} - -SAVANNA_PYTHONCLIENT_REPO=${SAVANNA_PYTHONCLIENT_REPO:-${GIT_BASE}/openstack/python-savannaclient.git} -SAVANNA_PYTHONCLIENT_BRANCH=${SAVANNA_PYTHONCLIENT_BRANCH:-master} - -# Set up default directories -SAVANNA_DASHBOARD_DIR=$DEST/savanna-dashboard -SAVANNA_PYTHONCLIENT_DIR=$DEST/python-savannaclient - -# Functions -# --------- - -function configure_savanna_dashboard { - - echo -e "AUTO_ASSIGNMENT_ENABLED = False" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py - echo -e "HORIZON_CONFIG['dashboards'] += ('savanna',)" >> $HORIZON_DIR/openstack_dashboard/settings.py - echo -e "INSTALLED_APPS += ('savannadashboard',)" >> $HORIZON_DIR/openstack_dashboard/settings.py - - if is_service_enabled neutron; then - echo -e "SAVANNA_USE_NEUTRON = True" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py - fi -} - -# install_savanna_dashboard() - Collect source and prepare -function install_savanna_dashboard { - install_python_savannaclient - git_clone $SAVANNA_DASHBOARD_REPO $SAVANNA_DASHBOARD_DIR $SAVANNA_DASHBOARD_BRANCH - setup_develop $SAVANNA_DASHBOARD_DIR -} - -function install_python_savannaclient { - git_clone $SAVANNA_PYTHONCLIENT_REPO $SAVANNA_PYTHONCLIENT_DIR $SAVANNA_PYTHONCLIENT_BRANCH - setup_develop $SAVANNA_PYTHONCLIENT_DIR -} - -# Cleanup file settings.py from Savanna -function cleanup_savanna_dashboard { - sed -i '/savanna/d' $HORIZON_DIR/openstack_dashboard/settings.py -} - -# Restore xtrace -$XTRACE - -# Local variables: -# mode: shell-script -# End: - From 51ebda6c8d37539473e463e8b24f27f21d798392 Mon Sep 17 00:00:00 2001 From: Sergey Lukjanov Date: Wed, 12 Mar 2014 22:26:12 +0400 Subject: [PATCH 0068/3949] Use sahara.conf.sample instead of old one Sahara internals was updated, now we can use correct conf sample. Change-Id: Ia8d99c2742785c3b5c724617a5dfc2880624a03f --- lib/sahara | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/sahara b/lib/sahara index 4cb04ecd3a..38b4ecd7e9 100644 --- a/lib/sahara +++ b/lib/sahara @@ -106,8 +106,7 @@ function configure_sahara { sudo chown $STACK_USER $SAHARA_CONF_DIR # Copy over sahara configuration file and configure common parameters. - # TODO(slukjanov): rename when sahara internals will be updated - cp $SAHARA_DIR/etc/savanna/savanna.conf.sample $SAHARA_CONF_FILE + cp $SAHARA_DIR/etc/sahara/sahara.conf.sample $SAHARA_CONF_FILE # Create auth cache dir sudo mkdir -p $SAHARA_AUTH_CACHE_DIR From 1a0c090057dde13fd3bb8ffcb84a923eb5952084 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 12 Mar 2014 14:59:50 -0500 Subject: [PATCH 0069/3949] Additional attempts to flosh stdout/stderr The logfile output is piped through awk to apply a timestamp and filter out all of the xtrace commands in the xtrace output. A while back we added fflush("") which is supposed to flush all open output files and pipes. It appears that gawk in precise is old enough that it may only flush stdout, so explicitly flush the logfile handle. Change-Id: If5198c2da2a3278eed8ae3d50c7ca5c15eac6d94 --- stack.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/stack.sh b/stack.sh index e76a55c534..a16046474c 100755 --- a/stack.sh +++ b/stack.sh @@ -541,6 +541,7 @@ if [[ -n "$LOGFILE" ]]; then print print > logfile fflush("") + fflush(logfile) }' ) 2>&1 # Set up a second fd for output exec 6> >( tee "${SUMFILE}" ) From 26c5a2252e9b99e053616d262fb627c1716a2e4d Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 12 Mar 2014 18:37:37 -0400 Subject: [PATCH 0070/3949] change the vmdk to the one used in VMWare ci The debian image that defaults to being using with vmware is huge, and it turns out it's not actually used in VMWare ci so we don't really know if it's working. Instead use the vmdk that is used in VMWare ci, which we know will boot, as we get results everyday. Change-Id: I014746af293852525e2bd128c4d19f5889ecd55d --- stackrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackrc b/stackrc index 6bb6f37195..cff1e26209 100644 --- a/stackrc +++ b/stackrc @@ -335,7 +335,7 @@ case "$VIRT_DRIVER" in ;; vsphere) DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-debian-2.6.32-i686} - IMAGE_URLS=${IMAGE_URLS:-"http://partnerweb.vmware.com/programs/vmdkimage/debian-2.6.32-i686.vmdk"};; + IMAGE_URLS=${IMAGE_URLS:-"http://partnerweb.vmware.com/programs/vmdkimage/cirros-0.3.0-i386-disk.vmdk"};; xenserver) DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.0-x86_64-disk} IMAGE_URLS=${IMAGE_URLS:-"https://github.com/downloads/citrix-openstack/warehouse/cirros-0.3.0-x86_64-disk.vhd.tgz"};; From 7eb99343979921993dc361f71b5efd77e9130f78 Mon Sep 17 00:00:00 2001 From: Attila Fazekas Date: Thu, 6 Feb 2014 10:33:40 +0100 Subject: [PATCH 0071/3949] Setup the correct ec2 manifest path setup correctly the path to the ec2 boundled images. Change-Id: If3bce845e009a73c6b685976de3fa6d44b907bed --- lib/tempest | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tempest b/lib/tempest index c74f00d1ab..a3df45e81c 100644 --- a/lib/tempest +++ b/lib/tempest @@ -310,6 +310,9 @@ function configure_tempest { iniset $TEMPEST_CONFIG boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud" iniset $TEMPEST_CONFIG boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}" iniset $TEMPEST_CONFIG boto s3_materials_path "$BOTO_MATERIALS_PATH" + iniset $TEMPEST_CONFIG boto ari_manifest cirros-0.3.1-x86_64-initrd.manifest.xml + iniset $TEMPEST_CONFIG boto ami_manifest cirros-0.3.1-x86_64-blank.img.manifest.xml + iniset $TEMPEST_CONFIG boto aki_manifest cirros-0.3.1-x86_64-vmlinuz.manifest.xml iniset $TEMPEST_CONFIG boto instance_type "$boto_instance_type" iniset $TEMPEST_CONFIG boto http_socket_timeout 30 iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros} From 0f73ff2c516cb9fdb6849f7feb19cd0cfde46852 Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Thu, 13 Mar 2014 14:20:43 -0700 Subject: [PATCH 0072/3949] Move libvirt install + setup to functions-libvirt Moves installation and setup of libvirt to a common functions-libvirt, which can be used by other drivers in the future that may require cross-distro libvirt installation and config but are not using VIRT_DRIVER=libvirt (ie, Ironic). Change-Id: I4a9255c8b4bacd5acfde9b8061c9e537aeea592c --- lib/nova_plugins/functions-libvirt | 125 ++++++++++++++++++++++++++++ lib/nova_plugins/hypervisor-libvirt | 99 +--------------------- 2 files changed, 128 insertions(+), 96 deletions(-) create mode 100644 lib/nova_plugins/functions-libvirt diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt new file mode 100644 index 0000000000..adffe010ee --- /dev/null +++ b/lib/nova_plugins/functions-libvirt @@ -0,0 +1,125 @@ +# lib/nova_plugins/functions-libvirt +# Common libvirt configuration functions + +# Dependencies: +# ``functions`` file +# ``STACK_USER`` has to be defined + +# Save trace setting +LV_XTRACE=$(set +o | grep xtrace) +set +o xtrace + +# Defaults +# ------- + +# if we should turn on massive libvirt debugging +DEBUG_LIBVIRT=$(trueorfalse False $DEBUG_LIBVIRT) + +# Installs required distro-specific libvirt packages. +function install_libvirt { + if is_ubuntu; then + install_package kvm + install_package libvirt-bin + install_package python-libvirt + install_package python-guestfs + elif is_fedora || is_suse; then + install_package kvm + install_package libvirt + install_package libvirt-python + install_package python-libguestfs + fi +} + +# Configures the installed libvirt system so that is accessible by +# STACK_USER via qemu:///system with management capabilities. +function configure_libvirt { + 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 </dev/null; then + sudo groupadd $LIBVIRT_GROUP + fi + add_user_to_group $STACK_USER $LIBVIRT_GROUP + + # Enable server side traces for libvirtd + if [[ "$DEBUG_LIBVIRT" = "True" ]] ; then + local log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 1:util" + local log_outputs="1:file:/var/log/libvirt/libvirtd.log" + if ! grep -q "log_filters=\"$log_filters\"" /etc/libvirt/libvirtd.conf; then + echo "log_filters=\"$log_filters\"" | sudo tee -a /etc/libvirt/libvirtd.conf + fi + if ! grep -q "log_outputs=\"$log_outputs\"" /etc/libvirt/libvirtd.conf; then + echo "log_outputs=\"$log_outputs\"" | sudo tee -a /etc/libvirt/libvirtd.conf + fi + fi + + # libvirt detects various settings on startup, as we potentially changed + # the system configuration (modules, filesystems), we need to restart + # libvirt to detect those changes. + restart_service $LIBVIRT_DAEMON +} + + +# Restore xtrace +$LV_XTRACE + +# Local variables: +# mode: shell-script +# End: diff --git a/lib/nova_plugins/hypervisor-libvirt b/lib/nova_plugins/hypervisor-libvirt index 5a51f33808..053df3cdf5 100644 --- a/lib/nova_plugins/hypervisor-libvirt +++ b/lib/nova_plugins/hypervisor-libvirt @@ -7,7 +7,6 @@ # Dependencies: # ``functions`` file # ``nova`` configuration -# ``STACK_USER`` has to be defined # install_nova_hypervisor - install any external requirements # configure_nova_hypervisor - make configuration changes, including those to other services @@ -19,14 +18,13 @@ MY_XTRACE=$(set +o | grep xtrace) set +o xtrace +source $TOP_DIR/lib/nova_plugins/functions-libvirt # Defaults # -------- # File injection is disabled by default in Nova. This will turn it back on. ENABLE_FILE_INJECTION=${ENABLE_FILE_INJECTION:-False} -# if we should turn on massive libvirt debugging -DEBUG_LIBVIRT=$(trueorfalse False $DEBUG_LIBVIRT) # Entry Points @@ -40,88 +38,7 @@ function cleanup_nova_hypervisor { # configure_nova_hypervisor - Set config files, create data dirs, etc function configure_nova_hypervisor { - 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 </dev/null; then - sudo groupadd $LIBVIRT_GROUP - fi - add_user_to_group $STACK_USER $LIBVIRT_GROUP - - # Enable server side traces for libvirtd - if [[ "$DEBUG_LIBVIRT" = "True" ]] ; then - local log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 1:util" - local log_outputs="1:file:/var/log/libvirt/libvirtd.log" - if ! grep -q "log_filters=\"$log_filters\"" /etc/libvirt/libvirtd.conf; then - echo "log_filters=\"$log_filters\"" | sudo tee -a /etc/libvirt/libvirtd.conf - fi - if ! grep -q "log_outputs=\"$log_outputs\"" /etc/libvirt/libvirtd.conf; then - echo "log_outputs=\"$log_outputs\"" | sudo tee -a /etc/libvirt/libvirtd.conf - fi - fi - - # libvirt detects various settings on startup, as we potentially changed - # the system configuration (modules, filesystems), we need to restart - # libvirt to detect those changes. - restart_service $LIBVIRT_DAEMON - + configure_libvirt iniset $NOVA_CONF DEFAULT libvirt_type "$LIBVIRT_TYPE" iniset $NOVA_CONF DEFAULT libvirt_cpu_mode "none" iniset $NOVA_CONF DEFAULT use_usb_tablet "False" @@ -150,17 +67,7 @@ EOF # install_nova_hypervisor() - Install external components function install_nova_hypervisor { - if is_ubuntu; then - install_package kvm - install_package libvirt-bin - install_package python-libvirt - install_package python-guestfs - elif is_fedora || is_suse; then - install_package kvm - install_package libvirt - install_package libvirt-python - install_package python-libguestfs - fi + install_libvirt # Install and configure **LXC** if specified. LXC is another approach to # splitting a system into many smaller parts. LXC uses cgroups and chroot From bbf759e9ed59b31258bcc8ba9fd3c79db9e57aee Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Thu, 13 Mar 2014 18:09:17 -0700 Subject: [PATCH 0073/3949] Only stop n-cpu in stop_nova_compute Move screen_stop n-cpu from stop_nova_rest to stop_nova_compute. Change-Id: I672673a55869d3f68e12c476924fc742e8260f39 --- lib/nova | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nova b/lib/nova index 360427d13e..b01d107525 100644 --- a/lib/nova +++ b/lib/nova @@ -716,6 +716,7 @@ function start_nova { } function stop_nova_compute { + screen_stop n-cpu if is_service_enabled n-cpu && [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then stop_nova_hypervisor fi @@ -725,7 +726,7 @@ function stop_nova_rest { # Kill the nova screen windows # Some services are listed here twice since more than one instance # of a service may be running in certain configs. - for serv in n-api n-cpu n-crt n-net n-sch n-novnc n-xvnc n-cauth n-spice n-cond n-cell n-cell n-api-meta n-obj; do + for serv in n-api n-crt n-net n-sch n-novnc n-xvnc n-cauth n-spice n-cond n-cell n-cell n-api-meta n-obj; do screen_stop $serv done } From 1e94eb1a3f1c87670ff4720b89f25b95e0d15e07 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Thu, 13 Mar 2014 23:22:39 -0500 Subject: [PATCH 0074/3949] Move from keystoneclient to openstackclient in eucarc Updating an ec2 create command to openstackclient syntax. Change-Id: I3dd21ddd52b77f3af76988db9ae6b863427d9106 --- eucarc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eucarc b/eucarc index 350235106c..343f4ccde2 100644 --- a/eucarc +++ b/eucarc @@ -22,7 +22,7 @@ source $RC_DIR/openrc export EC2_URL=$(keystone catalog --service ec2 | awk '/ publicURL / { print $4 }') # Create EC2 credentials for the current user -CREDS=$(keystone ec2-credentials-create) +CREDS=$(openstack ec2 credentials create) export EC2_ACCESS_KEY=$(echo "$CREDS" | awk '/ access / { print $4 }') export EC2_SECRET_KEY=$(echo "$CREDS" | awk '/ secret / { print $4 }') From 2f6c30b33c074a03748b7c0273c49fe81ab96607 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Thu, 13 Mar 2014 23:32:46 -0500 Subject: [PATCH 0075/3949] Update client-env to use openstackclient commands Updated the only instance of a keystoneclient command, to check if the identity service is enabled. Change-Id: If86f71c1610a79690d6c6a8eb423b6fa234372bb --- exercises/client-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/client-env.sh b/exercises/client-env.sh index d955e4d1e1..4e8259cd06 100755 --- a/exercises/client-env.sh +++ b/exercises/client-env.sh @@ -64,7 +64,7 @@ if [[ "$ENABLED_SERVICES" =~ "key" ]]; then STATUS_KEYSTONE="Skipped" else echo -e "\nTest Keystone" - if keystone catalog --service identity; then + if openstack endpoint show identity; then STATUS_KEYSTONE="Succeeded" else STATUS_KEYSTONE="Failed" From 4376ae04df50fb9b338039b02a94fea351cedb28 Mon Sep 17 00:00:00 2001 From: Tiago Mello Date: Fri, 14 Mar 2014 10:48:56 -0300 Subject: [PATCH 0076/3949] Clean /etc/mysql when calling clean.sh The clean.sh script should also remove the /etc/mysql directory. It contains information from the old devstack installation and may conflict with the further one. apt-get purge does not remove it since the directory is not empty. Change-Id: I885345a2311851d8746abe42e44300ecd4f6e08a --- lib/databases/mysql | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/databases/mysql b/lib/databases/mysql index f5ee3c0ed0..7a0145ae1b 100644 --- a/lib/databases/mysql +++ b/lib/databases/mysql @@ -23,6 +23,7 @@ function cleanup_database_mysql { stop_service $MYSQL apt_get purge -y mysql* sudo rm -rf /var/lib/mysql + sudo rm -rf /etc/mysql return elif is_fedora; then if [[ $DISTRO =~ (rhel7) ]]; then From 0b03e7acb84e14efed3bfc2b30055a8427a40a12 Mon Sep 17 00:00:00 2001 From: Rafael Folco Date: Fri, 14 Mar 2014 11:14:57 -0300 Subject: [PATCH 0077/3949] Set correct default disk bus back to virtio on ppc64 virtio is supported and should be the default disk bus on Power to take advantage of I/O performance drivers. This aligns with Nova default bus values on PowerKVM. SCSI is the default for cdrom. Change-Id: I5de08c90359b3a500c352c09c07b6b082ddb4325 --- functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions b/functions index 1d30922916..e439ef6dbe 100644 --- a/functions +++ b/functions @@ -290,7 +290,7 @@ function upload_image { esac if is_arch "ppc64"; then - IMG_PROPERTY="--property hw_disk_bus=scsi --property hw_cdrom_bus=scsi" + IMG_PROPERTY="--property hw_cdrom_bus=scsi" fi if [ "$CONTAINER_FORMAT" = "bare" ]; then From 846609b627bff979ce767dd9ad00daa46a150342 Mon Sep 17 00:00:00 2001 From: Piyush Masrani Date: Fri, 14 Mar 2014 19:21:48 +0530 Subject: [PATCH 0078/3949] Devstack changes to ceilometer to support vsphere Ceilometer currently supports only libvirt when installed using devstack. Have extended this support to Vmware Vsphere in this changelist. Change-Id: I98c64204973bca5e6a7f859a5431adb2b661277f --- lib/ceilometer | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ceilometer b/lib/ceilometer index b0899e2f24..abf4629b5e 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -161,6 +161,13 @@ function configure_ceilometer { configure_mongodb cleanup_ceilometer fi + + if [[ "$VIRT_DRIVER" = 'vsphere' ]]; then + iniset $CEILOMETER_CONF DEFAULT hypervisor_inspector vsphere + iniset $CEILOMETER_CONF vmware host_ip "$VMWAREAPI_IP" + iniset $CEILOMETER_CONF vmware host_username "$VMWAREAPI_USER" + iniset $CEILOMETER_CONF vmware host_password "$VMWAREAPI_PASSWORD" + fi } function configure_mongodb { @@ -204,6 +211,9 @@ function start_ceilometer { if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then screen_it ceilometer-acompute "cd ; sg $LIBVIRT_GROUP \"ceilometer-agent-compute --config-file $CEILOMETER_CONF\"" fi + if [[ "$VIRT_DRIVER" = 'vsphere' ]]; then + screen_it ceilometer-acompute "cd ; ceilometer-agent-compute --config-file $CEILOMETER_CONF" + fi screen_it ceilometer-acentral "cd ; ceilometer-agent-central --config-file $CEILOMETER_CONF" screen_it ceilometer-anotification "cd ; ceilometer-agent-notification --config-file $CEILOMETER_CONF" screen_it ceilometer-collector "cd ; ceilometer-collector --config-file $CEILOMETER_CONF" From 380587bde6444edcc8c0b3adad250de70b27ad33 Mon Sep 17 00:00:00 2001 From: Malini Kamalambal Date: Fri, 14 Mar 2014 12:22:18 -0400 Subject: [PATCH 0079/3949] Rollback workaround for Marconi This patch rollsback the stderr redirection in Marconi. Change-Id: Iaa2d897295cf2bc2e4a8c370d3e0592def337c78 --- lib/marconi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marconi b/lib/marconi index 3c4547fc75..fd1c35132a 100644 --- a/lib/marconi +++ b/lib/marconi @@ -154,7 +154,7 @@ function install_marconiclient { # start_marconi() - Start running processes, including screen function start_marconi { - screen_it marconi-server "marconi-server --config-file $MARCONI_CONF 2>&1" + screen_it marconi-server "marconi-server --config-file $MARCONI_CONF" echo "Waiting for Marconi to start..." if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- $MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT/v1/health; do sleep 1; done"; then die $LINENO "Marconi did not start" From 29870cce3214766ecc208d0bb404724cf232ad69 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 14 Mar 2014 14:32:01 -0400 Subject: [PATCH 0080/3949] as is_heat_enabled this is missing, and the code assumes "heat" to be in the enabled services list otherwise. Change-Id: Ib0a7db04d8e38b58aca48261308e7c4d1fd43972 --- lib/heat | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/heat b/lib/heat index 2d9d863f0c..902333e29a 100644 --- a/lib/heat +++ b/lib/heat @@ -45,6 +45,13 @@ TEMPEST_SERVICES+=,heat # Functions # --------- +# Test if any Heat services are enabled +# is_heat_enabled +function is_heat_enabled { + [[ ,${ENABLED_SERVICES} =~ ,"h-" ]] && return 0 + return 1 +} + # cleanup_heat() - Remove residual data files, anything left over from previous # runs that a clean run would need to clean up function cleanup_heat { From 06fb29c66124b6c753fdd262eb262043b4551298 Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Fri, 31 Jan 2014 18:02:07 +0400 Subject: [PATCH 0081/3949] Integration testing preparation for Ironic Add ability to create/register qemu vms for Ironic testing purposes Implements bp:deprecate-baremetal-driver Change-Id: If452438fcc0ff562531b33a36cd189b235654b48 --- extras.d/50-ironic.sh | 7 + files/apts/ironic | 10 + files/rpms/ironic | 9 + lib/baremetal | 7 +- lib/ironic | 265 ++++++++++++++++++- lib/nova_plugins/hypervisor-ironic | 75 ++++++ stackrc | 2 +- tools/install_prereqs.sh | 8 +- tools/ironic/scripts/cleanup-nodes | 25 ++ tools/ironic/scripts/configure-vm | 78 ++++++ tools/ironic/scripts/create-nodes | 68 +++++ tools/ironic/scripts/setup-network | 24 ++ tools/ironic/templates/brbm.xml | 6 + tools/ironic/templates/tftpd-xinetd.template | 11 + tools/ironic/templates/vm.xml | 43 +++ 15 files changed, 630 insertions(+), 8 deletions(-) create mode 100644 files/apts/ironic create mode 100644 files/rpms/ironic create mode 100644 lib/nova_plugins/hypervisor-ironic create mode 100755 tools/ironic/scripts/cleanup-nodes create mode 100755 tools/ironic/scripts/configure-vm create mode 100755 tools/ironic/scripts/create-nodes create mode 100755 tools/ironic/scripts/setup-network create mode 100644 tools/ironic/templates/brbm.xml create mode 100644 tools/ironic/templates/tftpd-xinetd.template create mode 100644 tools/ironic/templates/vm.xml diff --git a/extras.d/50-ironic.sh b/extras.d/50-ironic.sh index 9e61dc5d78..3b8e3d5045 100644 --- a/extras.d/50-ironic.sh +++ b/extras.d/50-ironic.sh @@ -24,10 +24,17 @@ if is_service_enabled ir-api ir-cond; then # Start the ironic API and ironic taskmgr components echo_summary "Starting Ironic" start_ironic + + if [[ "$IRONIC_BAREMETAL_BASIC_OPS" = "True" ]]; then + prepare_baremetal_basic_ops + fi fi if [[ "$1" == "unstack" ]]; then stop_ironic + if [[ "$IRONIC_BAREMETAL_BASIC_OPS" = "True" ]]; then + cleanup_baremetal_basic_ops + fi fi if [[ "$1" == "clean" ]]; then diff --git a/files/apts/ironic b/files/apts/ironic new file mode 100644 index 0000000000..a749ad762e --- /dev/null +++ b/files/apts/ironic @@ -0,0 +1,10 @@ +libguestfs0 +libvirt-bin +openssh-client +openvswitch-switch +openvswitch-datapath-dkms +python-libguestfs +python-libvirt +syslinux +tftpd-hpa +xinetd diff --git a/files/rpms/ironic b/files/rpms/ironic new file mode 100644 index 0000000000..54b98299ee --- /dev/null +++ b/files/rpms/ironic @@ -0,0 +1,9 @@ +libguestfs +libvirt +libvirt-python +openssh-clients +openvswitch +python-libguestfs +syslinux +tftp-server +xinetd diff --git a/lib/baremetal b/lib/baremetal index 1d02e1e417..eda92f97cb 100644 --- a/lib/baremetal +++ b/lib/baremetal @@ -140,7 +140,10 @@ BM_DEPLOY_KERNEL=${BM_DEPLOY_KERNEL:-} # If you need to add any extra flavors to the deploy ramdisk image # eg, specific network drivers, specify them here -BM_DEPLOY_FLAVOR=${BM_DEPLOY_FLAVOR:-} +# +# NOTE(deva): this will be moved to lib/ironic in a future patch +# for now, set the default to a suitable value for Ironic's needs +BM_DEPLOY_FLAVOR=${BM_DEPLOY_FLAVOR:--a amd64 ubuntu deploy-ironic} # set URL and version for google shell-in-a-box BM_SHELL_IN_A_BOX=${BM_SHELL_IN_A_BOX:-http://shellinabox.googlecode.com/files/shellinabox-2.14.tar.gz} @@ -220,7 +223,7 @@ function upload_baremetal_deploy { BM_DEPLOY_KERNEL=bm-deploy.kernel BM_DEPLOY_RAMDISK=bm-deploy.initramfs if [ ! -e "$TOP_DIR/files/$BM_DEPLOY_KERNEL" -o ! -e "$TOP_DIR/files/$BM_DEPLOY_RAMDISK" ]; then - $BM_IMAGE_BUILD_DIR/bin/ramdisk-image-create $BM_DEPLOY_FLAVOR deploy \ + $BM_IMAGE_BUILD_DIR/bin/ramdisk-image-create $BM_DEPLOY_FLAVOR \ -o $TOP_DIR/files/bm-deploy fi fi diff --git a/lib/ironic b/lib/ironic index b346de1e69..c6fa563e6a 100644 --- a/lib/ironic +++ b/lib/ironic @@ -18,16 +18,19 @@ # - stop_ironic # - cleanup_ironic -# Save trace setting +# Save trace and pipefail settings XTRACE=$(set +o | grep xtrace) +PIPEFAIL=$(set +o | grep pipefail) set +o xtrace - +set +o pipefail # Defaults # -------- # Set up default directories IRONIC_DIR=$DEST/ironic +IRONIC_DATA_DIR=$DATA_DIR/ironic +IRONIC_STATE_PATH=/var/lib/ironic IRONICCLIENT_DIR=$DEST/python-ironicclient IRONIC_AUTH_CACHE_DIR=${IRONIC_AUTH_CACHE_DIR:-/var/cache/ironic} IRONIC_CONF_DIR=${IRONIC_CONF_DIR:-/etc/ironic} @@ -35,6 +38,28 @@ IRONIC_CONF_FILE=$IRONIC_CONF_DIR/ironic.conf IRONIC_ROOTWRAP_CONF=$IRONIC_CONF_DIR/rootwrap.conf IRONIC_POLICY_JSON=$IRONIC_CONF_DIR/policy.json +# Set up defaults for functional / integration testing +IRONIC_SCRIPTS_DIR=${IRONIC_SCRIPTS_DIR:-$TOP_DIR/tools/ironic/scripts} +IRONIC_TEMPLATES_DIR=${IRONIC_TEMPLATES_DIR:-$TOP_DIR/tools/ironic/templates} +IRONIC_BAREMETAL_BASIC_OPS=$(trueorfalse False $IRONIC_BAREMETAL_BASIC_OPS) +IRONIC_SSH_USERNAME=${IRONIC_SSH_USERNAME:-`whoami`} +IRONIC_SSH_KEY_DIR=${IRONIC_SSH_KEY_DIR:-$IRONIC_DATA_DIR/ssh_keys} +IRONIC_SSH_KEY_FILENAME=${IRONIC_SSH_KEY_FILENAME:-ironic_key} +IRONIC_KEY_FILE=$IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME +IRONIC_SSH_VIRT_TYPE=${IRONIC_SSH_VIRT_TYPE:-virsh} +IRONIC_TFTPBOOT_DIR=${IRONIC_TFTPBOOT_DIR:-$IRONIC_DATA_DIR/tftpboot} +IRONIC_VM_SSH_PORT=${IRONIC_VM_SSH_PORT:-2222} +IRONIC_VM_SSH_ADDRESS=${IRONIC_VM_SSH_ADDRESS:-$HOST_IP} +IRONIC_VM_COUNT=${IRONIC_VM_COUNT:-1} +IRONIC_VM_SPECS_CPU=${IRONIC_VM_SPECS_CPU:-1} +IRONIC_VM_SPECS_RAM=${IRONIC_VM_SPECS_RAM:-256} +IRONIC_VM_SPECS_DISK=${IRONIC_VM_SPECS_DISK:-10} +IRONIC_VM_EMULATOR=${IRONIC_VM_EMULATOR:-/usr/bin/qemu-system-x86_64} +IRONIC_VM_NETWORK_BRIDGE=${IRONIC_VM_NETWORK_BRIDGE:-brbm} +IRONIC_VM_NETWORK_RANGE=${IRONIC_VM_NETWORK_RANGE:-192.0.2.0/24} +IRONIC_VM_MACS_CSV_FILE=${IRONIC_VM_MACS_CSV_FILE:-$IRONIC_DATA_DIR/ironic_macs.csv} +IRONIC_AUTHORIZED_KEYS_FILE=${IRONIC_AUTHORIZED_KEYS_FILE:-$HOME/.ssh/authorized_keys} + # Support entry points installation of console scripts IRONIC_BIN_DIR=$(get_python_exec_prefix) @@ -86,8 +111,8 @@ function configure_ironic { iniset $IRONIC_CONF_FILE DEFAULT debug True inicomment $IRONIC_CONF_FILE DEFAULT log_file iniset $IRONIC_CONF_FILE DEFAULT sql_connection `database_connection_url ironic` + iniset $IRONIC_CONF_FILE DEFAULT state_path $IRONIC_STATE_PATH iniset $IRONIC_CONF_FILE DEFAULT use_syslog $SYSLOG - # Configure Ironic conductor, if it was enabled. if is_service_enabled ir-cond; then configure_ironic_conductor @@ -97,6 +122,10 @@ function configure_ironic { if is_service_enabled ir-api; then configure_ironic_api fi + + if [[ "$IRONIC_BAREMETAL_BASIC_OPS" == "True" ]]; then + configure_ironic_auxiliary + fi } # configure_ironic_api() - Is used by configure_ironic(). Performs @@ -125,6 +154,10 @@ function configure_ironic_conductor { cp -r $IRONIC_DIR/etc/ironic/rootwrap.d $IRONIC_CONF_DIR iniset $IRONIC_CONF_FILE DEFAULT rootwrap_config $IRONIC_ROOTWRAP_CONF + iniset $IRONIC_CONF_FILE conductor api_url http://$SERVICE_HOST:6385 + iniset $IRONIC_CONF_FILE pxe tftp_server $SERVICE_HOST + iniset $IRONIC_CONF_FILE pxe tftp_root $IRONIC_TFTPBOOT_DIR + iniset $IRONIC_CONF_FILE pxe tftp_master_path $IRONIC_TFTPBOOT_DIR/master_images } # create_ironic_cache_dir() - Part of the init_ironic() process @@ -225,9 +258,233 @@ function stop_ironic { screen -S $SCREEN_NAME -p ir-cond -X kill } +function is_ironic { + if ( is_service_enabled ir-cond && is_service_enabled ir-api ); then + return 0 + fi + return 1 +} + +function configure_ironic_dirs { + sudo mkdir -p $IRONIC_DATA_DIR + sudo mkdir -p $IRONIC_STATE_PATH + sudo mkdir -p $IRONIC_TFTPBOOT_DIR + sudo chown -R $STACK_USER $IRONIC_DATA_DIR $IRONIC_STATE_PATH + sudo chown -R $STACK_USER:$LIBVIRT_GROUP $IRONIC_TFTPBOOT_DIR + if is_ubuntu; then + PXEBIN=/usr/lib/syslinux/pxelinux.0 + elif is_fedora; then + PXEBIN=/usr/share/syslinux/pxelinux.0 + fi + if [ ! -f $PXEBIN ]; then + die $LINENO "pxelinux.0 (from SYSLINUX) not found." + fi + + cp $PXEBIN $IRONIC_TFTPBOOT_DIR + mkdir -p $IRONIC_TFTPBOOT_DIR/pxelinux.cfg +} + +function ironic_ensure_libvirt_group { + groups $STACK_USER | grep -q $LIBVIRT_GROUP || adduser $STACK_USER $LIBVIRT_GROUP +} + +function create_bridge_and_vms { + ironic_ensure_libvirt_group + + # Call libvirt setup scripts in a new shell to ensure any new group membership + sudo su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/setup-network" + + sudo su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/create-nodes \ + $IRONIC_VM_SPECS_CPU $IRONIC_VM_SPECS_RAM $IRONIC_VM_SPECS_DISK \ + amd64 $IRONIC_VM_COUNT $IRONIC_VM_NETWORK_BRIDGE $IRONIC_VM_EMULATOR" >> $IRONIC_VM_MACS_CSV_FILE + +} + +function enroll_vms { + + CHASSIS_ID=$(ironic chassis-create -d "ironic test chassis" | grep " uuid " | get_field 2) + IRONIC_NET_ID=$(neutron net-list | grep private | get_field 1) + local idx=0 + + # work around; need to know what netns neutron uses for private network + neutron port-create private + + while read MAC; do + + NODE_ID=$(ironic node-create --chassis_uuid $CHASSIS_ID --driver pxe_ssh \ + -i ssh_virt_type=$IRONIC_SSH_VIRT_TYPE \ + -i ssh_address=$IRONIC_VM_SSH_ADDRESS \ + -i ssh_port=$IRONIC_VM_SSH_PORT \ + -i ssh_username=$IRONIC_SSH_USERNAME \ + -i ssh_key_filename=$IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME \ + -p cpus=$IRONIC_VM_SPECS_CPU \ + -p memory_mb=$IRONIC_VM_SPECS_RAM \ + -p local_gb=$IRONIC_VM_SPECS_DISK \ + -p cpu_arch=x86_64 \ + | grep " uuid " | get_field 2) + + ironic port-create --address $MAC --node_uuid $NODE_ID + + idx=$((idx+1)) + + done < $IRONIC_VM_MACS_CSV_FILE + + # create the nova flavor + nova flavor-create baremetal auto $IRONIC_VM_SPECS_RAM $IRONIC_VM_SPECS_DISK $IRONIC_VM_SPECS_CPU + nova flavor-key baremetal set "cpu_arch"="x86_64" "baremetal:deploy_kernel_id"="$BM_DEPLOY_KERNEL_ID" "baremetal:deploy_ramdisk_id"="$BM_DEPLOY_RAMDISK_ID" + + # intentional sleep to make sure the tag has been set to port + sleep 10 + TAPDEV=$(sudo ip netns exec qdhcp-${IRONIC_NET_ID} ip link list | grep tap | cut -d':' -f2 | cut -b2-) + TAG_ID=$(sudo ovs-vsctl show |grep ${TAPDEV} -A1 -m1 | grep tag | cut -d':' -f2 | cut -b2-) + + # make sure veth pair is not existing, otherwise delete its links + sudo ip link show ovs-tap1 && sudo ip link delete ovs-tap1 + sudo ip link show brbm-tap1 && sudo ip link delete brbm-tap1 + # create veth pair for future interconnection between br-int and brbm + sudo ip link add brbm-tap1 type veth peer name ovs-tap1 + sudo ip link set dev brbm-tap1 up + sudo ip link set dev ovs-tap1 up + + sudo ovs-vsctl -- --if-exists del-port ovs-tap1 -- add-port br-int ovs-tap1 tag=$TAG_ID + sudo ovs-vsctl -- --if-exists del-port brbm-tap1 -- add-port $IRONIC_VM_NETWORK_BRIDGE brbm-tap1 +} + +function configure_tftpd { + # enable tftp natting for allowing connections to SERVICE_HOST's tftp server + sudo modprobe nf_conntrack_tftp + sudo modprobe nf_nat_tftp + + if is_ubuntu; then + PXEBIN=/usr/lib/syslinux/pxelinux.0 + elif is_fedora; then + PXEBIN=/usr/share/syslinux/pxelinux.0 + fi + if [ ! -f $PXEBIN ]; then + die $LINENO "pxelinux.0 (from SYSLINUX) not found." + fi + + # stop tftpd and setup serving via xinetd + stop_service tftpd-hpa || true + [ -f /etc/init/tftpd-hpa.conf ] && echo "manual" | sudo tee /etc/init/tftpd-hpa.override + sudo cp $IRONIC_TEMPLATES_DIR/tftpd-xinetd.template /etc/xinetd.d/tftp + sudo sed -e "s|%TFTPBOOT_DIR%|$IRONIC_TFTPBOOT_DIR|g" -i /etc/xinetd.d/tftp + + # setup tftp file mapping to satisfy requests at the root (booting) and + # /tftpboot/ sub-dir (as per deploy-ironic elements) + echo "r ^([^/]) $IRONIC_TFTPBOOT_DIR/\1" >$IRONIC_TFTPBOOT_DIR/map-file + echo "r ^(/tftpboot/) $IRONIC_TFTPBOOT_DIR/\2" >>$IRONIC_TFTPBOOT_DIR/map-file + + chmod -R 0755 $IRONIC_TFTPBOOT_DIR + restart_service xinetd +} + +function configure_ironic_ssh_keypair { + # Generating ssh key pair for stack user + if [[ ! -d $IRONIC_SSH_KEY_DIR ]]; then + mkdir -p $IRONIC_SSH_KEY_DIR + fi + if [[ ! -d $HOME/.ssh ]]; then + mkdir -p $HOME/.ssh + chmod 700 $HOME/.ssh + fi + echo -e 'n\n' | ssh-keygen -q -t rsa -P '' -f $IRONIC_KEY_FILE + cat $IRONIC_KEY_FILE.pub | tee -a $IRONIC_AUTHORIZED_KEYS_FILE +} + +function ironic_ssh_check { + local KEY_FILE=$1 + local FLOATING_IP=$2 + local PORT=$3 + local DEFAULT_INSTANCE_USER=$4 + local ACTIVE_TIMEOUT=$5 + if ! timeout $ACTIVE_TIMEOUT sh -c "while ! ssh -p $PORT -o StrictHostKeyChecking=no -i $KEY_FILE ${DEFAULT_INSTANCE_USER}@$FLOATING_IP echo success; do sleep 1; done"; then + die $LINENO "server didn't become ssh-able!" + fi +} + +function configure_ironic_sshd { + # Ensure sshd server accepts connections from localhost only + + SSH_CONFIG=/etc/ssh/sshd_config + HOST_PORT=$IRONIC_VM_SSH_ADDRESS:$IRONIC_VM_SSH_PORT + if ! sudo grep ListenAddress $SSH_CONFIG | grep $HOST_PORT; then + echo "ListenAddress $HOST_PORT" | sudo tee -a $SSH_CONFIG + fi + + SSH_SERVICE_NAME=sshd + if is_ubuntu; then + SSH_SERVICE_NAME=ssh + fi + + restart_service $SSH_SERVICE_NAME + # to ensure ssh service is up and running + sleep 3 + ironic_ssh_check $IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME $IRONIC_VM_SSH_ADDRESS $IRONIC_VM_SSH_PORT $IRONIC_SSH_USERNAME 10 + +} + +function configure_ironic_auxiliary { + configure_ironic_dirs + configure_ironic_ssh_keypair + configure_ironic_sshd +} + +function prepare_baremetal_basic_ops { + + # install diskimage-builder + git_clone $BM_IMAGE_BUILD_REPO $BM_IMAGE_BUILD_DIR $BM_IMAGE_BUILD_BRANCH + + # make sure all needed service were enabled + for srv in nova glance key neutron; do + if ! is_service_enabled "$srv"; then + die $LINENO "$srv should be enabled for ironic tests" + fi + done + + SCREEN_NAME=${SCREEN_NAME:-stack} + SERVICE_DIR=${SERVICE_DIR:-${DEST}/status} + + # stop all nova services + stop_nova || true + + # remove any nova services failure status + find $SERVICE_DIR/$SCREEN_NAME -name 'n-*.failure' -exec rm -f '{}' \; + + # start them again + start_nova_api + start_nova + + TOKEN=$(keystone token-get | grep ' id ' | get_field 2) + die_if_not_set $LINENO TOKEN "Keystone fail to get token" + + echo_summary "Creating and uploading baremetal images for ironic" + + # build and upload separate deploy kernel & ramdisk + upload_baremetal_deploy $TOKEN + + create_bridge_and_vms + enroll_vms + configure_tftpd +} + +function cleanup_baremetal_basic_ops { + rm -f $IRONIC_VM_MACS_CSV_FILE + if [ -f $IRONIC_KEY_FILE ]; then + KEY=`cat $IRONIC_KEY_FILE.pub` + # remove public key from authorized_keys + grep -v "$KEY" $IRONIC_AUTHORIZED_KEYS_FILE > temp && mv temp $IRONIC_AUTHORIZED_KEYS_FILE + chmod 0600 $IRONIC_AUTHORIZED_KEYS_FILE + fi + sudo rm -rf $IRONIC_DATA_DIR $IRONIC_STATE_PATH + sudo su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/cleanup-nodes $IRONIC_VM_COUNT $IRONIC_VM_NETWORK_BRIDGE" + sudo rm -rf /etc/xinetd.d/tftp /etc/init/tftpd-hpa.override + restart_service xinetd +} -# Restore xtrace +# Restore xtrace + pipefail $XTRACE +$PIPEFAIL # Tell emacs to use shell-script-mode ## Local variables: diff --git a/lib/nova_plugins/hypervisor-ironic b/lib/nova_plugins/hypervisor-ironic new file mode 100644 index 0000000000..5af7c0b292 --- /dev/null +++ b/lib/nova_plugins/hypervisor-ironic @@ -0,0 +1,75 @@ +# lib/nova_plugins/hypervisor-ironic +# Configure the ironic hypervisor + +# Enable with: +# VIRT_DRIVER=ironic + +# Dependencies: +# ``functions`` file +# ``nova`` configuration + +# install_nova_hypervisor - install any external requirements +# configure_nova_hypervisor - make configuration changes, including those to other services +# start_nova_hypervisor - start any external services +# stop_nova_hypervisor - stop any external services +# cleanup_nova_hypervisor - remove transient data and cache + +# Save trace setting +MY_XTRACE=$(set +o | grep xtrace) +set +o xtrace + + +# Defaults +# -------- + +# Entry Points +# ------------ + +# clean_nova_hypervisor - Clean up an installation +function cleanup_nova_hypervisor { + # This function intentionally left blank + : +} + +# configure_nova_hypervisor - Set config files, create data dirs, etc +function configure_nova_hypervisor { + iniset $NOVA_CONF ironic sql_connection `database_connection_url nova_bm` + LIBVIRT_FIREWALL_DRIVER=${LIBVIRT_FIREWALL_DRIVER:-"nova.virt.firewall.NoopFirewallDriver"} + iniset $NOVA_CONF DEFAULT compute_driver ironic.nova.virt.ironic.IronicDriver + iniset $NOVA_CONF DEFAULT firewall_driver $LIBVIRT_FIREWALL_DRIVER + iniset $NOVA_CONF DEFAULT scheduler_host_manager ironic.nova.scheduler.ironic_host_manager.IronicHostManager + iniset $NOVA_CONF DEFAULT ram_allocation_ratio 1.0 + iniset $NOVA_CONF DEFAULT reserved_host_memory_mb 0 + # ironic section + iniset $NOVA_CONF ironic admin_username admin + iniset $NOVA_CONF ironic admin_password $ADMIN_PASSWORD + iniset $NOVA_CONF ironic admin_url $KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v2.0 + iniset $NOVA_CONF ironic admin_tenant_name demo + iniset $NOVA_CONF ironic api_endpoint http://$SERVICE_HOST:6358/v1 +} + +# install_nova_hypervisor() - Install external components +function install_nova_hypervisor { + # This function intentionally left blank + : +} + +# start_nova_hypervisor - Start any required external services +function start_nova_hypervisor { + # This function intentionally left blank + : +} + +# stop_nova_hypervisor - Stop any external services +function stop_nova_hypervisor { + # This function intentionally left blank + : +} + + +# Restore xtrace +$MY_XTRACE + +# Local variables: +# mode: shell-script +# End: diff --git a/stackrc b/stackrc index 456637854b..4a997bf77c 100644 --- a/stackrc +++ b/stackrc @@ -267,7 +267,7 @@ DEFAULT_VIRT_DRIVER=libvirt is_package_installed xenserver-core && DEFAULT_VIRT_DRIVER=xenserver VIRT_DRIVER=${VIRT_DRIVER:-$DEFAULT_VIRT_DRIVER} case "$VIRT_DRIVER" in - libvirt) + ironic|libvirt) LIBVIRT_TYPE=${LIBVIRT_TYPE:-kvm} if [[ "$os_VENDOR" =~ (Debian) ]]; then LIBVIRT_GROUP=libvirt diff --git a/tools/install_prereqs.sh b/tools/install_prereqs.sh index 0c65fd9b00..9651083cb3 100755 --- a/tools/install_prereqs.sh +++ b/tools/install_prereqs.sh @@ -55,7 +55,13 @@ export_proxy_variables # ================ # Install package requirements -install_package $(get_packages general $ENABLED_SERVICES) +PACKAGES=$(get_packages general $ENABLED_SERVICES) +if is_ubuntu && echo $PACKAGES | grep -q dkms ; then + # ensure headers for the running kernel are installed for any DKMS builds + PACKAGES="$PACKAGES linux-headers-$(uname -r)" +fi + +install_package $PACKAGES if [[ -n "$SYSLOG" && "$SYSLOG" != "False" ]]; then if is_ubuntu || is_fedora; then diff --git a/tools/ironic/scripts/cleanup-nodes b/tools/ironic/scripts/cleanup-nodes new file mode 100755 index 0000000000..dc5a19d1cd --- /dev/null +++ b/tools/ironic/scripts/cleanup-nodes @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# **cleanup-nodes** + +# Cleans up baremetal poseur nodes and volumes created during ironic setup +# Assumes calling user has proper libvirt group membership and access. + +set -exu + +LIBVIRT_STORAGE_POOL=${LIBVIRT_STORAGE_POOL:-"default"} + +VM_COUNT=$1 +NETWORK_BRIDGE=$2 + +for (( idx=0; idx<$VM_COUNT; idx++ )); do + NAME="baremetal${NETWORK_BRIDGE}_${idx}" + VOL_NAME="baremetal${NETWORK_BRIDGE}-${idx}.qcow2" + virsh list | grep -q $NAME && virsh destroy $NAME + virsh list --inactive | grep -q $NAME && virsh undefine $NAME + + if virsh pool-list | grep -q $LIBVIRT_STORAGE_POOL ; then + virsh vol-list $LIBVIRT_STORAGE_POOL | grep -q $VOL_NAME && + virsh vol-delete $VOL_NAME --pool $LIBVIRT_STORAGE_POOL + fi +done diff --git a/tools/ironic/scripts/configure-vm b/tools/ironic/scripts/configure-vm new file mode 100755 index 0000000000..9936b76c4f --- /dev/null +++ b/tools/ironic/scripts/configure-vm @@ -0,0 +1,78 @@ +#!/usr/bin/env python + +import argparse +import os.path + +import libvirt + +templatedir = os.path.join(os.path.dirname(os.path.dirname(__file__)), + 'templates') + + +def main(): + parser = argparse.ArgumentParser( + description="Configure a kvm virtual machine for the seed image.") + parser.add_argument('--name', default='seed', + help='the name to give the machine in libvirt.') + parser.add_argument('--image', + help='Use a custom image file (must be qcow2).') + parser.add_argument('--engine', default='qemu', + help='The virtualization engine to use') + parser.add_argument('--arch', default='i686', + help='The architecture to use') + parser.add_argument('--memory', default='2097152', + help="Maximum memory for the VM in KB.") + parser.add_argument('--cpus', default='1', + help="CPU count for the VM.") + parser.add_argument('--bootdev', default='hd', + help="What boot device to use (hd/network).") + parser.add_argument('--network', default="brbm", + help='The libvirt network name to use') + parser.add_argument('--libvirt-nic-driver', default='e1000', + help='The libvirt network driver to use') + parser.add_argument('--emulator', default=None, + help='Path to emulator bin for vm template') + args = parser.parse_args() + with file(templatedir + '/vm.xml', 'rb') as f: + source_template = f.read() + params = { + 'name': args.name, + 'imagefile': args.image, + 'engine': args.engine, + 'arch': args.arch, + 'memory': args.memory, + 'cpus': args.cpus, + 'bootdev': args.bootdev, + 'network': args.network, + 'emulator': args.emulator, + } + + if args.emulator: + params['emulator'] = args.emulator + else: + if os.path.exists("/usr/bin/kvm"): # Debian + params['emulator'] = "/usr/bin/kvm" + elif os.path.exists("/usr/bin/qemu-kvm"): # Redhat + params['emulator'] = "/usr/bin/qemu-kvm" + + nicparams = { + 'nicdriver': args.libvirt_nic_driver, + 'network': args.network, + } + + params['bm_network'] = """ + + + + + +
+""" % nicparams + + libvirt_template = source_template % params + conn = libvirt.open("qemu:///system") + a = conn.defineXML(libvirt_template) + print ("Created machine %s with UUID %s" % (args.name, a.UUIDString())) + +if __name__ == '__main__': + main() diff --git a/tools/ironic/scripts/create-nodes b/tools/ironic/scripts/create-nodes new file mode 100755 index 0000000000..3232b50776 --- /dev/null +++ b/tools/ironic/scripts/create-nodes @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +# **create-nodes** + +# Creates baremetal poseur nodes for ironic testing purposes + +set -exu + +# Keep track of the devstack directory +TOP_DIR=$(cd $(dirname "$0")/.. && pwd) + +CPU=$1 +MEM=$(( 1024 * $2 )) +# extra G to allow fuzz for partition table : flavor size and registered size +# need to be different to actual size. +DISK=$(( $3 + 1)) + +case $4 in + i386) ARCH='i686' ;; + amd64) ARCH='x86_64' ;; + *) echo "Unsupported arch $4!" ; exit 1 ;; +esac + +TOTAL=$(($5 - 1)) +BRIDGE=$6 +EMULATOR=$7 + +LIBVIRT_NIC_DRIVER=${LIBVIRT_NIC_DRIVER:-"e1000"} +LIBVIRT_STORAGE_POOL=${LIBVIRT_STORAGE_POOL:-"default"} + +if ! virsh pool-list --all | grep -q $LIBVIRT_STORAGE_POOL; then + virsh pool-define-as --name $LIBVIRT_STORAGE_POOL dir --target /var/lib/libvirt/images >&2 + virsh pool-autostart $LIBVIRT_STORAGE_POOL >&2 + virsh pool-start $LIBVIRT_STORAGE_POOL >&2 +fi + +pool_state=$(virsh pool-info $LIBVIRT_STORAGE_POOL | grep State | awk '{ print $2 }') +if [ "$pool_state" != "running" ] ; then + [ ! -d /var/lib/libvirt/images ] && sudo mkdir /var/lib/libvirt/images + virsh pool-start $LIBVIRT_STORAGE_POOL >&2 +fi + +PREALLOC= +if [ -f /etc/debian_version ]; then + PREALLOC="--prealloc-metadata" +fi + +DOMS="" +for idx in $(seq 0 $TOTAL) ; do + NAME="baremetal${BRIDGE}_${idx}" + DOMS="$DOMS $NAME" + VOL_NAME="baremetal${BRIDGE}-${idx}.qcow2" + (virsh list --all | grep -q $NAME) && continue + + virsh vol-list --pool $LIBVIRT_STORAGE_POOL | grep -q $VOL_NAME && + virsh vol-delete $VOL_NAME --pool $LIBVIRT_STORAGE_POOL >&2 + virsh vol-create-as $LIBVIRT_STORAGE_POOL ${VOL_NAME} ${DISK}G --format qcow2 $PREALLOC >&2 + volume_path=$(virsh vol-path --pool $LIBVIRT_STORAGE_POOL $VOL_NAME) + # Pre-touch the VM to set +C, as it can only be set on empty files. + sudo touch "$volume_path" + sudo chattr +C "$volume_path" || true + $TOP_DIR/scripts/configure-vm --bootdev network --name $NAME --image "$volume_path" --arch $ARCH --cpus $CPU --memory $MEM --libvirt-nic-driver $LIBVIRT_NIC_DRIVER --emulator $EMULATOR --network $BRIDGE >&2 +done + +for dom in $DOMS ; do + # echo mac + virsh dumpxml $dom | grep "mac address" | head -1 | cut -d\' -f2 +done diff --git a/tools/ironic/scripts/setup-network b/tools/ironic/scripts/setup-network new file mode 100755 index 0000000000..8c3ea901b4 --- /dev/null +++ b/tools/ironic/scripts/setup-network @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# **setup-network** + +# Setups openvswitch libvirt network suitable for +# running baremetal poseur nodes for ironic testing purposes + +set -exu + +# Keep track of the devstack directory +TOP_DIR=$(cd $(dirname "$0")/.. && pwd) +BRIDGE_SUFFIX=${1:-''} +BRIDGE_NAME=brbm$BRIDGE_SUFFIX + +# Only add bridge if missing +(sudo ovs-vsctl list-br | grep ${BRIDGE_NAME}$) || sudo ovs-vsctl add-br ${BRIDGE_NAME} + +# remove bridge before replacing it. +(virsh net-list | grep "${BRIDGE_NAME} ") && virsh net-destroy ${BRIDGE_NAME} +(virsh net-list --inactive | grep "${BRIDGE_NAME} ") && virsh net-undefine ${BRIDGE_NAME} + +virsh net-define <(sed s/brbm/$BRIDGE_NAME/ $TOP_DIR/templates/brbm.xml) +virsh net-autostart ${BRIDGE_NAME} +virsh net-start ${BRIDGE_NAME} diff --git a/tools/ironic/templates/brbm.xml b/tools/ironic/templates/brbm.xml new file mode 100644 index 0000000000..0769d3f1d0 --- /dev/null +++ b/tools/ironic/templates/brbm.xml @@ -0,0 +1,6 @@ + + brbm + + + + diff --git a/tools/ironic/templates/tftpd-xinetd.template b/tools/ironic/templates/tftpd-xinetd.template new file mode 100644 index 0000000000..7b9b0f8a78 --- /dev/null +++ b/tools/ironic/templates/tftpd-xinetd.template @@ -0,0 +1,11 @@ +service tftp +{ + protocol = udp + port = 69 + socket_type = dgram + wait = yes + user = root + server = /usr/sbin/in.tftpd + server_args = -v -v -v -v -v --map-file %TFTPBOOT_DIR%/map-file %TFTPBOOT_DIR% + disable = no +} diff --git a/tools/ironic/templates/vm.xml b/tools/ironic/templates/vm.xml new file mode 100644 index 0000000000..b18dec055f --- /dev/null +++ b/tools/ironic/templates/vm.xml @@ -0,0 +1,43 @@ + + %(name)s + %(memory)s + %(cpus)s + + hvm + + + + + + + + + + destroy + restart + restart + + %(emulator)s + + + + +
+ + +
+ + %(network)s + %(bm_network)s + + +