Merge "Only run chmod/chown for local files"
diff --git a/clean.sh b/clean.sh
index a443ac8..6ceb5a4 100755
--- a/clean.sh
+++ b/clean.sh
@@ -33,6 +33,7 @@
 source $TOP_DIR/lib/database
 source $TOP_DIR/lib/rpc_backend
 
+source $TOP_DIR/lib/oslo
 source $TOP_DIR/lib/tls
 source $TOP_DIR/lib/horizon
 source $TOP_DIR/lib/keystone
diff --git a/exercises/trove.sh b/exercises/trove.sh
new file mode 100755
index 0000000..d48d5fe
--- /dev/null
+++ b/exercises/trove.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+
+# **trove.sh**
+
+# Sanity check that trove started if enabled
+
+echo "*********************************************************************"
+echo "Begin DevStack Exercise: $0"
+echo "*********************************************************************"
+
+# This script exits on an error so that errors don't compound and you see
+# only the first error that occurred.
+set -o errexit
+
+# Print the commands being run so that we can see the command that triggers
+# an error.  It is also useful for following allowing as the install occurs.
+set -o xtrace
+
+
+# Settings
+# ========
+
+# Keep track of the current directory
+EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
+TOP_DIR=$(cd $EXERCISE_DIR/..; pwd)
+
+# Import common functions
+source $TOP_DIR/functions
+
+# Import configuration
+source $TOP_DIR/openrc
+
+# Import exercise configuration
+source $TOP_DIR/exerciserc
+
+is_service_enabled trove || exit 55
+
+# can we get a list versions
+curl http://$SERVICE_HOST:8779/ 2>/dev/null | grep -q 'versions' || die $LINENO "Trove API not functioning!"
+
+set +o xtrace
+echo "*********************************************************************"
+echo "SUCCESS: End DevStack Exercise: $0"
+echo "*********************************************************************"
+
diff --git a/files/apts/trove b/files/apts/trove
new file mode 100644
index 0000000..09dcee8
--- /dev/null
+++ b/files/apts/trove
@@ -0,0 +1 @@
+libxslt1-dev   # testonly
diff --git a/files/rpms-suse/trove b/files/rpms-suse/trove
new file mode 100644
index 0000000..09dcee8
--- /dev/null
+++ b/files/rpms-suse/trove
@@ -0,0 +1 @@
+libxslt1-dev   # testonly
diff --git a/files/rpms/trove b/files/rpms/trove
new file mode 100644
index 0000000..09dcee8
--- /dev/null
+++ b/files/rpms/trove
@@ -0,0 +1 @@
+libxslt1-dev   # testonly
diff --git a/functions b/functions
index 0634fac..e1a5f4b 100644
--- a/functions
+++ b/functions
@@ -779,6 +779,7 @@
 #   **glance** returns true if any service enabled start with **g-**
 #   **neutron** returns true if any service enabled start with **q-**
 #   **swift** returns true if any service enabled start with **s-**
+#   **trove** returns true if any service enabled start with **tr-**
 #   For backward compatibility if we have **swift** in ENABLED_SERVICES all the
 #   **s-** services will be enabled. This will be deprecated in the future.
 #
@@ -798,6 +799,7 @@
         [[ ${service} == "ceilometer" && ${ENABLED_SERVICES} =~ "ceilometer-" ]] && return 0
         [[ ${service} == "glance" && ${ENABLED_SERVICES} =~ "g-" ]] && return 0
         [[ ${service} == "neutron" && ${ENABLED_SERVICES} =~ "q-" ]] && return 0
+        [[ ${service} == "trove" && ${ENABLED_SERVICES} =~ "tr-" ]] && return 0
         [[ ${service} == "swift" && ${ENABLED_SERVICES} =~ "s-" ]] && return 0
         [[ ${service} == s-* && ${ENABLED_SERVICES} =~ "swift" ]] && return 0
     done
@@ -1296,7 +1298,25 @@
     if [[ "$image_url" =~ '.vmdk' ]]; then
         IMAGE="$FILES/${IMAGE_FNAME}"
         IMAGE_NAME="${IMAGE_FNAME%.vmdk}"
-        glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME" --is-public=True --container-format bare --disk-format vmdk --property vmware-disktype="preallocated" < "${IMAGE}"
+
+        # Before we can upload vmdk type images to glance, we need to know it's
+        # disk type, storage adapter, and networking adapter. These values are
+        # passed to glance as custom properties. We take these values from the
+        # vmdk filename, which is expected in the following format:
+        #
+        #     <name>-<disk type>:<storage adapter>:<network adapter>
+        #
+        # If the filename does not follow the above format then the vsphere
+        # driver will supply default values.
+        property_string=`echo "$IMAGE_NAME" | grep -oP '(?<=-)(?!.*-).+:.+:.+$'`
+        if [[ ! -z "$property_string" ]]; then
+            IFS=':' read -a props <<< "$property_string"
+            vmdk_disktype="${props[0]}"
+            vmdk_adapter_type="${props[1]}"
+            vmdk_net_adapter="${props[2]}"
+        fi
+
+        glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME" --is-public=True --container-format bare --disk-format vmdk --property vmware-disktype="$vmdk_disktype" --property vmware_adaptertype="$vmdk_adapter_type" --property hw_vif_model="$vmdk_net_adapter" < "${IMAGE}"
         return
     fi
 
