Merge "ironic: remove notifier_strategy option"
diff --git a/clean.sh b/clean.sh
index e16bdb7..09f08dc 100755
--- a/clean.sh
+++ b/clean.sh
@@ -97,7 +97,7 @@
fi
# Do the hypervisor cleanup until this can be moved back into lib/nova
-if [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then
+if is_service_enabled nova && [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then
cleanup_nova_hypervisor
fi
diff --git a/exercises/boot_from_volume.sh b/exercises/boot_from_volume.sh
index ed8ba63..7912046 100755
--- a/exercises/boot_from_volume.sh
+++ b/exercises/boot_from_volume.sh
@@ -30,14 +30,12 @@
# Import common functions
source $TOP_DIR/functions
+# Import project functions
+source $TOP_DIR/lib/cinder
+
# Import configuration
source $TOP_DIR/openrc
-# Import neutron functions if needed
-if is_service_enabled neutron; then
- source $TOP_DIR/lib/neutron
-fi
-
# Import exercise configuration
source $TOP_DIR/exerciserc
diff --git a/exercises/euca.sh b/exercises/euca.sh
index 51b2644..ad852a4 100755
--- a/exercises/euca.sh
+++ b/exercises/euca.sh
@@ -33,11 +33,6 @@
# Import EC2 configuration
source $TOP_DIR/eucarc
-# Import neutron functions if needed
-if is_service_enabled neutron; then
- source $TOP_DIR/lib/neutron
-fi
-
# Import exercise configuration
source $TOP_DIR/exerciserc
diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh
index 4ca90a5..b981aa8 100755
--- a/exercises/floating_ips.sh
+++ b/exercises/floating_ips.sh
@@ -27,14 +27,12 @@
# Import common functions
source $TOP_DIR/functions
+# Import project functions
+source $TOP_DIR/lib/neutron
+
# Import configuration
source $TOP_DIR/openrc
-# Import neutron functions if needed
-if is_service_enabled neutron; then
- source $TOP_DIR/lib/neutron
-fi
-
# Import exercise configuration
source $TOP_DIR/exerciserc
diff --git a/exercises/neutron-adv-test.sh b/exercises/neutron-adv-test.sh
index 1343f11..a9199e6 100755
--- a/exercises/neutron-adv-test.sh
+++ b/exercises/neutron-adv-test.sh
@@ -1,6 +1,11 @@
#!/usr/bin/env bash
#
-
+# Copyright 2012, Cisco Systems
+# Copyright 2012, VMware, Inc.
+# Copyright 2012, NTT MCL, Inc.
+#
+# Please direct any questions to dedutta@cisco.com, dwendlandt@vmware.com, nachi@nttmcl.com
+#
# **neutron-adv-test.sh**
# Perform integration testing of Nova and other components with Neutron.
@@ -406,14 +411,6 @@
main() {
echo Description
- echo
- echo Copyright 2012, Cisco Systems
- echo Copyright 2012, VMware, Inc.
- echo Copyright 2012, NTT MCL, Inc.
- echo
- echo Please direct any questions to dedutta@cisco.com, dwendlandt@vmware.com, nachi@nttmcl.com
- echo
-
if [ $# -eq 0 ] ; then
# if no args are provided, run all tests
diff --git a/exercises/volumes.sh b/exercises/volumes.sh
index 21b5d21..33e2458 100755
--- a/exercises/volumes.sh
+++ b/exercises/volumes.sh
@@ -27,14 +27,12 @@
# Import common functions
source $TOP_DIR/functions
+# Import project functions
+source $TOP_DIR/lib/cinder
+
# Import configuration
source $TOP_DIR/openrc
-# Import neutron functions if needed
-if is_service_enabled neutron; then
- source $TOP_DIR/lib/neutron
-fi
-
# Import exercise configuration
source $TOP_DIR/exerciserc
diff --git a/extras.d/50-ironic.sh b/extras.d/50-ironic.sh
new file mode 100644
index 0000000..f68a146
--- /dev/null
+++ b/extras.d/50-ironic.sh
@@ -0,0 +1,33 @@
+# ironic.sh - Devstack extras script to install ironic
+
+if is_service_enabled ir-api ir-cond; then
+ if [[ "$1" == "source" ]]; then
+ # Initial source
+ source $TOP_DIR/lib/ironic
+ elif [[ "$1" == "stack" && "$2" == "install" ]]; then
+ echo_summary "Installing Ironic"
+ install_ironic
+ install_ironicclient
+ cleanup_ironic
+ elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
+ echo_summary "Configuring Ironic"
+ configure_ironic
+
+ if is_service_enabled key; then
+ create_ironic_accounts
+ fi
+
+ elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
+ # Initialize ironic
+ init_ironic
+
+ # Start the ironic API and ironic taskmgr components
+ echo_summary "Starting Ironic"
+ start_ironic
+ fi
+
+ if [[ "$1" == "unstack" ]]; then
+ stop_ironic
+ cleanup_ironic
+ fi
+fi
diff --git a/extras.d/70-gantt.sh b/extras.d/70-gantt.sh
new file mode 100644
index 0000000..ac1efba
--- /dev/null
+++ b/extras.d/70-gantt.sh
@@ -0,0 +1,31 @@
+# gantt.sh - Devstack extras script to install Gantt
+
+if is_service_enabled n-sch; then
+ disable_service gantt
+fi
+
+if is_service_enabled gantt; then
+ if [[ "$1" == "source" ]]; then
+ # Initial source
+ source $TOP_DIR/lib/gantt
+ elif [[ "$1" == "stack" && "$2" == "install" ]]; then
+ echo_summary "Installing Gantt"
+ install_gantt
+ cleanup_gantt
+ elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
+ echo_summary "Configuring Gantt"
+ configure_gantt
+
+ elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
+ # Initialize gantt
+ init_gantt
+
+ # Start gantt
+ echo_summary "Starting Gantt"
+ start_gantt
+ fi
+
+ if [[ "$1" == "unstack" ]]; then
+ stop_gantt
+ fi
+fi
diff --git a/files/apts/dstat b/files/apts/dstat
new file mode 100644
index 0000000..2b643b8
--- /dev/null
+++ b/files/apts/dstat
@@ -0,0 +1 @@
+dstat
diff --git a/files/apts/n-cpu b/files/apts/n-cpu
index 29e3760..b287107 100644
--- a/files/apts/n-cpu
+++ b/files/apts/n-cpu
@@ -1,8 +1,8 @@
# Stuff for diablo volumes
-nbd-client
lvm2
open-iscsi
open-iscsi-utils # Deprecated since quantal dist:precise
genisoimage
sysfsutils
sg3-utils
+python-guestfs
diff --git a/files/keystone_data.sh b/files/keystone_data.sh
index d477c42..9a34c76 100755
--- a/files/keystone_data.sh
+++ b/files/keystone_data.sh
@@ -2,12 +2,14 @@
#
# Initial data for Keystone using python-keystoneclient
#
-# Tenant User Roles
+# Tenant User Roles
# ------------------------------------------------------------------
-# service glance admin
-# service heat service # if enabled
+# service glance service
+# service glance-swift ResellerAdmin
+# service heat service # if enabled
+# service ceilometer admin # if enabled
# Tempest Only:
-# alt_demo alt_demo Member
+# alt_demo alt_demo Member
#
# Variables set before calling this script:
# SERVICE_TOKEN - aka admin_token in keystone.conf
@@ -96,7 +98,19 @@
keystone user-role-add \
--tenant $SERVICE_TENANT_NAME \
--user glance \
- --role admin
+ --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 \
diff --git a/files/ldap/manager.ldif.in b/files/ldap/manager.ldif.in
index de3b69d..2f1f139 100644
--- a/files/ldap/manager.ldif.in
+++ b/files/ldap/manager.ldif.in
@@ -12,4 +12,4 @@
replace: olcDbIndex
olcDbIndex: objectClass eq
olcDbIndex: default pres,eq
-olcDbIndex: cn,sn,givenName,co
+olcDbIndex: cn,sn,givenName
diff --git a/files/rpms-suse/dstat b/files/rpms-suse/dstat
new file mode 100644
index 0000000..2b643b8
--- /dev/null
+++ b/files/rpms-suse/dstat
@@ -0,0 +1 @@
+dstat
diff --git a/files/rpms/dstat b/files/rpms/dstat
new file mode 100644
index 0000000..8a8f8fe
--- /dev/null
+++ b/files/rpms/dstat
@@ -0,0 +1 @@
+dstat
\ No newline at end of file
diff --git a/functions b/functions
index 73d65ce..dc3278b 100644
--- a/functions
+++ b/functions
@@ -840,6 +840,16 @@
services=$@
for service in ${services}; do
[[ ,${ENABLED_SERVICES}, =~ ,${service}, ]] && return 0
+
+ # Look for top-level 'enabled' function for this service
+ if type is_${service}_enabled >/dev/null 2>&1; then
+ # A function exists for this service, use it
+ is_${service}_enabled
+ return $?
+ fi
+
+ # TODO(dtroyer): Remove these legacy special-cases after the is_XXX_enabled()
+ # are implemented
[[ ${service} == n-cell-* && ${ENABLED_SERVICES} =~ "n-cell" ]] && return 0
[[ ${service} == "nova" && ${ENABLED_SERVICES} =~ "n-" ]] && return 0
[[ ${service} == "cinder" && ${ENABLED_SERVICES} =~ "c-" ]] && return 0
@@ -1450,7 +1460,7 @@
# vmdk disk type
vmdk_create_type="$(head -25 $IMAGE | grep -a -F -m 1 'createType=' $IMAGE)"
vmdk_create_type="${vmdk_create_type#*\"}"
- vmdk_create_type="${vmdk_create_type%?}"
+ vmdk_create_type="${vmdk_create_type%\"*}"
descriptor_data_pair_msg="Monolithic flat and VMFS disks "`
`"should use a descriptor-data pair."
@@ -1495,6 +1505,8 @@
IMAGE_NAME="${flat_fname}"
fi
vmdk_disktype="preallocated"
+ elif [[ "$vmdk_create_type" = "streamOptimized" ]]; then
+ vmdk_disktype="streamOptimized"
elif [[ -z "$vmdk_create_type" ]]; then
# *-flat.vmdk provided: attempt to retrieve the descriptor (*.vmdk)
# to retrieve appropriate metadata
@@ -1533,10 +1545,8 @@
vmdk_adapter_type="${vmdk_adapter_type%?}"
fi
fi
- #TODO(alegendre): handle streamOptimized once supported by the VMware driver.
vmdk_disktype="preallocated"
else
- #TODO(alegendre): handle streamOptimized once supported by the VMware driver.
vmdk_disktype="preallocated"
fi
diff --git a/lib/baremetal b/lib/baremetal
index a0df85e..d8cd7e9 100644
--- a/lib/baremetal
+++ b/lib/baremetal
@@ -431,8 +431,7 @@
function clear_baremetal_of_all_nodes() {
list=$(nova baremetal-node-list | awk -F '| ' 'NR>3 {print $2}' )
- for node in $list
- do
+ for node in $list; do
nova baremetal-node-delete $node
done
}
diff --git a/lib/ceilometer b/lib/ceilometer
index 30bf3ae..4ca77bb 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -59,7 +59,14 @@
# Functions
# ---------
-#
+
+# Test if any Ceilometer services are enabled
+# is_ceilometer_enabled
+function is_ceilometer_enabled {
+ [[ ,${ENABLED_SERVICES} =~ ,"ceilometer-" ]] && return 0
+ return 1
+}
+
# create_ceilometer_accounts() - Set up common required ceilometer accounts
create_ceilometer_accounts() {
@@ -105,6 +112,7 @@
# configure_ceilometerclient() - Set config files, create data dirs, etc
function configure_ceilometerclient() {
setup_develop $CEILOMETERCLIENT_DIR
+ sudo install -D -m 0644 -o $STACK_USER {$CEILOMETERCLIENT_DIR/tools/,/etc/bash_completion.d/}ceilometer.bash_completion
}
# configure_ceilometer() - Set config files, create data dirs, etc
@@ -137,7 +145,9 @@
iniset $CEILOMETER_CONF DEFAULT os_password $SERVICE_PASSWORD
iniset $CEILOMETER_CONF DEFAULT os_tenant_name $SERVICE_TENANT_NAME
- iniset $CEILOMETER_CONF keystone_authtoken auth_protocol http
+ iniset $CEILOMETER_CONF keystone_authtoken auth_host $KEYSTONE_AUTH_HOST
+ iniset $CEILOMETER_CONF keystone_authtoken auth_port $KEYSTONE_AUTH_PORT
+ iniset $CEILOMETER_CONF keystone_authtoken auth_protocol $KEYSTONE_AUTH_PROTOCOL
iniset $CEILOMETER_CONF keystone_authtoken admin_user ceilometer
iniset $CEILOMETER_CONF keystone_authtoken admin_password $SERVICE_PASSWORD
iniset $CEILOMETER_CONF keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME
diff --git a/lib/cinder b/lib/cinder
index 9f70b2a..e99f893 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -27,6 +27,12 @@
# set up default driver
CINDER_DRIVER=${CINDER_DRIVER:-default}
+CINDER_PLUGINS=$TOP_DIR/lib/cinder_plugins
+
+# grab plugin config if specified via cinder_driver
+if [[ -r $CINDER_PLUGINS/$CINDER_DRIVER ]]; then
+ source $CINDER_PLUGINS/$CINDER_DRIVER
+fi
# set up default directories
CINDER_DIR=$DEST/cinder
@@ -85,6 +91,14 @@
# Functions
# ---------
+
+# Test if any Cinder services are enabled
+# is_cinder_enabled
+function is_cinder_enabled {
+ [[ ,${ENABLED_SERVICES} =~ ,"c-" ]] && return 0
+ return 1
+}
+
# _clean_lvm_lv removes all cinder LVM volumes
#
# Usage: _clean_lvm_lv $VOLUME_GROUP $VOLUME_NAME_PREFIX
@@ -300,42 +314,8 @@
setup_colorized_logging $CINDER_CONF DEFAULT "project_id" "user_id"
fi
- if [ "$CINDER_DRIVER" == "XenAPINFS" ]; then
- (
- set -u
- iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.xenapi.sm.XenAPINFSDriver"
- iniset $CINDER_CONF DEFAULT xenapi_connection_url "$CINDER_XENAPI_CONNECTION_URL"
- iniset $CINDER_CONF DEFAULT xenapi_connection_username "$CINDER_XENAPI_CONNECTION_USERNAME"
- iniset $CINDER_CONF DEFAULT xenapi_connection_password "$CINDER_XENAPI_CONNECTION_PASSWORD"
- iniset $CINDER_CONF DEFAULT xenapi_nfs_server "$CINDER_XENAPI_NFS_SERVER"
- iniset $CINDER_CONF DEFAULT xenapi_nfs_serverpath "$CINDER_XENAPI_NFS_SERVERPATH"
- )
- elif [ "$CINDER_DRIVER" == "nfs" ]; then
- iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.nfs.NfsDriver"
- iniset $CINDER_CONF DEFAULT nfs_shares_config "$CINDER_CONF_DIR/nfs_shares.conf"
- echo "$CINDER_NFS_SERVERPATH" | sudo tee "$CINDER_CONF_DIR/nfs_shares.conf"
- sudo chmod 666 $CINDER_CONF_DIR/nfs_shares.conf
- elif [ "$CINDER_DRIVER" == "sheepdog" ]; then
- iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.sheepdog.SheepdogDriver"
- elif [ "$CINDER_DRIVER" == "glusterfs" ]; then
- # To use glusterfs, set the following in localrc:
- # CINDER_DRIVER=glusterfs
- # CINDER_GLUSTERFS_SHARES="127.0.0.1:/vol1;127.0.0.1:/vol2"
- # Shares are <host>:<volume> and separated by semicolons.
-
- iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.glusterfs.GlusterfsDriver"
- iniset $CINDER_CONF DEFAULT glusterfs_shares_config "$CINDER_CONF_DIR/glusterfs_shares"
- touch $CINDER_CONF_DIR/glusterfs_shares
- if [ ! -z "$CINDER_GLUSTERFS_SHARES" ]; then
- CINDER_GLUSTERFS_SHARES=$(echo $CINDER_GLUSTERFS_SHARES | tr ";" "\n")
- echo "$CINDER_GLUSTERFS_SHARES" > $CINDER_CONF_DIR/glusterfs_shares
- fi
- elif [ "$CINDER_DRIVER" == "vsphere" ]; then
- echo_summary "Using VMware vCenter driver"
- 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 volume_driver "cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver"
+ if [[ -r $CINDER_PLUGINS/$CINDER_DRIVER ]]; then
+ configure_cinder_driver
fi
if [[ is_fedora && $DISTRO =~ (rhel6) ]]; then
diff --git a/lib/cinder_plugins/XenAPINFS b/lib/cinder_plugins/XenAPINFS
new file mode 100644
index 0000000..72e1c13
--- /dev/null
+++ b/lib/cinder_plugins/XenAPINFS
@@ -0,0 +1,44 @@
+# lib/cinder_plugins/XenAPINFS
+# Configure the XenAPINFS driver
+
+# Enable with:
+#
+# CINDER_DRIVER=XenAPINFS
+
+# Dependencies:
+#
+# - ``functions`` file
+# - ``cinder`` configurations
+
+# configure_cinder_driver - make configuration changes, including those to other services
+
+# Save trace setting
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+
+# Defaults
+# --------
+
+# Set up default directories
+
+
+# Entry Points
+# ------------
+
+# configure_cinder_driver - Set config files, create data dirs, etc
+function configure_cinder_driver() {
+ iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.xenapi.sm.XenAPINFSDriver"
+ iniset $CINDER_CONF DEFAULT xenapi_connection_url "$CINDER_XENAPI_CONNECTION_URL"
+ iniset $CINDER_CONF DEFAULT xenapi_connection_username "$CINDER_XENAPI_CONNECTION_USERNAME"
+ iniset $CINDER_CONF DEFAULT xenapi_connection_password "$CINDER_XENAPI_CONNECTION_PASSWORD"
+ iniset $CINDER_CONF DEFAULT xenapi_nfs_server "$CINDER_XENAPI_NFS_SERVER"
+ iniset $CINDER_CONF DEFAULT xenapi_nfs_serverpath "$CINDER_XENAPI_NFS_SERVERPATH"
+}
+
+# Restore xtrace
+$MY_XTRACE
+
+# Local variables:
+# mode: shell-script
+# End:
diff --git a/lib/cinder_plugins/glusterfs b/lib/cinder_plugins/glusterfs
new file mode 100644
index 0000000..a0c5ae8
--- /dev/null
+++ b/lib/cinder_plugins/glusterfs
@@ -0,0 +1,50 @@
+# lib/cinder_plugins/glusterfs
+# Configure the glusterfs driver
+
+# Enable with:
+#
+# CINDER_DRIVER=glusterfs
+
+# Dependencies:
+#
+# - ``functions`` file
+# - ``cinder`` configurations
+
+# configure_cinder_driver - make configuration changes, including those to other services
+
+# Save trace setting
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+
+# Defaults
+# --------
+
+# Set up default directories
+
+
+# Entry Points
+# ------------
+
+# configure_cinder_driver - Set config files, create data dirs, etc
+function configure_cinder_driver() {
+ # To use glusterfs, set the following in localrc:
+ # CINDER_DRIVER=glusterfs
+ # CINDER_GLUSTERFS_SHARES="127.0.0.1:/vol1;127.0.0.1:/vol2"
+ # Shares are <host>:<volume> and separated by semicolons.
+
+ iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.glusterfs.GlusterfsDriver"
+ iniset $CINDER_CONF DEFAULT glusterfs_shares_config "$CINDER_CONF_DIR/glusterfs_shares"
+ touch $CINDER_CONF_DIR/glusterfs_shares
+ if [ ! -z "$CINDER_GLUSTERFS_SHARES" ]; then
+ CINDER_GLUSTERFS_SHARES=$(echo $CINDER_GLUSTERFS_SHARES | tr ";" "\n")
+ echo "$CINDER_GLUSTERFS_SHARES" > $CINDER_CONF_DIR/glusterfs_shares
+ fi
+}
+
+# Restore xtrace
+$MY_XTRACE
+
+# Local variables:
+# mode: shell-script
+# End:
diff --git a/lib/cinder_plugins/nfs b/lib/cinder_plugins/nfs
new file mode 100644
index 0000000..ea2c9ce
--- /dev/null
+++ b/lib/cinder_plugins/nfs
@@ -0,0 +1,42 @@
+# lib/cinder_plugins/nfs
+# Configure the nfs driver
+
+# Enable with:
+#
+# CINDER_DRIVER=nfs
+
+# Dependencies:
+#
+# - ``functions`` file
+# - ``cinder`` configurations
+
+# configure_cinder_driver - make configuration changes, including those to other services
+
+# Save trace setting
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+
+# Defaults
+# --------
+
+# Set up default directories
+
+
+# Entry Points
+# ------------
+
+# configure_cinder_driver - Set config files, create data dirs, etc
+function configure_cinder_driver() {
+ iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.nfs.NfsDriver"
+ iniset $CINDER_CONF DEFAULT nfs_shares_config "$CINDER_CONF_DIR/nfs_shares.conf"
+ echo "$CINDER_NFS_SERVERPATH" | sudo tee "$CINDER_CONF_DIR/nfs_shares.conf"
+ sudo chmod 660 $CINDER_CONF_DIR/nfs_shares.conf
+}
+
+# Restore xtrace
+$MY_XTRACE
+
+# Local variables:
+# mode: shell-script
+# End:
diff --git a/lib/cinder_plugins/sheepdog b/lib/cinder_plugins/sheepdog
new file mode 100644
index 0000000..4435932
--- /dev/null
+++ b/lib/cinder_plugins/sheepdog
@@ -0,0 +1,39 @@
+# lib/cinder_plugins/sheepdog
+# Configure the sheepdog driver
+
+# Enable with:
+#
+# CINDER_DRIVER=sheepdog
+
+# Dependencies:
+#
+# - ``functions`` file
+# - ``cinder`` configurations
+
+# configure_cinder_driver - make configuration changes, including those to other services
+
+# Save trace setting
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+
+# Defaults
+# --------
+
+# Set up default directories
+
+
+# Entry Points
+# ------------
+
+# configure_cinder_driver - Set config files, create data dirs, etc
+function configure_cinder_driver() {
+ iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.sheepdog.SheepdogDriver"
+}
+
+# Restore xtrace
+$MY_XTRACE
+
+# Local variables:
+# mode: shell-script
+# End:
diff --git a/lib/cinder_plugins/solidfire b/lib/cinder_plugins/solidfire
new file mode 100644
index 0000000..47c113e
--- /dev/null
+++ b/lib/cinder_plugins/solidfire
@@ -0,0 +1,48 @@
+# lib/cinder_plugins/solidfire
+# Configure the solidfire driver
+
+# Enable with:
+#
+# CINDER_DRIVER=solidfire
+
+# Dependencies:
+#
+# - ``functions`` file
+# - ``cinder`` configurations
+
+# configure_cinder_driver - make configuration changes, including those to other services
+
+# Save trace setting
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+
+# Defaults
+# --------
+
+# Set up default directories
+
+
+# Entry Points
+# ------------
+
+# configure_cinder_driver - Set config files, create data dirs, etc
+function configure_cinder_driver() {
+ # To use solidfire, set the following in localrc:
+ # CINDER_DRIVER=solidfire
+ # SAN_IP=<mvip>
+ # SAN_LOGIN=<cluster-admin-account>
+ # SAN_PASSWORD=<cluster-admin-password>
+
+ iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.drivers.solidfire.SolidFireDriver"
+ iniset $CINDER_CONF DEFAULT san_ip $SAN_IP
+ iniset $CINDER_CONF DEFAULT san_login $SAN_LOGIN
+ iniset $CINDER_CONF DEFAULT san_password $SAN_PASSWORD
+}
+
+# Restore xtrace
+$MY_XTRACE
+
+# Local variables:
+# mode: shell-script
+# End:
diff --git a/lib/cinder_plugins/vsphere b/lib/cinder_plugins/vsphere
new file mode 100644
index 0000000..c8cab6a
--- /dev/null
+++ b/lib/cinder_plugins/vsphere
@@ -0,0 +1,42 @@
+# lib/cinder_plugins/vsphere
+# Configure the vsphere driver
+
+# Enable with:
+#
+# CINDER_DRIVER=vsphere
+
+# Dependencies:
+#
+# - ``functions`` file
+# - ``cinder`` configurations
+
+# configure_cinder_driver - make configuration changes, including those to other services
+
+# Save trace setting
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+
+# Defaults
+# --------
+
+# Set up default directories
+
+
+# Entry Points
+# ------------
+
+# configure_cinder_driver - Set config files, create data dirs, etc
+function configure_cinder_driver() {
+ 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 volume_driver "cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver"
+}
+
+# Restore xtrace
+$MY_XTRACE
+
+# Local variables:
+# mode: shell-script
+# End:
diff --git a/lib/databases/mysql b/lib/databases/mysql
index 0eb8fdd..476b4b9 100644
--- a/lib/databases/mysql
+++ b/lib/databases/mysql
@@ -87,20 +87,25 @@
default-storage-engine = InnoDB" $MY_CONF
fi
- # Turn on slow query log
- sudo sed -i '/log.slow.queries/d' $MY_CONF
- sudo sed -i -e "/^\[mysqld\]/ a \
-log-slow-queries = /var/log/mysql/mysql-slow.log" $MY_CONF
+ if [[ "$DATABASE_QUERY_LOGGING" == "True" ]]; then
+ echo_summary "Enabling MySQL query logging"
- # Log all queries (any query taking longer than 0 seconds)
- sudo sed -i '/long.query.time/d' $MY_CONF
- sudo sed -i -e "/^\[mysqld\]/ a \
-long-query-time = 0" $MY_CONF
+ # Turn on slow query log
+ sudo sed -i '/log.slow.queries/d' $MY_CONF
+ sudo sed -i -e "/^\[mysqld\]/ a \
+ log-slow-queries = /var/log/mysql/mysql-slow.log" $MY_CONF
- # Log all non-indexed queries
- sudo sed -i '/log.queries.not.using.indexes/d' $MY_CONF
- sudo sed -i -e "/^\[mysqld\]/ a \
-log-queries-not-using-indexes" $MY_CONF
+ # Log all queries (any query taking longer than 0 seconds)
+ sudo sed -i '/long.query.time/d' $MY_CONF
+ sudo sed -i -e "/^\[mysqld\]/ a \
+ long-query-time = 0" $MY_CONF
+
+ # Log all non-indexed queries
+ sudo sed -i '/log.queries.not.using.indexes/d' $MY_CONF
+ sudo sed -i -e "/^\[mysqld\]/ a \
+ log-queries-not-using-indexes" $MY_CONF
+
+ fi
restart_service $MYSQL
}
diff --git a/lib/databases/postgresql b/lib/databases/postgresql
index 60e5a33..c459feb 100644
--- a/lib/databases/postgresql
+++ b/lib/databases/postgresql
@@ -43,7 +43,13 @@
if is_fedora; then
PG_HBA=/var/lib/pgsql/data/pg_hba.conf
PG_CONF=/var/lib/pgsql/data/postgresql.conf
- sudo [ -e $PG_HBA ] || sudo postgresql-setup initdb
+ if ! sudo [ -e $PG_HBA ]; then
+ if ! [[ $DISTRO =~ (rhel6) ]]; then
+ sudo postgresql-setup initdb
+ else
+ sudo service postgresql initdb
+ fi
+ fi
elif is_ubuntu; then
PG_DIR=`find /etc/postgresql -name pg_hba.conf|xargs dirname`
PG_HBA=$PG_DIR/pg_hba.conf
diff --git a/lib/gantt b/lib/gantt
new file mode 100644
index 0000000..832d759
--- /dev/null
+++ b/lib/gantt
@@ -0,0 +1,96 @@
+# lib/gantt
+# Install and start **Gantt** scheduler service
+
+# Dependencies:
+#
+# - functions
+# - DEST, DATA_DIR, STACK_USER must be defined
+
+# stack.sh
+# ---------
+# - install_gantt
+# - configure_gantt
+# - init_gantt
+# - start_gantt
+# - stop_gantt
+# - cleanup_gantt
+
+# Save trace setting
+XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+# Defaults
+# --------
+
+# set up default directories
+GANTT_DIR=$DEST/gantt
+GANTT_STATE_PATH=${GANTT_STATE_PATH:=$DATA_DIR/gantt}
+GANTT_REPO=${GANTT_REPO:-${GIT_BASE}/openstack/gantt.git}
+GANTT_BRANCH=${GANTT_BRANCH:-master}
+
+GANTTCLIENT_DIR=$DEST/python-ganttclient
+GANTTCLIENT_REPO=${GANTT_REPO:-${GIT_BASE}/openstack/python-ganttclient.git}
+GANTTCLIENT_BRANCH=${GANTT_BRANCH:-master}
+
+# eventually we will have a separate gantt config
+# file but for compatibility reasone stick with
+# nova.conf for now
+GANTT_CONF_DIR=${GANTT_CONF_DIR:-/etc/nova}
+GANTT_CONF=$GANTT_CONF_DIR/nova.conf
+
+# Support entry points installation of console scripts
+GANTT_BIN_DIR=$(get_python_exec_prefix)
+
+
+# Functions
+# ---------
+
+# cleanup_gantt() - Remove residual data files, anything left over from previous
+# runs that a clean run would need to clean up
+function cleanup_gantt() {
+ echo "Cleanup Gantt"
+}
+
+# configure_gantt() - Set config files, create data dirs, etc
+function configure_gantt() {
+ echo "Configure Gantt"
+}
+
+# init_gantt() - Initialize database and volume group
+function init_gantt() {
+ echo "Initialize Gantt"
+}
+
+# install_gantt() - Collect source and prepare
+function install_gantt() {
+ git_clone $GANTT_REPO $GANTT_DIR $GANTT_BRANCH
+ setup_develop $GANTT_DIR
+}
+
+# install_ganttclient() - Collect source and prepare
+function install_ganttclient() {
+ echo "Install Gantt Client"
+# git_clone $GANTTCLIENT_REPO $GANTTCLIENT_DIR $GANTTCLIENT_BRANCH
+# setup_develop $GANTTCLIENT_DIR
+}
+
+# start_gantt() - Start running processes, including screen
+function start_gantt() {
+ if is_service_enabled gantt; then
+ screen_it gantt "cd $GANTT_DIR && $GANTT_BIN_DIR/gantt-scheduler --config-file $GANTT_CONF"
+ fi
+}
+
+# stop_gantt() - Stop running processes
+function stop_gantt() {
+ echo "Stop Gantt"
+ screen_stop gantt
+}
+
+# Restore xtrace
+$XTRACE
+
+# Tell emacs to use shell-script-mode
+## Local variables:
+## mode: shell-script
+## End:
diff --git a/lib/glance b/lib/glance
index 07c4408..1ebeeb3 100644
--- a/lib/glance
+++ b/lib/glance
@@ -59,6 +59,13 @@
# Functions
# ---------
+# Test if any Glance services are enabled
+# is_glance_enabled
+function is_glance_enabled {
+ [[ ,${ENABLED_SERVICES} =~ ,"g-" ]] && return 0
+ return 1
+}
+
# cleanup_glance() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
function cleanup_glance() {
@@ -122,7 +129,7 @@
if is_service_enabled s-proxy; then
iniset $GLANCE_API_CONF DEFAULT default_store swift
iniset $GLANCE_API_CONF DEFAULT swift_store_auth_address $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/
- iniset $GLANCE_API_CONF DEFAULT swift_store_user $SERVICE_TENANT_NAME:glance
+ iniset $GLANCE_API_CONF DEFAULT swift_store_user $SERVICE_TENANT_NAME:glance-swift
iniset $GLANCE_API_CONF DEFAULT swift_store_key $SERVICE_PASSWORD
iniset $GLANCE_API_CONF DEFAULT swift_store_create_container_on_put True
diff --git a/lib/heat b/lib/heat
index 467619f..9f5dd8b 100644
--- a/lib/heat
+++ b/lib/heat
@@ -157,6 +157,7 @@
function install_heatclient() {
git_clone $HEATCLIENT_REPO $HEATCLIENT_DIR $HEATCLIENT_BRANCH
setup_develop $HEATCLIENT_DIR
+ sudo install -D -m 0644 -o $STACK_USER {$HEATCLIENT_DIR/tools/,/etc/bash_completion.d/}heat.bash_completion
}
# install_heat() - Collect source and prepare
@@ -185,8 +186,7 @@
local elements=$2
local arch=$3
local output=$TOP_DIR/files/$4
- if [[ -f "$output.qcow2" ]];
- then
+ if [[ -f "$output.qcow2" ]]; then
echo "Image file already exists: $output_file"
else
ELEMENTS_PATH=$elements_path disk-image-create \
diff --git a/lib/horizon b/lib/horizon
index c64d850..2f5795d 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -81,9 +81,6 @@
# init_horizon() - Initialize databases, etc.
function init_horizon() {
- # Remove stale session database.
- rm -f $HORIZON_DIR/openstack_dashboard/local/dashboard_openstack.sqlite3
-
# ``local_settings.py`` is used to override horizon default settings.
local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py
cp $HORIZON_SETTINGS $local_settings
@@ -106,12 +103,6 @@
_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
- python manage.py syncdb --noinput
- cd $TOP_DIR
-
# Create an empty directory that apache uses as docroot
sudo mkdir -p $HORIZON_DIR/.blackhole
diff --git a/lib/ironic b/lib/ironic
index 983add8..3c0e3cb 100644
--- a/lib/ironic
+++ b/lib/ironic
@@ -49,6 +49,13 @@
# Functions
# ---------
+# Test if any Ironic services are enabled
+# is_ironic_enabled
+function is_ironic_enabled {
+ [[ ,${ENABLED_SERVICES} =~ ,"ir-" ]] && return 0
+ return 1
+}
+
# install_ironic() - Collect source and prepare
function install_ironic() {
git_clone $IRONIC_REPO $IRONIC_DIR $IRONIC_BRANCH
diff --git a/lib/marconi b/lib/marconi
index 1eaebbd..d1ab5f3 100644
--- a/lib/marconi
+++ b/lib/marconi
@@ -58,6 +58,13 @@
# Functions
# ---------
+# Test if any Marconi services are enabled
+# is_marconi_enabled
+function is_marconi_enabled {
+ [[ ,${ENABLED_SERVICES} =~ ,"marconi-" ]] && return 0
+ return 1
+}
+
# cleanup_marconi() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
function cleanup_marconi() {
diff --git a/lib/neutron b/lib/neutron
index 81db2a7..5bd38bc 100644
--- a/lib/neutron
+++ b/lib/neutron
@@ -244,6 +244,13 @@
# Functions
# ---------
+# Test if any Neutron services are enabled
+# is_neutron_enabled
+function is_neutron_enabled {
+ [[ ,${ENABLED_SERVICES} =~ ,"q-" ]] && return 0
+ return 1
+}
+
# configure_neutron()
# Set common config for all neutron server and agents.
function configure_neutron() {
diff --git a/lib/neutron_plugins/bigswitch_floodlight b/lib/neutron_plugins/bigswitch_floodlight
index 93ec497..1e4aa00 100644
--- a/lib/neutron_plugins/bigswitch_floodlight
+++ b/lib/neutron_plugins/bigswitch_floodlight
@@ -44,16 +44,14 @@
function neutron_plugin_configure_service() {
iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT
iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT
- if [ "$BS_FL_VIF_DRIVER" = "ivs" ]
- then
+ if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
iniset /$Q_PLUGIN_CONF_FILE nova vif_type ivs
fi
}
function neutron_plugin_setup_interface_driver() {
local conf_file=$1
- if [ "$BS_FL_VIF_DRIVER" = "ivs" ]
- then
+ if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.IVSInterfaceDriver
else
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
diff --git a/lib/neutron_plugins/embrane b/lib/neutron_plugins/embrane
new file mode 100644
index 0000000..4206a20
--- /dev/null
+++ b/lib/neutron_plugins/embrane
@@ -0,0 +1,40 @@
+# Neutron Embrane plugin
+# ---------------------------
+
+# Save trace setting
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+source $TOP_DIR/lib/neutron_plugins/openvswitch
+
+save_function() {
+ local ORIG_FUNC=$(declare -f $1)
+ local NEW_FUNC="$2${ORIG_FUNC#$1}"
+ eval "$NEW_FUNC"
+}
+
+save_function neutron_plugin_configure_service _neutron_plugin_configure_service
+
+function neutron_plugin_configure_common() {
+ Q_PLUGIN_CONF_PATH=etc/neutron/plugins/embrane
+ Q_PLUGIN_CONF_FILENAME=heleos_conf.ini
+ Q_DB_NAME="ovs_neutron"
+ Q_PLUGIN_CLASS="neutron.plugins.embrane.plugins.embrane_ovs_plugin.EmbraneOvsPlugin"
+}
+
+function neutron_plugin_configure_service() {
+ _neutron_plugin_configure_service
+ iniset /$Q_PLUGIN_CONF_FILE heleos esm_mgmt $HELEOS_ESM_MGMT
+ iniset /$Q_PLUGIN_CONF_FILE heleos admin_username $HELEOS_ADMIN_USERNAME
+ iniset /$Q_PLUGIN_CONF_FILE heleos admin_password $HELEOS_ADMIN_PASSWORD
+ iniset /$Q_PLUGIN_CONF_FILE heleos router_image $HELEOS_ROUTER_IMAGE
+ iniset /$Q_PLUGIN_CONF_FILE heleos mgmt_id $HELEOS_MGMT_ID
+ iniset /$Q_PLUGIN_CONF_FILE heleos inband_id $HELEOS_INBAND_ID
+ iniset /$Q_PLUGIN_CONF_FILE heleos oob_id $HELEOS_OOB_ID
+ iniset /$Q_PLUGIN_CONF_FILE heleos dummy_utif_id $HELEOS_DUMMY_UTIF_ID
+ iniset /$Q_PLUGIN_CONF_FILE heleos resource_pool_id $HELEOS_RESOURCE_POOL_ID
+ iniset /$Q_PLUGIN_CONF_FILE heleos async_requests $HELEOS_ASYNC_REQUESTS
+}
+
+# Restore xtrace
+$MY_XTRACE
\ No newline at end of file
diff --git a/lib/neutron_plugins/nec b/lib/neutron_plugins/nec
index d8d8b7c..1cb2fef 100644
--- a/lib/neutron_plugins/nec
+++ b/lib/neutron_plugins/nec
@@ -106,8 +106,7 @@
local id=0
GRE_LOCAL_IP=${GRE_LOCAL_IP:-$HOST_IP}
if [ -n "$GRE_REMOTE_IPS" ]; then
- for ip in ${GRE_REMOTE_IPS//:/ }
- do
+ for ip in ${GRE_REMOTE_IPS//:/ }; do
if [[ "$ip" == "$GRE_LOCAL_IP" ]]; then
continue
fi
diff --git a/lib/neutron_thirdparty/bigswitch_floodlight b/lib/neutron_thirdparty/bigswitch_floodlight
index 1fd4fd8..24c1044 100644
--- a/lib/neutron_thirdparty/bigswitch_floodlight
+++ b/lib/neutron_thirdparty/bigswitch_floodlight
@@ -24,8 +24,7 @@
sudo ovs-vsctl --no-wait br-set-external-id ${OVS_BRIDGE} bridge-id ${OVS_BRIDGE}
ctrls=
- for ctrl in `echo ${BS_FL_CONTROLLERS_PORT} | tr ',' ' '`
- do
+ for ctrl in `echo ${BS_FL_CONTROLLERS_PORT} | tr ',' ' '`; do
ctrl=${ctrl%:*}
ctrls="${ctrls} tcp:${ctrl}:${BS_FL_OF_PORT}"
done
diff --git a/lib/nova b/lib/nova
index 9db19ed..eaaaa62 100644
--- a/lib/nova
+++ b/lib/nova
@@ -129,6 +129,20 @@
# Functions
# ---------
+# Test if any Nova services are enabled
+# is_nova_enabled
+function is_nova_enabled {
+ [[ ,${ENABLED_SERVICES} =~ ,"n-" ]] && return 0
+ return 1
+}
+
+# Test if any Nova Cell services are enabled
+# is_nova_enabled
+function is_n-cell_enabled {
+ [[ ,${ENABLED_SERVICES} =~ ,"n-cell-" ]] && return 0
+ return 1
+}
+
# Helper to clean iptables rules
function clean_iptables() {
# Delete rules
@@ -240,9 +254,6 @@
sudo sysctl -w net.ipv4.ip_forward=1
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
- # Attempt to load modules: network block device - used to manage qcow images
- sudo modprobe nbd || true
-
# Check for kvm (hardware based virtualization). If unable to initialize
# kvm, we drop back to the slower emulation mode (qemu). Note: many systems
# come with hardware virtualization disabled in BIOS.
@@ -392,6 +403,10 @@
fi
if is_service_enabled n-api; then
+ if is_service_enabled n-api-meta; then
+ # If running n-api-meta as a separate service
+ NOVA_ENABLED_APIS=$(echo $NOVA_ENABLED_APIS | sed "s/,metadata//")
+ fi
iniset $NOVA_CONF DEFAULT enabled_apis "$NOVA_ENABLED_APIS"
if is_service_enabled tls-proxy; then
# Set the service port for a proxy to take the original
@@ -445,7 +460,7 @@
iniset $NOVA_CONF DEFAULT instance_usage_audit "True"
iniset $NOVA_CONF DEFAULT instance_usage_audit_period "hour"
iniset $NOVA_CONF DEFAULT notify_on_state_change "vm_and_task_state"
- iniset $NOVA_CONF DEFAULT notification_driver "nova.openstack.common.notifier.rpc_notifier"
+ iniset $NOVA_CONF DEFAULT notification_driver "messaging"
fi
# Provide some transition from ``EXTRA_FLAGS`` to ``EXTRA_OPTS``
@@ -498,6 +513,12 @@
iniset $NOVA_CONF DEFAULT ec2_dmz_host "$EC2_DMZ_HOST"
iniset_rpc_backend nova $NOVA_CONF DEFAULT
iniset $NOVA_CONF DEFAULT glance_api_servers "$GLANCE_HOSTPORT"
+
+ if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
+ # File injection is being disabled by default in the near future -
+ # disable it here for now to avoid surprises later.
+ iniset $NOVA_CONF libvirt inject_partition '-2'
+ fi
}
function init_nova_cells() {
diff --git a/lib/nova_plugins/hypervisor-docker b/lib/nova_plugins/hypervisor-docker
index 0153953..cdd9317 100644
--- a/lib/nova_plugins/hypervisor-docker
+++ b/lib/nova_plugins/hypervisor-docker
@@ -31,10 +31,10 @@
DOCKER_PID_FILE=/var/run/docker.pid
DOCKER_REGISTRY_PORT=${DOCKER_REGISTRY_PORT:-5042}
-DOCKER_IMAGE=${DOCKER_IMAGE:-http://get.docker.io/images/openstack/docker-ut.tar.gz}
-DOCKER_IMAGE_NAME=docker-busybox
-DOCKER_REGISTRY_IMAGE=${DOCKER_REGISTRY_IMAGE:-http://get.docker.io/images/openstack/docker-registry.tar.gz}
-DOCKER_REGISTRY_IMAGE_NAME=docker-registry
+DOCKER_IMAGE=${DOCKER_IMAGE:-cirros:latest}
+DOCKER_IMAGE_NAME=cirros
+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}
diff --git a/lib/nova_plugins/hypervisor-libvirt b/lib/nova_plugins/hypervisor-libvirt
index 6f90f4a..42d3af1 100644
--- a/lib/nova_plugins/hypervisor-libvirt
+++ b/lib/nova_plugins/hypervisor-libvirt
@@ -108,6 +108,7 @@
iniset $NOVA_CONF DEFAULT libvirt_type "$LIBVIRT_TYPE"
iniset $NOVA_CONF DEFAULT libvirt_cpu_mode "none"
iniset $NOVA_CONF DEFAULT use_usb_tablet "False"
+ iniset $NOVA_CONF DEFAULT default_ephemeral_format "ext4"
iniset $NOVA_CONF DEFAULT compute_driver "libvirt.LibvirtDriver"
LIBVIRT_FIREWALL_DRIVER=${LIBVIRT_FIREWALL_DRIVER:-"nova.virt.libvirt.firewall.IptablesFirewallDriver"}
iniset $NOVA_CONF DEFAULT firewall_driver "$LIBVIRT_FIREWALL_DRIVER"
diff --git a/lib/rpc_backend b/lib/rpc_backend
index f59c800..3651bc0 100644
--- a/lib/rpc_backend
+++ b/lib/rpc_backend
@@ -139,12 +139,18 @@
if is_service_enabled rabbit; then
# Start rabbitmq-server
echo_summary "Starting RabbitMQ"
- if is_fedora || is_suse; then
- # service is not started by default
- restart_service rabbitmq-server
- fi
- # change the rabbit password since the default is "guest"
- sudo rabbitmqctl change_password guest $RABBIT_PASSWORD
+ # NOTE(bnemec): Retry initial rabbitmq configuration to deal with
+ # the fact that sometimes it fails to start properly.
+ # Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1059028
+ for i in `seq 10`; do
+ if is_fedora || is_suse; then
+ # service is not started by default
+ restart_service rabbitmq-server
+ fi
+ # change the rabbit password since the default is "guest"
+ sudo rabbitmqctl change_password guest $RABBIT_PASSWORD && break
+ [[ $i -eq "10" ]] && die $LINENO "Failed to set rabbitmq password"
+ done
if is_service_enabled n-cell; then
# Add partitioned access for the child cell
if [ -z `sudo rabbitmqctl list_vhosts | grep child_cell` ]; then
diff --git a/lib/swift b/lib/swift
index afdf995..be25c81 100644
--- a/lib/swift
+++ b/lib/swift
@@ -118,6 +118,13 @@
# Functions
# ---------
+# Test if any Swift services are enabled
+# is_swift_enabled
+function is_swift_enabled {
+ [[ ,${ENABLED_SERVICES} =~ ,"s-" ]] && return 0
+ return 1
+}
+
# cleanup_swift() - Remove residual data files
function cleanup_swift() {
rm -f ${SWIFT_CONF_DIR}{*.builder,*.ring.gz,backups/*.builder,backups/*.ring.gz}
@@ -261,6 +268,8 @@
SWIFT_CONFIG_PROXY_SERVER=${SWIFT_CONF_DIR}/proxy-server.conf
cp ${SWIFT_DIR}/etc/proxy-server.conf-sample ${SWIFT_CONFIG_PROXY_SERVER}
+ cp ${SWIFT_DIR}/etc/container-sync-realms.conf-sample ${SWIFT_CONF_DIR}/container-sync-realms.conf
+
iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT user
iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT user ${STACK_USER}
@@ -339,7 +348,7 @@
# NOTE(chmou): s3token middleware is not updated yet to use only
# username and password.
[filter:s3token]
-paste.filter_factory = keystone.middleware.s3_token:filter_factory
+paste.filter_factory = keystoneclient.middleware.s3_token:filter_factory
auth_port = ${KEYSTONE_AUTH_PORT}
auth_host = ${KEYSTONE_AUTH_HOST}
auth_protocol = ${KEYSTONE_AUTH_PROTOCOL}
@@ -511,6 +520,11 @@
# swifttenanttest2 swiftusertest2 admin
function create_swift_accounts() {
+ # Defines specific passwords used by tools/create_userrc.sh
+ SWIFTUSERTEST1_PASSWORD=testing
+ SWIFTUSERTEST2_PASSWORD=testing2
+ SWIFTUSERTEST3_PASSWORD=testing3
+
KEYSTONE_CATALOG_BACKEND=${KEYSTONE_CATALOG_BACKEND:-sql}
SERVICE_TENANT=$(keystone tenant-list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
@@ -533,17 +547,17 @@
SWIFT_TENANT_TEST1=$(keystone tenant-create --name=swifttenanttest1 | grep " id " | get_field 2)
die_if_not_set $LINENO SWIFT_TENANT_TEST1 "Failure creating SWIFT_TENANT_TEST1"
- SWIFT_USER_TEST1=$(keystone user-create --name=swiftusertest1 --pass=testing --email=test@example.com | grep " id " | get_field 2)
+ SWIFT_USER_TEST1=$(keystone user-create --name=swiftusertest1 --pass=$SWIFTUSERTEST1_PASSWORD --email=test@example.com | grep " id " | get_field 2)
die_if_not_set $LINENO SWIFT_USER_TEST1 "Failure creating SWIFT_USER_TEST1"
keystone user-role-add --user-id $SWIFT_USER_TEST1 --role-id $ADMIN_ROLE --tenant-id $SWIFT_TENANT_TEST1
- SWIFT_USER_TEST3=$(keystone user-create --name=swiftusertest3 --pass=testing3 --email=test3@example.com | grep " id " | get_field 2)
+ SWIFT_USER_TEST3=$(keystone user-create --name=swiftusertest3 --pass=$SWIFTUSERTEST3_PASSWORD --email=test3@example.com | grep " id " | get_field 2)
die_if_not_set $LINENO SWIFT_USER_TEST3 "Failure creating SWIFT_USER_TEST3"
keystone user-role-add --user-id $SWIFT_USER_TEST3 --role-id $ANOTHER_ROLE --tenant-id $SWIFT_TENANT_TEST1
SWIFT_TENANT_TEST2=$(keystone tenant-create --name=swifttenanttest2 | grep " id " | get_field 2)
die_if_not_set $LINENO SWIFT_TENANT_TEST2 "Failure creating SWIFT_TENANT_TEST2"
- SWIFT_USER_TEST2=$(keystone user-create --name=swiftusertest2 --pass=testing2 --email=test2@example.com | grep " id " | get_field 2)
+ SWIFT_USER_TEST2=$(keystone user-create --name=swiftusertest2 --pass=$SWIFTUSERTEST2_PASSWORD --email=test2@example.com | grep " id " | get_field 2)
die_if_not_set $LINENO SWIFT_USER_TEST2 "Failure creating SWIFT_USER_TEST2"
keystone user-role-add --user-id $SWIFT_USER_TEST2 --role-id $ADMIN_ROLE --tenant-id $SWIFT_TENANT_TEST2
}
@@ -655,10 +669,8 @@
if type -p swift-init >/dev/null; then
swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true
fi
- for type in proxy object container account; do
- # Dump all of the servers
- pkill -f swift-
- done
+ # Dump all of the servers
+ pkill -f swift-
}
# Restore xtrace
diff --git a/lib/tempest b/lib/tempest
index ee99665..76da170 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -46,8 +46,8 @@
# Set up default directories
TEMPEST_DIR=$DEST/tempest
-TEMPEST_CONF_DIR=$TEMPEST_DIR/etc
-TEMPEST_CONF=$TEMPEST_CONF_DIR/tempest.conf
+TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc}
+TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf
TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest}
NOVA_SOURCE_DIR=$DEST/nova
@@ -58,6 +58,10 @@
BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-0.3.1"
+# Cinder/Volume variables
+TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default}
+TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-"Open Source"}
+TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-iSCSI}
# Functions
# ---------
@@ -83,6 +87,11 @@
local boto_instance_type="m1.tiny"
local ssh_connect_method="fixed"
+ if [[ ! -d $TEMPEST_CONFIG_DIR ]]; then
+ sudo mkdir -p $TEMPEST_CONFIG_DIR
+ fi
+ sudo chown $STACK_USER $TEMPEST_CONFIG_DIR
+
# TODO(afazekas):
# sudo python setup.py deploy
@@ -133,7 +142,8 @@
# Create tempest.conf from tempest.conf.sample
# copy every time, because the image UUIDS are going to change
- cp $TEMPEST_CONF.sample $TEMPEST_CONF
+ sudo cp $TEMPEST_DIR/etc/tempest.conf.sample $TEMPEST_CONFIG
+ sudo chmod 644 $TEMPEST_CONFIG
password=${ADMIN_PASSWORD:-secrete}
@@ -224,121 +234,122 @@
fi
# Oslo
- iniset $TEMPEST_CONF DEFAULT lock_path $TEMPEST_STATE_PATH
+ iniset $TEMPEST_CONFIG DEFAULT lock_path $TEMPEST_STATE_PATH
mkdir -p $TEMPEST_STATE_PATH
- iniset $TEMPEST_CONF DEFAULT use_stderr False
- iniset $TEMPEST_CONF DEFAULT log_file tempest.log
- iniset $TEMPEST_CONF DEFAULT debug True
+ iniset $TEMPEST_CONFIG DEFAULT use_stderr False
+ iniset $TEMPEST_CONFIG DEFAULT log_file tempest.log
+ iniset $TEMPEST_CONFIG DEFAULT debug True
# Timeouts
- iniset $TEMPEST_CONF compute build_timeout $BUILD_TIMEOUT
- iniset $TEMPEST_CONF volume build_timeout $BUILD_TIMEOUT
- iniset $TEMPEST_CONF boto build_timeout $BUILD_TIMEOUT
- iniset $TEMPEST_CONF compute build_interval $BUILD_INTERVAL
- iniset $TEMPEST_CONF volume build_interval $BUILD_INTERVAL
- iniset $TEMPEST_CONF boto build_interval $BUILD_INTERVAL
- iniset $TEMPEST_CONF boto http_socket_timeout 5
+ iniset $TEMPEST_CONFIG compute build_timeout $BUILD_TIMEOUT
+ iniset $TEMPEST_CONFIG volume build_timeout $BUILD_TIMEOUT
+ iniset $TEMPEST_CONFIG boto build_timeout $BUILD_TIMEOUT
+ iniset $TEMPEST_CONFIG compute build_interval $BUILD_INTERVAL
+ iniset $TEMPEST_CONFIG volume build_interval $BUILD_INTERVAL
+ iniset $TEMPEST_CONFIG boto build_interval $BUILD_INTERVAL
+ iniset $TEMPEST_CONFIG boto http_socket_timeout 5
# Identity
- iniset $TEMPEST_CONF identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
- iniset $TEMPEST_CONF identity password "$password"
- iniset $TEMPEST_CONF identity alt_username $ALT_USERNAME
- iniset $TEMPEST_CONF identity alt_password "$password"
- iniset $TEMPEST_CONF identity alt_tenant_name $ALT_TENANT_NAME
- iniset $TEMPEST_CONF identity admin_password "$password"
+ 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 password "$password"
+ 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_password "$password"
# Image
# for the gate we want to be able to override this variable so we aren't
# doing an HTTP fetch over the wide internet for this test
if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
- iniset $TEMPEST_CONF image http_image $TEMPEST_HTTP_IMAGE
+ iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE
fi
# Compute
- iniset $TEMPEST_CONF compute change_password_available False
- # Note(nati) current tempest don't create network for each tenant
- # so reuse same tenant for now
- if is_service_enabled neutron; then
- TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
- fi
- iniset $TEMPEST_CONF compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
- iniset $TEMPEST_CONF compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
- iniset $TEMPEST_CONF compute network_for_ssh $PRIVATE_NETWORK_NAME
- iniset $TEMPEST_CONF compute ip_version_for_ssh 4
- iniset $TEMPEST_CONF compute ssh_timeout $BUILD_TIMEOUT
- iniset $TEMPEST_CONF compute image_ref $image_uuid
- iniset $TEMPEST_CONF compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
- iniset $TEMPEST_CONF compute image_ref_alt $image_uuid_alt
- iniset $TEMPEST_CONF compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
- iniset $TEMPEST_CONF compute flavor_ref $flavor_ref
- iniset $TEMPEST_CONF compute flavor_ref_alt $flavor_ref_alt
- iniset $TEMPEST_CONF compute live_migration_available ${LIVE_MIGRATION_AVAILABLE:-False}
- iniset $TEMPEST_CONF compute use_block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
- iniset $TEMPEST_CONF compute ssh_connect_method $ssh_connect_method
+ iniset $TEMPEST_CONFIG compute change_password_available False
+ iniset $TEMPEST_CONFIG compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
+ iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
+ iniset $TEMPEST_CONFIG compute network_for_ssh $PRIVATE_NETWORK_NAME
+ iniset $TEMPEST_CONFIG compute ip_version_for_ssh 4
+ iniset $TEMPEST_CONFIG compute ssh_timeout $BUILD_TIMEOUT
+ iniset $TEMPEST_CONFIG compute image_ref $image_uuid
+ iniset $TEMPEST_CONFIG compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
+ iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid_alt
+ iniset $TEMPEST_CONFIG compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
+ iniset $TEMPEST_CONFIG compute flavor_ref $flavor_ref
+ iniset $TEMPEST_CONFIG compute flavor_ref_alt $flavor_ref_alt
+ iniset $TEMPEST_CONFIG compute live_migration_available ${LIVE_MIGRATION_AVAILABLE:-False}
+ iniset $TEMPEST_CONFIG compute use_block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
+ iniset $TEMPEST_CONFIG compute ssh_connect_method $ssh_connect_method
# Compute admin
- iniset $TEMPEST_CONF "compute-admin" password "$password" # DEPRECATED
+ iniset $TEMPEST_CONFIG "compute-admin" password "$password" # DEPRECATED
- iniset $TEMPEST_CONF network api_version 2.0
- iniset $TEMPEST_CONF network tenant_networks_reachable "$tenant_networks_reachable"
- iniset $TEMPEST_CONF network public_network_id "$public_network_id"
- iniset $TEMPEST_CONF network public_router_id "$public_router_id"
- iniset $TEMPEST_CONF network default_network "$FIXED_RANGE"
+ iniset $TEMPEST_CONFIG network api_version 2.0
+ iniset $TEMPEST_CONFIG network tenant_networks_reachable "$tenant_networks_reachable"
+ 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"
# boto
- iniset $TEMPEST_CONF boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
- iniset $TEMPEST_CONF boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
- iniset $TEMPEST_CONF boto s3_materials_path "$BOTO_MATERIALS_PATH"
- iniset $TEMPEST_CONF boto instance_type "$boto_instance_type"
- iniset $TEMPEST_CONF boto http_socket_timeout 30
- iniset $TEMPEST_CONF boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
+ 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 instance_type "$boto_instance_type"
+ iniset $TEMPEST_CONFIG boto http_socket_timeout 30
+ iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
# Orchestration test image
if [[ ! -z "$HEAT_FETCHED_TEST_IMAGE" ]]; then
- iniset $TEMPEST_CONF orchestration image_ref "$HEAT_FETCHED_TEST_IMAGE"
+ iniset $TEMPEST_CONFIG orchestration image_ref "$HEAT_FETCHED_TEST_IMAGE"
elif [[ "$HEAT_CREATE_TEST_IMAGE" = "True" ]]; then
disk_image_create /usr/share/tripleo-image-elements "vm fedora heat-cfntools" "i386" "fedora-vm-heat-cfntools-tempest"
- iniset $TEMPEST_CONF orchestration image_ref "fedora-vm-heat-cfntools-tempest"
+ iniset $TEMPEST_CONFIG orchestration image_ref "fedora-vm-heat-cfntools-tempest"
fi
# Scenario
- iniset $TEMPEST_CONF scenario img_dir "$FILES/images/cirros-0.3.1-x86_64-uec"
+ iniset $TEMPEST_CONFIG scenario img_dir "$FILES/images/cirros-0.3.1-x86_64-uec"
# Large Ops Number
- iniset $TEMPEST_CONF scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
+ iniset $TEMPEST_CONFIG 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"
+ iniset $TEMPEST_CONFIG 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"
- iniset $TEMPEST_CONF volume backend1_name "LVM_iSCSI"
- iniset $TEMPEST_CONF volume backend2_name "LVM_iSCSI_2"
+ iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
+ iniset $TEMPEST_CONFIG volume backend1_name "LVM_iSCSI"
+ iniset $TEMPEST_CONFIG volume backend2_name "LVM_iSCSI_2"
+ fi
+
+ if [ $TEMPEST_VOLUME_DRIVER != "default" ]; then
+ iniset $TEMPEST_CONFIG volume vendor_name $TEMPEST_VOLUME_VENDOR
+ iniset $TEMPEST_CONFIG volume storage_protocol $TEMPEST_STORAGE_PROTOCOL
fi
# Dashboard
- iniset $TEMPEST_CONF dashboard dashboard_url "http://$SERVICE_HOST/"
- iniset $TEMPEST_CONF dashboard login_url "http://$SERVICE_HOST/auth/login/"
+ iniset $TEMPEST_CONFIG dashboard dashboard_url "http://$SERVICE_HOST/"
+ iniset $TEMPEST_CONFIG dashboard login_url "http://$SERVICE_HOST/auth/login/"
# cli
- iniset $TEMPEST_CONF cli cli_dir $NOVA_BIN_DIR
+ iniset $TEMPEST_CONFIG cli cli_dir $NOVA_BIN_DIR
# Networking
- iniset $TEMPEST_CONF network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-all}"
+ iniset $TEMPEST_CONFIG network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-all}"
# service_available
for service in ${TEMPEST_SERVICES//,/ }; do
if is_service_enabled $service ; then
- iniset $TEMPEST_CONF service_available $service "True"
+ iniset $TEMPEST_CONFIG service_available $service "True"
else
- iniset $TEMPEST_CONF service_available $service "False"
+ iniset $TEMPEST_CONFIG service_available $service "False"
fi
done
echo "Created tempest configuration file:"
- cat $TEMPEST_CONF
+ cat $TEMPEST_CONFIG
# Restore IFS
IFS=$ifs
diff --git a/lib/template b/lib/template
index 629e110..b8e7c4d 100644
--- a/lib/template
+++ b/lib/template
@@ -10,6 +10,7 @@
# ``stack.sh`` calls the entry points in this order:
#
+# - is_XXXX_enabled
# - install_XXXX
# - configure_XXXX
# - init_XXXX
@@ -35,6 +36,13 @@
# Entry Points
# ------------
+# Test if any XXXX services are enabled
+# is_XXXX_enabled
+function is_XXXX_enabled {
+ [[ ,${ENABLED_SERVICES} =~ ,"XX-" ]] && return 0
+ return 1
+}
+
# cleanup_XXXX() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
function cleanup_XXXX() {
diff --git a/lib/trove b/lib/trove
index 1fd011a..bb45491 100644
--- a/lib/trove
+++ b/lib/trove
@@ -129,14 +129,14 @@
# 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 cafile $KEYSTONE_SSL_CA
- 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
+ iniset $TROVE_API_PASTE_INI filter:authtoken auth_host $KEYSTONE_AUTH_HOST
+ iniset $TROVE_API_PASTE_INI filter:authtoken auth_port $KEYSTONE_AUTH_PORT
+ iniset $TROVE_API_PASTE_INI filter:authtoken auth_protocol $KEYSTONE_AUTH_PROTOCOL
+ iniset $TROVE_API_PASTE_INI filter:authtoken cafile $KEYSTONE_SSL_CA
+ iniset $TROVE_API_PASTE_INI filter:authtoken admin_tenant_name $SERVICE_TENANT_NAME
+ iniset $TROVE_API_PASTE_INI filter:authtoken admin_user trove
+ iniset $TROVE_API_PASTE_INI filter:authtoken admin_password $SERVICE_PASSWORD
+ iniset $TROVE_API_PASTE_INI filter:authtoken signing_dir $TROVE_AUTH_CACHE_DIR
# (Re)create trove conf files
rm -f $TROVE_CONF_DIR/trove.conf
@@ -148,8 +148,6 @@
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`
- iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT control_exchange trove
sed -i "s/localhost/$NETWORK_GATEWAY/g" $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample
setup_trove_logging $TROVE_CONF_DIR/trove.conf
diff --git a/stack.sh b/stack.sh
index 45d47c8..e45707b 100755
--- a/stack.sh
+++ b/stack.sh
@@ -298,6 +298,8 @@
SYSSTAT_FILE=${SYSSTAT_FILE:-"sysstat.dat"}
SYSSTAT_INTERVAL=${SYSSTAT_INTERVAL:-"1"}
+DSTAT_FILE=${DSTAT_FILE:-"dstat.txt"}
+
PIDSTAT_FILE=${PIDSTAT_FILE:-"pidstat.txt"}
PIDSTAT_INTERVAL=${PIDSTAT_INTERVAL:-"5"}
@@ -336,7 +338,6 @@
source $TOP_DIR/lib/neutron
source $TOP_DIR/lib/baremetal
source $TOP_DIR/lib/ldap
-source $TOP_DIR/lib/ironic
# Extras Source
# --------------
@@ -363,7 +364,11 @@
var=$1; msg=$2
pw=${!var}
- localrc=$TOP_DIR/localrc
+ if [[ -f $RC_DIR/localrc ]]; then
+ localrc=$TOP_DIR/localrc
+ else
+ localrc=$TOP_DIR/.localrc.auto
+ fi
# If the password is not defined yet, proceed to prompt user for a password.
if [ ! $pw ]; then
@@ -746,11 +751,6 @@
# don't be naive and add to existing line!
fi
-if is_service_enabled ir-api ir-cond; then
- install_ironic
- install_ironicclient
- configure_ironic
-fi
# Extras Install
# --------------
@@ -881,6 +881,16 @@
fi
fi
+if is_service_enabled dstat; then
+ # Per-process stats
+ DSTAT_OPTS="-tcndylp --top-cpu-adv"
+ if [[ -n ${SCREEN_LOGDIR} ]]; then
+ screen_it dstat "cd $TOP_DIR; dstat $DSTAT_OPTS | tee $SCREEN_LOGDIR/$DSTAT_FILE"
+ else
+ screen_it dstat "dstat $DSTAT_OPTS"
+ fi
+fi
+
if is_service_enabled pidstat; then
# Per-process stats
PIDSTAT_OPTS="-l -p ALL -T ALL"
@@ -966,15 +976,6 @@
fi
-# Ironic
-# ------
-
-if is_service_enabled ir-api ir-cond; then
- echo_summary "Configuring Ironic"
- init_ironic
-fi
-
-
# Neutron
# -------
@@ -1096,17 +1097,11 @@
fi
# Launch the Glance services
-if is_service_enabled g-api g-reg; then
+if is_service_enabled glance; then
echo_summary "Starting Glance"
start_glance
fi
-# Launch the Ironic services
-if is_service_enabled ir-api ir-cond; then
- echo_summary "Starting Ironic"
- start_ironic
-fi
-
# Create an access key and secret key for nova ec2 register image
if is_service_enabled key && is_service_enabled swift3 && is_service_enabled nova; then
NOVA_USER_ID=$(keystone user-list | grep ' nova ' | get_field 1)
@@ -1124,8 +1119,8 @@
# Create a randomized default value for the keymgr's fixed_key
if is_service_enabled nova; then
FIXED_KEY=""
- for i in $(seq 1 64);
- do FIXED_KEY+=$(echo "obase=16; $(($RANDOM % 16))" | bc);
+ for i in $(seq 1 64); do
+ FIXED_KEY+=$(echo "obase=16; $(($RANDOM % 16))" | bc);
done;
iniset $NOVA_CONF keymgr fixed_key "$FIXED_KEY"
fi
diff --git a/stackrc b/stackrc
index 197b4cf..9166a17 100644
--- a/stackrc
+++ b/stackrc
@@ -35,7 +35,7 @@
# enable_service neutron
# # Optional, to enable tempest configuration as part of devstack
# enable_service tempest
-ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,tempest,mysql
+ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,tempest,mysql
# Tell Tempest which services are available. The default is set here as
# Tempest falls late in the configuration sequence. This differs from
@@ -65,6 +65,9 @@
source $RC_DIR/.localrc.auto
fi
+# This can be used to turn database query logging on and off
+# (currently only implemented for MySQL backend)
+DATABASE_QUERY_LOGGING=$(trueorfalse True $DATABASE_QUERY_LOGGING)
# Repositories
# ------------
@@ -168,7 +171,7 @@
# storage service
SWIFT_REPO=${SWIFT_REPO:-${GIT_BASE}/openstack/swift.git}
SWIFT_BRANCH=${SWIFT_BRANCH:-master}
-SWIFT3_REPO=${SWIFT3_REPO:-${GIT_BASE}/fujita/swift3.git}
+SWIFT3_REPO=${SWIFT3_REPO:-http://github.com/fujita/swift3.git}
SWIFT3_BRANCH=${SWIFT3_BRANCH:-master}
# python swift client library
diff --git a/tests/functions.sh b/tests/functions.sh
index 95dafe1..06a4134 100755
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -49,8 +49,7 @@
ENABLED_SERVICES="$start"
enable_service $add
- if [ "$ENABLED_SERVICES" = "$finish" ]
- then
+ if [ "$ENABLED_SERVICES" = "$finish" ]; then
echo "OK: $start + $add -> $ENABLED_SERVICES"
else
echo "changing $start to $finish with $add failed: $ENABLED_SERVICES"
@@ -76,8 +75,7 @@
ENABLED_SERVICES="$start"
disable_service "$del"
- if [ "$ENABLED_SERVICES" = "$finish" ]
- then
+ if [ "$ENABLED_SERVICES" = "$finish" ]; then
echo "OK: $start - $del -> $ENABLED_SERVICES"
else
echo "changing $start to $finish with $del failed: $ENABLED_SERVICES"
@@ -102,8 +100,7 @@
ENABLED_SERVICES=a,b,c
disable_all_services
-if [[ -z "$ENABLED_SERVICES" ]]
-then
+if [[ -z "$ENABLED_SERVICES" ]]; then
echo "OK"
else
echo "disabling all services FAILED: $ENABLED_SERVICES"
@@ -118,8 +115,7 @@
ENABLED_SERVICES="$start"
disable_negated_services
- if [ "$ENABLED_SERVICES" = "$finish" ]
- then
+ if [ "$ENABLED_SERVICES" = "$finish" ]; then
echo "OK: $start + $add -> $ENABLED_SERVICES"
else
echo "changing $start to $finish failed: $ENABLED_SERVICES"
diff --git a/tools/bash8.py b/tools/bash8.py
index edf7da4..7552e0d 100755
--- a/tools/bash8.py
+++ b/tools/bash8.py
@@ -21,17 +21,37 @@
# Currently Supported checks
#
# Errors
+# Basic white space errors, for consistent indenting
# - E001: check that lines do not end with trailing whitespace
# - E002: ensure that indents are only spaces, and not hard tabs
# - E003: ensure all indents are a multiple of 4 spaces
+#
+# Structure errors
+#
+# A set of rules that help keep things consistent in control blocks.
+# These are ignored on long lines that have a continuation, because
+# unrolling that is kind of "interesting"
+#
+# - E010: *do* not on the same line as *for*
+# - E011: *then* not on the same line as *if*
import argparse
import fileinput
import re
import sys
-
ERRORS = 0
+IGNORE = None
+
+
+def register_ignores(ignores):
+ global IGNORE
+ if ignores:
+ IGNORE = '^(' + '|'.join(ignores.split(',')) + ')'
+
+
+def should_ignore(error):
+ return IGNORE and re.search(IGNORE, error)
def print_error(error, line):
@@ -41,6 +61,27 @@
print(" - %s: L%s" % (fileinput.filename(), fileinput.filelineno()))
+def not_continuation(line):
+ return not re.search('\\\\$', line)
+
+
+def check_for_do(line):
+ if not_continuation(line):
+ match = re.match('^\s*(for|while|until)\s', line)
+ if match:
+ operator = match.group(1).strip()
+ if not re.search(';\s*do(\b|$)', line):
+ print_error('E010: Do not on same line as %s' % operator,
+ line)
+
+
+def check_if_then(line):
+ if not_continuation(line):
+ if re.search('^\s*if \[', line):
+ if not re.search(';\s*then(\b|$)', line):
+ print_error('E011: Then non on same line as if', line)
+
+
def check_no_trailing_whitespace(line):
if re.search('[ \t]+$', line):
print_error('E001: Trailing Whitespace', line)
@@ -90,6 +131,8 @@
check_no_trailing_whitespace(logical_line)
check_indents(logical_line)
+ check_for_do(logical_line)
+ check_if_then(logical_line)
def get_options():
@@ -97,11 +140,13 @@
description='A bash script style checker')
parser.add_argument('files', metavar='file', nargs='+',
help='files to scan for errors')
+ parser.add_argument('-i', '--ignore', help='Rules to ignore')
return parser.parse_args()
def main():
opts = get_options()
+ register_ignores(opts.ignore)
check_files(opts.files)
if ERRORS > 0:
diff --git a/tools/build_tempest.sh b/tools/build_tempest.sh
deleted file mode 100755
index 6c527f5..0000000
--- a/tools/build_tempest.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env bash
-#
-# **build_tempest.sh**
-
-# Checkout and prepare a Tempest repo: git://git.openstack.org/openstack/tempest.git
-
-function usage {
- echo "$0 - Check out and prepare a Tempest repo"
- echo ""
- echo "Usage: $0"
- exit 1
-}
-
-if [ "$1" = "-h" ]; then
- usage
-fi
-
-# Clean up any resources that may be in use
-cleanup() {
- set +o errexit
-
- # Kill ourselves to signal any calling process
- trap 2; kill -2 $$
-}
-
-trap cleanup SIGHUP SIGINT SIGTERM SIGQUIT EXIT
-
-# Keep track of the current directory
-TOOLS_DIR=$(cd $(dirname "$0") && pwd)
-TOP_DIR=$(cd $TOOLS_DIR/..; pwd)
-
-# Import common functions
-. $TOP_DIR/functions
-
-# Abort if localrc is not set
-if [ ! -e $TOP_DIR/localrc ]; then
- echo "You must have a localrc with ALL necessary passwords and configuration defined before proceeding."
- echo "See stack.sh for required passwords."
- exit 1
-fi
-
-# Source params
-source ./stackrc
-
-# Where Openstack code lives
-DEST=${DEST:-/opt/stack}
-
-TEMPEST_DIR=$DEST/tempest
-
-# Install tests and prerequisites
-git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
-
-trap - SIGHUP SIGINT SIGTERM SIGQUIT EXIT
diff --git a/tools/create_userrc.sh b/tools/create_userrc.sh
index 5f4c486..d9c93cc 100755
--- a/tools/create_userrc.sh
+++ b/tools/create_userrc.sh
@@ -71,8 +71,7 @@
ROLE=Member
USER_NAME=""
USER_PASS=""
-while [ $# -gt 0 ]
-do
+while [ $# -gt 0 ]; do
case "$1" in
-h|--help) display_help; exit 0 ;;
--os-username) export OS_USERNAME=$2; shift ;;
@@ -254,6 +253,14 @@
if [ $MODE = one -a "$user_name" != "$USER_NAME" ]; then
continue;
fi
+
+ # Checks for a specific password defined for an user.
+ # Example for an username johndoe:
+ # JOHNDOE_PASSWORD=1234
+ eval SPECIFIC_UPASSWORD="\$${USER_NAME^^}_PASSWORD"
+ if [ -n "$SPECIFIC_UPASSWORD" ]; then
+ USER_PASS=$SPECIFIC_UPASSWORD
+ fi
add_entry "$user_id" "$user_name" "$tenant_id" "$tenant_name" "$USER_PASS"
done
done
diff --git a/tools/docker/install_docker.sh b/tools/docker/install_docker.sh
index 375cfe9..b9e1b24 100755
--- a/tools/docker/install_docker.sh
+++ b/tools/docker/install_docker.sh
@@ -55,21 +55,10 @@
die $LINENO "docker did not start"
fi
+# Get guest container image
+docker pull $DOCKER_IMAGE
+docker tag $DOCKER_IMAGE $DOCKER_IMAGE_NAME
-# Get Docker image
-if [[ ! -r $FILES/docker-ut.tar.gz ]]; then
- (cd $FILES; curl -OR $DOCKER_IMAGE)
-fi
-if [[ ! -r $FILES/docker-ut.tar.gz ]]; then
- die $LINENO "Docker image unavailable"
-fi
-docker import - $DOCKER_IMAGE_NAME <$FILES/docker-ut.tar.gz
-
-# Get Docker registry image
-if [[ ! -r $FILES/docker-registry.tar.gz ]]; then
- (cd $FILES; curl -OR $DOCKER_REGISTRY_IMAGE)
-fi
-if [[ ! -r $FILES/docker-registry.tar.gz ]]; then
- die $LINENO "Docker registry image unavailable"
-fi
-docker import - $DOCKER_REGISTRY_IMAGE_NAME <$FILES/docker-registry.tar.gz
+# Get docker-registry image
+docker pull $DOCKER_REGISTRY_IMAGE
+docker tag $DOCKER_REGISTRY_IMAGE $DOCKER_REGISTRY_IMAGE_NAME
diff --git a/tools/sar_filter.py b/tools/sar_filter.py
index ed8c196..24ef0e4 100755
--- a/tools/sar_filter.py
+++ b/tools/sar_filter.py
@@ -25,10 +25,10 @@
def parse_line(line):
- m = re.search('(\d\d:\d\d:\d\d \w\w)(\s+((\S+)\s*)+)', line)
+ m = re.search('(\d\d:\d\d:\d\d( \w\w)?)(\s+((\S+)\s*)+)', line)
if m:
date = m.group(1)
- data = m.group(2).rstrip()
+ data = m.group(3).rstrip()
return date, data
else:
return None, None
@@ -47,6 +47,10 @@
data_line = ""
printed_header = False
current_ts = None
+
+# print out the first sysstat line regardless
+print process.stdout.readline()
+
while True:
nextline = process.stdout.readline()
if nextline == '' and process.poll() is not None:
diff --git a/tools/xen/build_xva.sh b/tools/xen/build_xva.sh
index 958102b..fbbfd6f 100755
--- a/tools/xen/build_xva.sh
+++ b/tools/xen/build_xva.sh
@@ -21,9 +21,19 @@
# This directory
TOP_DIR=$(cd $(dirname "$0") && pwd)
+# Source lower level functions
+. $TOP_DIR/../../functions
+
# Include onexit commands
. $TOP_DIR/scripts/on_exit.sh
+# xapi functions
+. $TOP_DIR/functions
+
+# Determine what system we are running on.
+# Might not be XenServer if we're using xenserver-core
+GetDistro
+
# Source params - override xenrc params in your localrc to suite your taste
source xenrc
diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh
index 41b184c..d0d81a2 100755
--- a/tools/xen/install_os_domU.sh
+++ b/tools/xen/install_os_domU.sh
@@ -191,11 +191,9 @@
domid=$(xe vm-list name-label="$GUEST_NAME" params=dom-id minimal=true)
port=$(xenstore-read /local/domain/$domid/console/vnc-port)
echo "vncviewer -via root@$mgmt_ip localhost:${port:2}"
- while true
- do
+ while true; do
state=$(xe_min vm-list name-label="$GUEST_NAME" power-state=halted)
- if [ -n "$state" ]
- then
+ if [ -n "$state" ]; then
break
else
echo -n "."
diff --git a/tools/xen/prepare_guest_template.sh b/tools/xen/prepare_guest_template.sh
index 546ac99..4fa70d3 100755
--- a/tools/xen/prepare_guest_template.sh
+++ b/tools/xen/prepare_guest_template.sh
@@ -22,9 +22,19 @@
# This directory
TOP_DIR=$(cd $(dirname "$0") && pwd)
+# Source lower level functions
+. $TOP_DIR/../../functions
+
# Include onexit commands
. $TOP_DIR/scripts/on_exit.sh
+# xapi functions
+. $TOP_DIR/functions
+
+# Determine what system we are running on.
+# Might not be XenServer if we're using xenserver-core
+GetDistro
+
# Source params - override xenrc params in your localrc to suite your taste
source xenrc
diff --git a/tools/xen/scripts/install-os-vpx.sh b/tools/xen/scripts/install-os-vpx.sh
index 7b0d891..b9b65fd 100755
--- a/tools/xen/scripts/install-os-vpx.sh
+++ b/tools/xen/scripts/install-os-vpx.sh
@@ -42,8 +42,7 @@
get_params()
{
- while getopts "hbn:r:l:t:" OPTION;
- do
+ while getopts "hbn:r:l:t:" OPTION; do
case $OPTION in
h) usage
exit 1
@@ -63,8 +62,7 @@
;;
esac
done
- if [[ -z $BRIDGE ]]
- then
+ if [[ -z $BRIDGE ]]; then
BRIDGE=xenbr0
fi
@@ -91,8 +89,7 @@
find_network()
{
result=$(xe_min network-list bridge="$1")
- if [ "$result" = "" ]
- then
+ if [ "$result" = "" ]; then
result=$(xe_min network-list name-label="$1")
fi
echo "$result"
@@ -121,8 +118,7 @@
{
local v="$1"
IFS=,
- for vif in $(xe_min vif-list vm-uuid="$v")
- do
+ for vif in $(xe_min vif-list vm-uuid="$v"); do
xe vif-destroy uuid="$vif"
done
unset IFS
diff --git a/tools/xen/scripts/on_exit.sh b/tools/xen/scripts/on_exit.sh
index a4db39c..2441e3d 100755
--- a/tools/xen/scripts/on_exit.sh
+++ b/tools/xen/scripts/on_exit.sh
@@ -7,8 +7,7 @@
on_exit()
{
- for i in $(seq $((${#on_exit_hooks[*]} - 1)) -1 0)
- do
+ for i in $(seq $((${#on_exit_hooks[*]} - 1)) -1 0); do
eval "${on_exit_hooks[$i]}"
done
}
@@ -17,8 +16,7 @@
{
local n=${#on_exit_hooks[*]}
on_exit_hooks[$n]="$*"
- if [[ $n -eq 0 ]]
- then
+ if [[ $n -eq 0 ]]; then
trap on_exit EXIT
fi
}
diff --git a/tools/xen/test_functions.sh b/tools/xen/test_functions.sh
index 373d996..838f86a 100755
--- a/tools/xen/test_functions.sh
+++ b/tools/xen/test_functions.sh
@@ -227,16 +227,14 @@
}
[ "$1" = "run_tests" ] && {
- for testname in $($0)
- do
+ for testname in $($0); do
echo "$testname"
before_each_test
(
set -eux
$testname
)
- if [ "$?" != "0" ]
- then
+ if [ "$?" != "0" ]; then
echo "FAIL"
exit 1
else
diff --git a/tools/xen/xenrc b/tools/xen/xenrc
index cd28234..278bb9b 100644
--- a/tools/xen/xenrc
+++ b/tools/xen/xenrc
@@ -35,7 +35,7 @@
GUEST_PASSWORD=${GUEST_PASSWORD:-secrete}
# Extracted variables for OpenStack VM network device numbers.
-# Make sure, they form a continous sequence starting from 0
+# Make sure they form a continuous sequence starting from 0
MGT_DEV_NR=0
VM_DEV_NR=1
PUB_DEV_NR=2
@@ -91,4 +91,7 @@
# Set the size to 0 to avoid creation of additional disk.
XEN_XVDB_SIZE_GB=0
+restore_nounset=`set +o | grep nounset`
+set +u
source ../../stackrc
+$restore_nounset
diff --git a/unstack.sh b/unstack.sh
index 92d0642..6351fe0 100755
--- a/unstack.sh
+++ b/unstack.sh
@@ -55,7 +55,6 @@
source $TOP_DIR/lib/neutron
source $TOP_DIR/lib/baremetal
source $TOP_DIR/lib/ldap
-source $TOP_DIR/lib/ironic
# Extras Source
# --------------
@@ -104,7 +103,7 @@
stop_nova
fi
-if is_service_enabled g-api g-reg; then
+if is_service_enabled glance; then
stop_glance
fi
@@ -118,12 +117,6 @@
cleanup_swift
fi
-# Ironic runs daemons
-if is_service_enabled ir-api ir-cond; then
- stop_ironic
- cleanup_ironic
-fi
-
# Apache has the WSGI processes
if is_service_enabled horizon; then
stop_horizon