Merge "Refactor swift installation"
diff --git a/files/keystone_data.sh b/files/keystone_data.sh
index 066d4ae..20749bc 100755
--- a/files/keystone_data.sh
+++ b/files/keystone_data.sh
@@ -87,6 +87,11 @@
keystone user-role-add --user_id $DEMO_USER --role_id $MEMBER_ROLE --tenant_id $DEMO_TENANT
keystone user-role-add --user_id $DEMO_USER --role_id $MEMBER_ROLE --tenant_id $INVIS_TENANT
+# The ResellerAdmin role is used by Nova and Ceilometer so we need to keep it.
+# The admin role in swift allows a user to act as an admin for their tenant,
+# but ResellerAdmin is needed for a user to act as any tenant. The name of this
+# role is also configurable in swift-proxy.conf
+RESELLER_ROLE=$(get_id keystone role-create --name=ResellerAdmin)
# Services
# --------
@@ -129,11 +134,7 @@
--internalurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s"
fi
# Nova needs ResellerAdmin role to download images when accessing
- # swift through the s3 api. The admin role in swift allows a user
- # to act as an admin for their tenant, but ResellerAdmin is needed
- # for a user to act as any tenant. The name of this role is also
- # configurable in swift-proxy.conf
- RESELLER_ROLE=$(get_id keystone role-create --name=ResellerAdmin)
+ # swift through the s3 api.
keystone user-role-add \
--tenant_id $SERVICE_TENANT \
--user_id $NOVA_USER \
@@ -255,6 +256,10 @@
keystone user-role-add --tenant_id $SERVICE_TENANT \
--user_id $CEILOMETER_USER \
--role_id $ADMIN_ROLE
+ # Ceilometer needs ResellerAdmin role to access swift account stats.
+ keystone user-role-add --tenant_id $SERVICE_TENANT \
+ --user_id $CEILOMETER_USER \
+ --role_id $RESELLER_ROLE
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
CEILOMETER_SERVICE=$(get_id keystone service-create \
--name=ceilometer \
diff --git a/lib/cinder b/lib/cinder
index 058fcc2..1aa34cd 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -24,6 +24,9 @@
# Defaults
# --------
+# set up default driver
+CINDER_DRIVER=${CINDER_DRIVER:-default}
+
# set up default directories
CINDER_DIR=$DEST/cinder
CINDERCLIENT_DIR=$DEST/python-cinderclient
@@ -145,6 +148,19 @@
iniset $CINDER_CONF DEFAULT logging_debug_format_suffix "[00;33mfrom (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d[00m"
iniset $CINDER_CONF DEFAULT logging_exception_prefix "%(color)s%(asctime)s TRACE %(name)s [01;35m%(instance)s[00m"
fi
+
+ if [ "$CINDER_DRIVER" == "XenAPINFS" ]; then
+ (
+ set -u
+ iniset $CINDER_CONF DEFAULT volume_driver "cinder.volume.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"
+ )
+ [ $? -ne 0 ] && exit 1
+ fi
}
# init_cinder() - Initialize database and volume group
diff --git a/lib/heat b/lib/heat
index 396c8a0..b640fbc 100644
--- a/lib/heat
+++ b/lib/heat
@@ -1,7 +1,7 @@
# lib/heat
# Install and start Heat service
# To enable, add the following to localrc
-# ENABLED_SERVICES+=,heat,h-api-cfn,h-api-cw,h-eng,h-meta
+# ENABLED_SERVICES+=,heat,h-api-cfn,h-api-cw,h-eng
# Dependencies:
# - functions
@@ -52,8 +52,6 @@
HEAT_API_CFN_PORT=${HEAT_API_CFN_PORT:-8000}
HEAT_ENGINE_HOST=${HEAT_ENGINE_HOST:-$SERVICE_HOST}
HEAT_ENGINE_PORT=${HEAT_ENGINE_PORT:-8001}
- HEAT_METADATA_HOST=${HEAT_METADATA_HOST:-$SERVICE_HOST}
- HEAT_METADATA_PORT=${HEAT_METADATA_PORT:-8002}
HEAT_API_CW_HOST=${HEAT_API_CW_HOST:-$SERVICE_HOST}
HEAT_API_CW_PORT=${HEAT_API_CW_PORT:-8003}
HEAT_API_HOST=${HEAT_API_HOST:-$SERVICE_HOST}
@@ -126,7 +124,7 @@
iniset $HEAT_ENGINE_CONF DEFAULT bind_host $HEAT_ENGINE_HOST
iniset $HEAT_ENGINE_CONF DEFAULT bind_port $HEAT_ENGINE_PORT
iniset $HEAT_ENGINE_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT
- iniset $HEAT_ENGINE_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_METADATA_HOST:$HEAT_METADATA_PORT
+ iniset $HEAT_ENGINE_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_CFN_HOST:$HEAT_CFN_PORT/v1/waitcondition
iniset $HEAT_ENGINE_CONF DEFAULT heat_watch_server_url http://$HEAT_API_CW_HOST:$HEAT_API_CW_PORT
local dburl
database_connection_url dburl heat
@@ -141,26 +139,6 @@
iniset $HEAT_ENGINE_CONF DEFAULT rpc_backend heat.openstack.common.rpc.impl_qpid
fi
- # metadata api
- HEAT_METADATA_CONF=$HEAT_CONF_DIR/heat-metadata.conf
- cp $HEAT_DIR/etc/heat/heat-metadata.conf $HEAT_METADATA_CONF
- iniset $HEAT_METADATA_CONF DEFAULT debug True
- inicomment $HEAT_METADATA_CONF DEFAULT log_file
- iniset $HEAT_METADATA_CONF DEFAULT use_syslog $SYSLOG
- iniset $HEAT_METADATA_CONF DEFAULT bind_host $HEAT_METADATA_HOST
- iniset $HEAT_METADATA_CONF DEFAULT bind_port $HEAT_METADATA_PORT
-
- if is_service_enabled rabbit; then
- iniset $HEAT_METADATA_CONF DEFAULT rpc_backend heat.openstack.common.rpc.impl_kombu
- iniset $HEAT_METADATA_CONF DEFAULT rabbit_password $RABBIT_PASSWORD
- iniset $HEAT_METADATA_CONF DEFAULT rabbit_host $RABBIT_HOST
- elif is_service_enabled qpid; then
- iniset $HEAT_METADATA_CONF DEFAULT rpc_backend heat.openstack.common.rpc.impl_qpid
- fi
-
- HEAT_METADATA_PASTE_INI=$HEAT_CONF_DIR/heat-metadata-paste.ini
- cp $HEAT_DIR/etc/heat/heat-metadata-paste.ini $HEAT_METADATA_PASTE_INI
-
# cloudwatch api
HEAT_API_CW_CONF=$HEAT_CONF_DIR/heat-api-cloudwatch.conf
cp $HEAT_DIR/etc/heat/heat-api-cloudwatch.conf $HEAT_API_CW_CONF
@@ -217,13 +195,12 @@
screen_it h-api "cd $HEAT_DIR; bin/heat-api --config-dir=$HEAT_CONF_DIR/heat-api.conf"
screen_it h-api-cfn "cd $HEAT_DIR; bin/heat-api-cfn --config-dir=$HEAT_CONF_DIR/heat-api-cfn.conf"
screen_it h-api-cw "cd $HEAT_DIR; bin/heat-api-cloudwatch --config-dir=$HEAT_CONF_DIR/heat-api-cloudwatch.conf"
- screen_it h-meta "cd $HEAT_DIR; bin/heat-metadata --config-dir=$HEAT_CONF_DIR/heat-metadata.conf"
}
# stop_heat() - Stop running processes
function stop_heat() {
# Kill the cinder screen windows
- for serv in h-eng h-api-cfn h-api-cw h-meta; do
+ for serv in h-eng h-api-cfn h-api-cw; do
screen -S $SCREEN_NAME -p $serv -X kill
done
}