diff --git a/lib/baremetal b/lib/baremetal
index 8f6c3f1..52af420 100644
--- a/lib/baremetal
+++ b/lib/baremetal
@@ -215,7 +215,16 @@
     # ensure /tftpboot is prepared
     sudo mkdir -p /tftpboot
     sudo mkdir -p /tftpboot/pxelinux.cfg
-    sudo cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
+
+    PXEBIN=/usr/share/syslinux/pxelinux.0
+    if [ ! -f $PXEBIN ]; then
+        PXEBIN=/usr/lib/syslinux/pxelinux.0
+        if [ ! -f $PXEBIN ]; then
+            die $LINENO "pxelinux.0 (from SYSLINUX) not found."
+        fi
+    fi
+
+    sudo cp $PXEBIN /tftpboot/
     sudo chown -R $STACK_USER:$LIBVIRT_GROUP /tftpboot
 
     # ensure $NOVA_STATE_PATH/baremetal is prepared
@@ -291,7 +300,7 @@
     out=$($BM_IMAGE_BUILD_DIR/bin/disk-image-get-kernel \
             -x -d $TOP_DIR/files -o bm-deploy -i $file)
     if [ $? -ne 0 ]; then
-        die "Failed to get kernel and ramdisk from $file"
+        die $LINENO "Failed to get kernel and ramdisk from $file"
     fi
     XTRACE=$(set +o | grep xtrace)
     set +o xtrace
@@ -439,9 +448,9 @@
        "$BM_FLAVOR_ROOT_DISK" \
        "$mac_1" \
        | grep ' id ' | get_field 2 )
-    [ $? -eq 0 ] || [ "$id" ] || die "Error adding baremetal node"
+    [ $? -eq 0 ] || [ "$id" ] || die $LINENO "Error adding baremetal node"
     id2=$(nova baremetal-interface-add "$id" "$mac_2" )
-    [ $? -eq 0 ] || [ "$id2" ] || die "Error adding interface to barmetal node $id"
+    [ $? -eq 0 ] || [ "$id2" ] || die $LINENO "Error adding interface to barmetal node $id"
 }
 
 
diff --git a/lib/ceilometer b/lib/ceilometer
index 8768122..2afbc88 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -5,7 +5,7 @@
 #   enable_service ceilometer-acompute ceilometer-acentral ceilometer-collector ceilometer-api
 #
 # To ensure Ceilometer alarming services are enabled also, further add to the localrc:
-#   enable_service ceilometer-alarm-notify ceilometer-alarm-eval
+#   enable_service ceilometer-alarm-notifier ceilometer-alarm-singleton
 
 # Dependencies:
 # - functions
@@ -43,7 +43,7 @@
 CEILOMETER_BIN_DIR=$(get_python_exec_prefix)
 
 # Set up database backend
-CEILOMETER_BACKEND=${CEILOMETER_BACKEND:-mongodb}
+CEILOMETER_BACKEND=${CEILOMETER_BACKEND:-mysql}
 
 # Functions
 # ---------
@@ -138,14 +138,14 @@
     screen_it ceilometer-acentral "ceilometer-agent-central --config-file $CEILOMETER_CONF"
     screen_it ceilometer-collector "ceilometer-collector --config-file $CEILOMETER_CONF"
     screen_it ceilometer-api "ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF"
-    screen_it ceilometer-alarm-notify "ceilometer-alarm-notifier --config-file $CEILOMETER_CONF"
-    screen_it ceilometer-alarm-eval "ceilometer-alarm-singleton --config-file $CEILOMETER_CONF"
+    screen_it ceilometer-alarm-notifier "ceilometer-alarm-notifier --config-file $CEILOMETER_CONF"
+    screen_it ceilometer-alarm-singleton "ceilometer-alarm-singleton --config-file $CEILOMETER_CONF"
 }
 
 # stop_ceilometer() - Stop running processes
 function stop_ceilometer() {
     # Kill the ceilometer screen windows
-    for serv in ceilometer-acompute ceilometer-acentral ceilometer-collector ceilometer-api ceilometer-alarm-notify ceilometer-alarm-eval; do
+    for serv in ceilometer-acompute ceilometer-acentral ceilometer-collector ceilometer-api ceilometer-alarm-notifier ceilometer-alarm-singleton; do
         screen -S $SCREEN_NAME -p $serv -X kill
     done
 }
diff --git a/lib/cinder b/lib/cinder
index 324db9d..7f1544b 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -293,7 +293,6 @@
         iniset $CINDER_CONF DEFAULT vmware_host_ip "$VMWAREAPI_IP"
         iniset $CINDER_CONF DEFAULT vmware_host_username "$VMWAREAPI_USER"
         iniset $CINDER_CONF DEFAULT vmware_host_password "$VMWAREAPI_PASSWORD"
-        iniset $CINDER_CONF DEFAULT vmware_cluster_name "$VMWAREAPI_CLUSTER"
         iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver"
     fi
 
diff --git a/lib/heat b/lib/heat
index 67509bc..afa0eeb 100644
--- a/lib/heat
+++ b/lib/heat
@@ -100,7 +100,7 @@
     iniset $HEAT_CONF keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME
     iniset $HEAT_CONF keystone_authtoken admin_user heat
     iniset $HEAT_CONF keystone_authtoken admin_password $SERVICE_PASSWORD
-    iniset $HEAT_CONF keystone_authtoken signing_dir $HEAT_AUTH_CACHE_DIR/api-cfn
+    iniset $HEAT_CONF keystone_authtoken signing_dir $HEAT_AUTH_CACHE_DIR
 
     # ec2authtoken
     iniset $HEAT_CONF ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0
@@ -121,6 +121,9 @@
     iniset $HEAT_CONF heat_api_cloudwatch bind_host $HEAT_API_CW_HOST
     iniset $HEAT_CONF heat_api_cloudwatch bind_port $HEAT_API_CW_PORT
 
+    # Set limits to match tempest defaults
+    iniset $HEAT_CONF DEFAULT max_template_size 10240
+
     # heat environment
     sudo mkdir -p $HEAT_ENV_DIR
     sudo chown $STACK_USER $HEAT_ENV_DIR
@@ -148,12 +151,8 @@
 # create_heat_cache_dir() - Part of the init_heat() process
 function create_heat_cache_dir() {
     # Create cache dirs
-    sudo mkdir -p $HEAT_AUTH_CACHE_DIR/api
-    sudo chown $STACK_USER $HEAT_AUTH_CACHE_DIR/api
-    sudo mkdir -p $HEAT_AUTH_CACHE_DIR/api-cfn
-    sudo chown $STACK_USER $HEAT_AUTH_CACHE_DIR/api-cfn
-    sudo mkdir -p $HEAT_AUTH_CACHE_DIR/api-cloudwatch
-    sudo chown $STACK_USER $HEAT_AUTH_CACHE_DIR/api-cloudwatch
+    sudo mkdir -p $HEAT_AUTH_CACHE_DIR
+    sudo chown $STACK_USER $HEAT_AUTH_CACHE_DIR
 }
 
 # install_heatclient() - Collect source and prepare
diff --git a/lib/horizon b/lib/horizon
index f6bb9f5..e55bc15 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -101,6 +101,11 @@
         _horizon_config_set $local_settings OPENSTACK_NEUTRON_NETWORK enable_firewall True
     fi
 
+    # enable VPN dashboard in case service is enabled
+    if is_service_enabled q-vpn; then
+        _horizon_config_set $local_settings OPENSTACK_NEUTRON_NETWORK enable_vpn True
+    fi
+
     # Initialize the horizon database (it stores sessions and notices shown to
     # users).  The user system is external (keystone).
     cd $HORIZON_DIR
diff --git a/lib/neutron b/lib/neutron
index dc3c622..5664ff2 100644
--- a/lib/neutron
+++ b/lib/neutron
@@ -327,6 +327,9 @@
     # Since neutron command is executed in admin context at this point,
     # ``--tenant_id`` needs to be specified.
     if is_baremetal; then
+        if [[ "$PUBLIC_INTERFACE" == '' || "$OVS_PHYSICAL_BRIDGE" == '' ]]; then
+            die $LINENO "Neutron settings for baremetal not set.. exiting"
+        fi
         sudo ovs-vsctl add-port $OVS_PHYSICAL_BRIDGE $PUBLIC_INTERFACE
         for IP in $(ip addr show dev $PUBLIC_INTERFACE | grep ' inet ' | awk '{print $2}'); do
             sudo ip addr del $IP dev $PUBLIC_INTERFACE
@@ -335,6 +338,7 @@
         NET_ID=$(neutron net-create $PHYSICAL_NETWORK --tenant_id $TENANT_ID --provider:network_type flat --provider:physical_network "$PHYSICAL_NETWORK" | grep ' id ' | get_field 2)
         SUBNET_ID=$(neutron subnet-create --tenant_id $TENANT_ID --ip_version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} --gateway $NETWORK_GATEWAY --name $PRIVATE_SUBNET_NAME $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
         sudo ifconfig $OVS_PHYSICAL_BRIDGE up
+        sudo route add default gw $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE
     else
         NET_ID=$(neutron net-create --tenant_id $TENANT_ID "$PRIVATE_NETWORK_NAME" | grep ' id ' | get_field 2)
         SUBNET_ID=$(neutron subnet-create --tenant_id $TENANT_ID --ip_version 4 --gateway $NETWORK_GATEWAY --name $PRIVATE_SUBNET_NAME $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
@@ -493,7 +497,7 @@
     #    ``Q_PLUGIN_EXTRA_CONF_FILES=(file1, file2)``
     neutron_plugin_configure_common
 
-    if [[ $Q_PLUGIN_CONF_PATH == '' || $Q_PLUGIN_CONF_FILENAME == '' || $Q_PLUGIN_CLASS == '' ]]; then
+    if [[ "$Q_PLUGIN_CONF_PATH" == '' || "$Q_PLUGIN_CONF_FILENAME" == '' || "$Q_PLUGIN_CLASS" == '' ]]; then
         die $LINENO "Neutron plugin not set.. exiting"
     fi
 
diff --git a/lib/neutron_plugins/midonet b/lib/neutron_plugins/midonet
index 4d343f5..0ad760b 100644
--- a/lib/neutron_plugins/midonet
+++ b/lib/neutron_plugins/midonet
@@ -31,7 +31,12 @@
 }
 
 function neutron_plugin_configure_dhcp_agent() {
-   die $LINENO "q-dhcp must not be executed with MidoNet plugin!"
+    DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
+    DHCP_INTERFACE_DRIVER=${DHCP_INTEFACE_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.MidonetInterfaceDriver"}
+    iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
+    iniset $Q_DHCP_CONF_FILE DEFAULT interface_driver $DHCP_INTERFACE_DRIVER
+    iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces True
+    iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
 }
 
 function neutron_plugin_configure_l3_agent() {
@@ -58,9 +63,6 @@
     if [[ "$MIDONET_PROVIDER_ROUTER_ID" != "" ]]; then
         iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $MIDONET_PROVIDER_ROUTER_ID
     fi
-    if [[ "$MIDONET_METADATA_ROUTER_ID" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE MIDONET metadata_router_id $MIDONET_METADATA_ROUTER_ID
-    fi
 }
 
 function neutron_plugin_setup_interface_driver() {
diff --git a/lib/neutron_plugins/ml2 b/lib/neutron_plugins/ml2
index 00bd716..71a0638 100644
--- a/lib/neutron_plugins/ml2
+++ b/lib/neutron_plugins/ml2
@@ -10,9 +10,9 @@
 Q_ML2_TENANT_NETWORK_TYPE=${Q_ML2_TENANT_NETWORK_TYPE:-}
 # This has to be set here since the agent will set this in the config file
 if [[ "$Q_ML2_TENANT_NETWORK_TYPE" != "" ]]; then
-    Q_AGENT_EXTRA_AGENT_OPTS=(tunnel_types=$Q_ML2_TENANT_NETWORK_TYPE)
+    Q_AGENT_EXTRA_AGENT_OPTS+=(tunnel_types=$Q_ML2_TENANT_NETWORK_TYPE)
 elif [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
-    Q_AGENT_EXTRA_AGENT_OPTS=(tunnel_types=gre)
+    Q_AGENT_EXTRA_AGENT_OPTS+=(tunnel_types=gre)
 fi
 
 # Default openvswitch L2 agent
@@ -20,7 +20,7 @@
 source $TOP_DIR/lib/neutron_plugins/${Q_AGENT}_agent
 
 # List of MechanismDrivers to load
-Q_ML2_PLUGIN_MECHANISM_DRIVERS=${Q_ML2_PLUGIN_MECHANISM_DRIVERS:-}
+Q_ML2_PLUGIN_MECHANISM_DRIVERS=${Q_ML2_PLUGIN_MECHANISM_DRIVERS:-openvswitch,linuxbridge}
 # List of Type Drivers to load
 Q_ML2_PLUGIN_TYPE_DRIVERS=${Q_ML2_PLUGIN_TYPE_DRIVERS:-local,flat,vlan,gre,vxlan}
 # Default GRE TypeDriver options
@@ -46,18 +46,27 @@
     Q_PLUGIN_CONF_FILENAME=ml2_conf.ini
     Q_DB_NAME="neutron_ml2"
     Q_PLUGIN_CLASS="neutron.plugins.ml2.plugin.Ml2Plugin"
+    # The ML2 plugin delegates L3 routing/NAT functionality to
+    # the L3 service plugin which must therefore be specified.
+    Q_L3_PLUGIN_CLASS=${Q_L3_PLUGIN_CLASS:-"neutron.services.l3_router.l3_router_plugin.L3RouterPlugin"}
+    if  ini_has_option $NEUTRON_CONF DEFAULT service_plugins ; then
+        srv_plugins=$(iniget $NEUTRON_CONF DEFAULT service_plugins)","$Q_L3_PLUGIN_CLASS
+    else
+        srv_plugins=$Q_L3_PLUGIN_CLASS
+    fi
+    iniset $NEUTRON_CONF DEFAULT service_plugins $srv_plugins
 }
 
 function neutron_plugin_configure_service() {
     if [[ "$Q_ML2_TENANT_NETWORK_TYPE" != "" ]]; then
-        Q_SRV_EXTRA_OPTS=(tenant_network_types=$Q_ML2_TENANT_NETWORK_TYPE)
+        Q_SRV_EXTRA_OPTS+=(tenant_network_types=$Q_ML2_TENANT_NETWORK_TYPE)
     elif [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
         # This assumes you want a simple configuration, and will overwrite
         # Q_SRV_EXTRA_OPTS if set in addition to ENABLE_TENANT_TUNNELS.
-        Q_SRV_EXTRA_OPTS=(tenant_network_types=gre)
+        Q_SRV_EXTRA_OPTS+=(tenant_network_types=gre)
         Q_ML2_PLUGIN_GRE_TYPE_OPTIONS=(tunnel_id_ranges=$TENANT_TUNNEL_RANGES)
     elif [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
-        Q_SRV_EXTRA_OPTS=(tenant_network_types=vlan)
+        Q_SRV_EXTRA_OPTS+=(tenant_network_types=vlan)
     else
         echo "WARNING - The ml2 plugin is using local tenant networks, with no connectivity between hosts."
     fi
diff --git a/lib/neutron_plugins/services/vpn b/lib/neutron_plugins/services/vpn
index 0a79a69..b8f5c7d 100644
--- a/lib/neutron_plugins/services/vpn
+++ b/lib/neutron_plugins/services/vpn
@@ -8,9 +8,10 @@
 
 AGENT_VPN_BINARY="$NEUTRON_BIN_DIR/neutron-vpn-agent"
 VPN_PLUGIN="neutron.services.vpn.plugin.VPNDriverPlugin"
+IPSEC_PACKAGE=${IPSEC_PACKAGE:-"openswan"}
 
 function neutron_vpn_install_agent_packages() {
-    install_package strongswan
+    install_package $IPSEC_PACKAGE
 }
 
 function neutron_vpn_configure_common() {
diff --git a/lib/neutron_thirdparty/midonet b/lib/neutron_thirdparty/midonet
index b3c726f..7928bca 100644
--- a/lib/neutron_thirdparty/midonet
+++ b/lib/neutron_thirdparty/midonet
@@ -10,22 +10,20 @@
 
 # MidoNet devstack destination dir
 MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
+MIDONET_API_PORT=${MIDONET_API_PORT:-8080}
+MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-api}
 
 # MidoNet client repo
 MIDONET_CLIENT_REPO=${MIDONET_CLIENT_REPO:-https://github.com/midokura/python-midonetclient.git}
 MIDONET_CLIENT_BRANCH=${MIDONET_CLIENT_BRANCH:-master}
-MIDONET_CLIENT_DIR=$MIDONET_DIR/python-midonetclient
+MIDONET_CLIENT_DIR=${MIDONET_CLIENT_DIR:-$MIDONET_DIR/python-midonetclient}
 
 # MidoNet OpenStack repo
 MIDONET_OS_REPO=${MIDONET_OS_REPO:-https://github.com/midokura/midonet-openstack.git}
 MIDONET_OS_BRANCH=${MIDONET_OS_BRANCH:-master}
-MIDONET_OS_DIR=$MIDONET_DIR/midonet-openstack
+MIDONET_OS_DIR=${MIDONET_OS_DIR:-$MIDONET_DIR/midonet-openstack}
 MIDONET_SETUP_SCRIPT=${MIDONET_SETUP_SCRIPT:-$MIDONET_OS_DIR/bin/setup_midonet_topology.py}
 
-
-MIDOLMAN_LOG=${MIDOLMAN_LOG:-/var/log/midolman/midolman.log}
-MIDONET_API_LOG=${MIDONET_API_LOG:-/var/log/tomcat7/midonet-api.log}
-
 # Save trace setting
 MY_XTRACE=$(set +o | grep xtrace)
 set +o xtrace
@@ -37,13 +35,11 @@
 function init_midonet() {
 
     # Initialize DB.  Evaluate the output of setup_midonet_topology.py to set
-    # env variables for provider router ID and metadata router ID
-    eval `python $MIDONET_SETUP_SCRIPT admin $ADMIN_PASSWORD $ADMIN_TENANT provider_devices`
+    # env variables for provider router ID.
+    eval `python $MIDONET_SETUP_SCRIPT $MIDONET_API_URL admin $ADMIN_PASSWORD admin provider_devices`
     die_if_not_set $LINENO provider_router_id "Error running midonet setup script, provider_router_id was not set."
-    die_if_not_set $LINENO metadata_router_id "Error running midonet setup script, metadata_router_id was not set."
 
     iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $provider_router_id
-    iniset /$Q_PLUGIN_CONF_FILE MIDONET metadata_router_id $metadata_router_id
 }
 
 function install_midonet() {
diff --git a/lib/nova b/lib/nova
index 19093ad..9b766a9 100644
--- a/lib/nova
+++ b/lib/nova
@@ -451,6 +451,9 @@
     iniset $NOVA_CONF DEFAULT s3_port "$S3_SERVICE_PORT"
     iniset $NOVA_CONF DEFAULT osapi_compute_extension "nova.api.openstack.compute.contrib.standard_extensions"
     iniset $NOVA_CONF DEFAULT my_ip "$HOST_IP"
+    iniset $NOVA_CONF DEFAULT osapi_compute_workers "4"
+    iniset $NOVA_CONF DEFAULT ec2_workers "4"
+    iniset $NOVA_CONF DEFAULT metadata_workers "4"
     iniset $NOVA_CONF DEFAULT sql_connection `database_connection_url nova`
     if is_baremetal; then
         iniset $NOVA_CONF baremetal sql_connection `database_connection_url nova_bm`
diff --git a/lib/tempest b/lib/tempest
index 50289b6..e48ccf2 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -286,6 +286,9 @@
     iniset $TEMPEST_CONF scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
 
     # Volume
+    if is_service_enabled c-bak; then
+        iniset $TEMPEST_CONF volume volume_backup_enabled "True"
+    fi
     CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND)
     if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then
         iniset $TEMPEST_CONF volume multi_backend_enabled "True"
diff --git a/lib/trove b/lib/trove
new file mode 100644
index 0000000..e64ca5f
--- /dev/null
+++ b/lib/trove
@@ -0,0 +1,170 @@
+# lib/trove
+# Functions to control the configuration and operation of the **Trove** service
+
+# Dependencies:
+# ``functions`` file
+# ``DEST``, ``STACK_USER`` must be defined
+# ``SERVICE_{HOST|PROTOCOL|TOKEN}`` must be defined
+
+# ``stack.sh`` calls the entry points in this order:
+#
+# install_trove
+# configure_trove
+# init_trove
+# start_trove
+# stop_trove
+# cleanup_trove
+
+# Save trace setting
+XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+# Defaults
+# --------
+
+NETWORK_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
+
+# Set up default configuration
+TROVE_DIR=$DEST/trove
+TROVECLIENT_DIR=$DEST/python-troveclient
+TROVE_CONF_DIR=/etc/trove
+TROVE_LOCAL_CONF_DIR=$TROVE_DIR/etc/trove
+TROVE_AUTH_ENDPOINT=$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT//v$IDENTITY_API_VERSION
+TROVE_AUTH_CACHE_DIR=${TROVE_AUTH_CACHE_DIR:-/var/cache/trove}
+TROVE_BIN_DIR=/usr/local/bin
+
+# create_trove_accounts() - Set up common required trove accounts
+
+# Tenant               User       Roles
+# ------------------------------------------------------------------
+# service              trove     admin        # if enabled
+
+create_trove_accounts() {
+    # Trove
+    SERVICE_TENANT=$(keystone tenant-list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
+    SERVICE_ROLE=$(keystone role-list | awk "/ admin / { print \$2 }")
+
+    if [[ "$ENABLED_SERVICES" =~ "trove" ]]; then
+        TROVE_USER=$(keystone user-create --name=trove \
+                                                  --pass="$SERVICE_PASSWORD" \
+                                                  --tenant_id $SERVICE_TENANT \
+                                                  --email=trove@example.com \
+                                                  | grep " id " | get_field 2)
+        keystone user-role-add --tenant-id $SERVICE_TENANT \
+                               --user-id $TROVE_USER \
+                               --role-id $SERVICE_ROLE
+        if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
+            TROVE_SERVICE=$(keystone service-create \
+                --name=trove \
+                --type=database \
+                --description="Trove Service" \
+                | grep " id " | get_field 2)
+            keystone endpoint-create \
+                --region RegionOne \
+                --service_id $TROVE_SERVICE \
+                --publicurl "http://$SERVICE_HOST:8779/v1.0/\$(tenant_id)s" \
+                --adminurl "http://$SERVICE_HOST:8779/v1.0/\$(tenant_id)s" \
+                --internalurl "http://$SERVICE_HOST:8779/v1.0/\$(tenant_id)s"
+        fi
+    fi
+}
+
+# stack.sh entry points
+# ---------------------
+
+# cleanup_trove() - Remove residual data files, anything left over from previous
+# runs that a clean run would need to clean up
+function cleanup_trove() {
+    #Clean up dirs
+    rm -fr $TROVE_AUTH_CACHE_DIR/*
+    rm -fr $TROVE_CONF_DIR/*
+}
+
+# configure_troveclient() - Set config files, create data dirs, etc
+function configure_troveclient() {
+    setup_develop $TROVECLIENT_DIR
+}
+
+# configure_trove() - Set config files, create data dirs, etc
+function configure_trove() {
+    setup_develop $TROVE_DIR
+
+    # Create the trove conf dir and cache dirs if they don't exist
+    sudo mkdir -p ${TROVE_CONF_DIR}
+    sudo mkdir -p ${TROVE_AUTH_CACHE_DIR}
+    sudo chown -R $STACK_USER: ${TROVE_CONF_DIR}
+    sudo chown -R $STACK_USER: ${TROVE_AUTH_CACHE_DIR}
+
+    # Copy api-paste file over to the trove conf dir and configure it
+    cp $TROVE_LOCAL_CONF_DIR/api-paste.ini $TROVE_CONF_DIR/api-paste.ini
+    TROVE_API_PASTE_INI=$TROVE_CONF_DIR/api-paste.ini
+    iniset $TROVE_API_PASTE_INI filter:tokenauth auth_host $KEYSTONE_AUTH_HOST
+    iniset $TROVE_API_PASTE_INI filter:tokenauth auth_port $KEYSTONE_AUTH_PORT
+    iniset $TROVE_API_PASTE_INI filter:tokenauth auth_protocol $KEYSTONE_AUTH_PROTOCOL
+    iniset $TROVE_API_PASTE_INI filter:tokenauth admin_tenant_name $SERVICE_TENANT_NAME
+    iniset $TROVE_API_PASTE_INI filter:tokenauth admin_user trove
+    iniset $TROVE_API_PASTE_INI filter:tokenauth admin_password $SERVICE_PASSWORD
+    iniset $TROVE_API_PASTE_INI filter:tokenauth signing_dir $TROVE_AUTH_CACHE_DIR
+
+    # (Re)create trove conf files
+    rm -f $TROVE_CONF_DIR/trove.conf
+    rm -f $TROVE_CONF_DIR/trove-taskmanager.conf
+    iniset $TROVE_CONF_DIR/trove.conf DEFAULT rabbit_password $RABBIT_PASSWORD
+    iniset $TROVE_CONF_DIR/trove.conf DEFAULT sql_connection `database_connection_url trove`
+    iniset $TROVE_CONF_DIR/trove.conf DEFAULT add_addresses True
+
+    iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT rabbit_password $RABBIT_PASSWORD
+    iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT sql_connection `database_connection_url trove`
+    sed -i "s/localhost/$NETWORK_GATEWAY/g" $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample
+
+    # (Re)create trove taskmanager conf file if needed
+    if is_service_enabled tr-tmgr; then
+        iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT rabbit_password $RABBIT_PASSWORD
+        iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT sql_connection `database_connection_url trove`
+        iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT taskmanager_manager trove.taskmanager.manager.Manager
+        iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT nova_proxy_admin_user radmin
+        iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT nova_proxy_admin_tenant_name trove
+        iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT nova_proxy_admin_pass $RADMIN_USER_PASS
+        iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT trove_auth_url $TROVE_AUTH_ENDPOINT
+    fi
+}
+
+# install_troveclient() - Collect source and prepare
+function install_troveclient() {
+    git_clone $TROVECLIENT_REPO $TROVECLIENT_DIR $TROVECLIENT_BRANCH
+}
+
+# install_trove() - Collect source and prepare
+function install_trove() {
+    git_clone $TROVE_REPO $TROVE_DIR $TROVE_BRANCH
+}
+
+# init_trove() - Initializes Trove Database as a Service
+function init_trove() {
+    #(Re)Create trove db
+    recreate_database trove utf8
+
+    #Initialize the trove database
+    $TROVE_DIR/bin/trove-manage db_sync
+}
+
+# start_trove() - Start running processes, including screen
+function start_trove() {
+    screen_it tr-api "cd $TROVE_DIR; bin/trove-api --config-file=$TROVE_CONF_DIR/trove.conf --debug 2>&1"
+    screen_it tr-tmgr "cd $TROVE_DIR; bin/trove-taskmanager --config-file=$TROVE_CONF_DIR/trove-taskmanager.conf --debug 2>&1"
+}
+
+# stop_trove() - Stop running processes
+function stop_trove() {
+    # Kill the trove screen windows
+    for serv in tr-api tr-tmgr; do
+        screen -S $SCREEN_NAME -p $serv -X kill
+    done
+}
+
+# Restore xtrace
+$XTRACE
+
+# Local variables:
+# mode: shell-script
+# End:
diff --git a/stack.sh b/stack.sh
index 975194b..71e7317 100755
--- a/stack.sh
+++ b/stack.sh
@@ -2,8 +2,8 @@
 
 # ``stack.sh`` is an opinionated OpenStack developer installation.  It
 # installs and configures various combinations of **Ceilometer**, **Cinder**,
-# **Glance**, **Heat**, **Horizon**, **Keystone**, **Nova**, **Neutron**
-# and **Swift**.
+# **Glance**, **Heat**, **Horizon**, **Keystone**, **Nova**, **Neutron**,
+# **Swift**, and **Trove**
 
 # This script allows you to specify configuration options of what git
 # repositories to use, enabled services, network configuration and various
@@ -319,6 +319,7 @@
 source $TOP_DIR/lib/baremetal
 source $TOP_DIR/lib/ldap
 source $TOP_DIR/lib/ironic
+source $TOP_DIR/lib/trove
 
 # Look for Nova hypervisor plugin
 NOVA_PLUGINS=$TOP_DIR/lib/nova_plugins
@@ -720,6 +721,12 @@
     configure_heat
 fi
 
+if is_service_enabled trove; then
+    install_trove
+    install_troveclient
+    cleanup_trove
+fi
+
 if is_service_enabled tls-proxy; then
     configure_CA
     init_CA
@@ -860,6 +867,10 @@
     create_cinder_accounts
     create_neutron_accounts
 
+    if is_service_enabled trove; then
+        create_trove_accounts
+    fi
+
     if is_service_enabled swift || is_service_enabled s-proxy; then
         create_swift_accounts
     fi
@@ -1236,6 +1247,18 @@
     start_heat
 fi
 
+# Configure and launch the trove service api, and taskmanager
+if is_service_enabled trove; then
+    # Initialize trove
+    echo_summary "Configuring Trove"
+    configure_troveclient
+    configure_trove
+    init_trove
+
+    # Start the trove API and trove taskmgr components
+    echo_summary "Starting Trove"
+    start_trove
+fi
 
 # Create account rc files
 # =======================
diff --git a/stackrc b/stackrc
index f9a977c..3a338d1 100644
--- a/stackrc
+++ b/stackrc
@@ -181,6 +181,13 @@
 SPICE_REPO=${SPICE_REPO:-http://anongit.freedesktop.org/git/spice/spice-html5.git}
 SPICE_BRANCH=${SPICE_BRANCH:-master}
 
+# trove service
+TROVE_REPO=${TROVE_REPO:-${GIT_BASE}/openstack/trove.git}
+TROVE_BRANCH=${TROVE_BRANCH:-master}
+
+# trove client library test
+TROVECLIENT_REPO=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}
+TROVECLIENT_BRANCH=${TROVECLIENT_BRANCH:-master}
 
 # Nova hypervisor configuration.  We default to libvirt with **kvm** but will
 # drop back to **qemu** if we are unable to load the kvm module.  ``stack.sh`` can
diff --git a/tools/install_pip.sh b/tools/install_pip.sh
index 6e3e9d2..fc1c195 100755
--- a/tools/install_pip.sh
+++ b/tools/install_pip.sh
@@ -2,13 +2,11 @@
 
 # **install_pip.sh**
 
-# install_pip.sh [--pip-version <version>] [--use-get-pip] [--setuptools] [--force]
+# install_pip.sh [--pip-version <version>] [--use-get-pip] [--force]
 #
 # Update pip and friends to a known common version
 
 # Assumptions:
-# - currently we try to leave the system setuptools alone, install
-#   the system package if it is not already present
 # - update pip to $INSTALL_PIP_VERSION
 
 # Keep track of the current directory
@@ -25,7 +23,7 @@
 
 # Handle arguments
 
-INSTALL_PIP_VERSION=${INSTALL_PIP_VERSION:-"1.4"}
+INSTALL_PIP_VERSION=${INSTALL_PIP_VERSION:-"1.4.1"}
 while [[ -n "$1" ]]; do
     case $1 in
         --force)
@@ -35,9 +33,6 @@
             INSTALL_PIP_VERSION="$2"
             shift
             ;;
-        --setuptools)
-            SETUPTOOLS=1
-            ;;
         --use-get-pip)
             USE_GET_PIP=1;
             ;;
@@ -45,7 +40,6 @@
     shift
 done
 
-SETUPTOOLS_EZ_SETUP_URL=https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
 PIP_GET_PIP_URL=https://raw.github.com/pypa/pip/master/contrib/get-pip.py
 PIP_TAR_URL=https://pypi.python.org/packages/source/p/pip/pip-$INSTALL_PIP_VERSION.tar.gz
 
@@ -55,21 +49,11 @@
 function get_versions() {
     PIP=$(which pip 2>/dev/null || which pip-python 2>/dev/null)
     if [[ -n $PIP ]]; then
-        DISTRIBUTE_VERSION=$($PIP freeze | grep 'distribute==')
-        SETUPTOOLS_VERSION=$($PIP freeze | grep 'setuptools==')
         PIP_VERSION=$($PIP --version | awk '{ print $2}')
-        echo "pip: $PIP_VERSION  setuptools: $SETUPTOOLS_VERSION  distribute: $DISTRIBUTE_VERSION"
+        echo "pip: $PIP_VERSION"
     fi
 }
 
-function setuptools_ez_setup() {
-    if [[ ! -r $FILES/ez_setup.py ]]; then
-        (cd $FILES; \
-         curl -OR $SETUPTOOLS_EZ_SETUP_URL; \
-        )
-    fi
-    sudo python $FILES/ez_setup.py
-}
 
 function install_get_pip() {
     if [[ ! -r $FILES/get-pip.py ]]; then
@@ -92,29 +76,15 @@
 # Show starting versions
 get_versions
 
-# Do setuptools
-if [[ -n "$SETUPTOOLS" ]]; then
-    # We want it from source
-    uninstall_package python-setuptools
-    setuptools_ez_setup
-else
-    # See about installing the distro setuptools
-    if ! python -c "import setuptools"; then
-        install_package python-setuptools
-    fi
-fi
-
 # Do pip
-if [[ -z $PIP || "$PIP_VERSION" != "$INSTALL_PIP_VERSION" || -n $FORCE ]]; then
 
-    # Eradicate any and all system packages
-    uninstall_package python-pip
+# Eradicate any and all system packages
+uninstall_package python-pip
 
-    if [[ -n "$USE_GET_PIP" ]]; then
-        install_get_pip
-    else
-        install_pip_tarball
-    fi
-
-    get_versions
+if [[ -n "$USE_GET_PIP" ]]; then
+    install_get_pip
+else
+    install_pip_tarball
 fi
+
+get_versions
diff --git a/unstack.sh b/unstack.sh
index 38f795b..05d9fb7 100755
--- a/unstack.sh
+++ b/unstack.sh
@@ -34,6 +34,7 @@
 source $TOP_DIR/lib/swift
 source $TOP_DIR/lib/neutron
 source $TOP_DIR/lib/ironic
+source $TOP_DIR/lib/trove
 
 # Determine what system we are running on.  This provides ``os_VENDOR``,
 # ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
@@ -130,4 +131,8 @@
     cleanup_neutron
 fi
 
+if is_service_enabled trove; then
+    cleanup_trove
+fi
+
 cleanup_tmp