Configure and launch Heat REST API.

This is a REST API in the same style as other OpenStack APIs.

This also creates a new endpoint for the REST API which uses the
serivce type 'orchestration'. The old endpoint now has the service
type 'cloudformation'.

This matches the pattern where the native openstack API gets a
generic service type while the emulated EC2 API gets a specific
type (eg, object-store, s3).

There will be breakage for the time period where only one of this
change and https://review.openstack.org/#/c/14263/ are approved,
since keystone will have the incorrect service type for that period.

Change-Id: I6a0d51a63da8017d375b4c065c4c9079dfca8fe3
This commit is contained in:
Steve Baker 2012-10-10 13:19:10 +13:00
parent 082a3da01f
commit bb421bed58
3 changed files with 46 additions and 3 deletions

View File

@ -166,15 +166,25 @@ if [[ "$ENABLED_SERVICES" =~ "heat" ]]; then
--role_id $ADMIN_ROLE --role_id $ADMIN_ROLE
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
HEAT_CFN_SERVICE=$(get_id keystone service-create \ HEAT_CFN_SERVICE=$(get_id keystone service-create \
--name=heat \ --name=heat-cfn \
--type=orchestration \ --type=cloudformation \
--description="Heat Service") --description="Heat CloudFormation Service")
keystone endpoint-create \ keystone endpoint-create \
--region RegionOne \ --region RegionOne \
--service_id $HEAT_CFN_SERVICE \ --service_id $HEAT_CFN_SERVICE \
--publicurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \ --publicurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \
--adminurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \ --adminurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \
--internalurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" --internalurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1"
HEAT_SERVICE=$(get_id keystone service-create \
--name=heat \
--type=orchestration \
--description="Heat Service")
keystone endpoint-create \
--region RegionOne \
--service_id $HEAT_SERVICE \
--publicurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \
--adminurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \
--internalurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s"
fi fi
fi fi

View File

@ -51,6 +51,8 @@ function configure_heat() {
HEAT_METADATA_PORT=${HEAT_METADATA_PORT:-8002} HEAT_METADATA_PORT=${HEAT_METADATA_PORT:-8002}
HEAT_API_CW_HOST=${HEAT_API_CW_HOST:-$SERVICE_HOST} HEAT_API_CW_HOST=${HEAT_API_CW_HOST:-$SERVICE_HOST}
HEAT_API_CW_PORT=${HEAT_API_CW_PORT:-8003} HEAT_API_CW_PORT=${HEAT_API_CW_PORT:-8003}
HEAT_API_HOST=${HEAT_API_HOST:-$SERVICE_HOST}
HEAT_API_PORT=${HEAT_API_PORT:-8004}
# cloudformation api # cloudformation api
HEAT_API_CFN_CONF=$HEAT_CONF_DIR/heat-api-cfn.conf HEAT_API_CFN_CONF=$HEAT_CONF_DIR/heat-api-cfn.conf
@ -81,6 +83,35 @@ function configure_heat() {
iniset $HEAT_API_CFN_PASTE_INI filter:ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0 iniset $HEAT_API_CFN_PASTE_INI filter:ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0
iniset $HEAT_API_CFN_PASTE_INI filter:ec2authtoken keystone_ec2_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ec2tokens iniset $HEAT_API_CFN_PASTE_INI filter:ec2authtoken keystone_ec2_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ec2tokens
# openstack api
HEAT_API_CONF=$HEAT_CONF_DIR/heat-api.conf
cp $HEAT_DIR/etc/heat/heat-api.conf $HEAT_API_CONF
iniset $HEAT_API_CONF DEFAULT debug True
inicomment $HEAT_API_CONF DEFAULT log_file
iniset $HEAT_API_CONF DEFAULT use_syslog $SYSLOG
iniset $HEAT_API_CONF DEFAULT bind_host $HEAT_API_HOST
iniset $HEAT_API_CONF DEFAULT bind_port $HEAT_API_PORT
if is_service_enabled rabbit; then
iniset $HEAT_API_CONF DEFAULT rpc_backend heat.openstack.common.rpc.impl_kombu
iniset $HEAT_API_CONF DEFAULT rabbit_password $RABBIT_PASSWORD
iniset $HEAT_API_CONF DEFAULT rabbit_host $RABBIT_HOST
elif is_service_enabled qpid; then
iniset $HEAT_API_CONF DEFAULT rpc_backend heat.openstack.common.rpc.impl_qpid
fi
HEAT_API_PASTE_INI=$HEAT_CONF_DIR/heat-api-paste.ini
cp $HEAT_DIR/etc/heat/heat-api-paste.ini $HEAT_API_PASTE_INI
iniset $HEAT_API_PASTE_INI filter:authtoken auth_host $KEYSTONE_AUTH_HOST
iniset $HEAT_API_PASTE_INI filter:authtoken auth_port $KEYSTONE_AUTH_PORT
iniset $HEAT_API_PASTE_INI filter:authtoken auth_protocol $KEYSTONE_AUTH_PROTOCOL
iniset $HEAT_API_PASTE_INI filter:authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0
iniset $HEAT_API_PASTE_INI filter:authtoken admin_tenant_name $SERVICE_TENANT_NAME
iniset $HEAT_API_PASTE_INI filter:authtoken admin_user heat
iniset $HEAT_API_PASTE_INI filter:authtoken admin_password $SERVICE_PASSWORD
iniset $HEAT_API_PASTE_INI filter:ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0
iniset $HEAT_API_PASTE_INI filter:ec2authtoken keystone_ec2_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ec2tokens
# engine # engine
HEAT_ENGINE_CONF=$HEAT_CONF_DIR/heat-engine.conf HEAT_ENGINE_CONF=$HEAT_CONF_DIR/heat-engine.conf
cp $HEAT_DIR/etc/heat/heat-engine.conf $HEAT_ENGINE_CONF cp $HEAT_DIR/etc/heat/heat-engine.conf $HEAT_ENGINE_CONF
@ -168,6 +199,7 @@ function install_heat() {
# start_heat() - Start running processes, including screen # start_heat() - Start running processes, including screen
function start_heat() { function start_heat() {
screen_it h-eng "cd $HEAT_DIR; bin/heat-engine --config-file=$HEAT_CONF_DIR/heat-engine.conf" screen_it h-eng "cd $HEAT_DIR; bin/heat-engine --config-file=$HEAT_CONF_DIR/heat-engine.conf"
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-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-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" screen_it h-meta "cd $HEAT_DIR; bin/heat-metadata --config-dir=$HEAT_CONF_DIR/heat-metadata.conf"

View File

@ -1050,6 +1050,7 @@ if is_service_enabled key; then
SERVICE_TOKEN=$SERVICE_TOKEN SERVICE_ENDPOINT=$SERVICE_ENDPOINT SERVICE_HOST=$SERVICE_HOST \ SERVICE_TOKEN=$SERVICE_TOKEN SERVICE_ENDPOINT=$SERVICE_ENDPOINT SERVICE_HOST=$SERVICE_HOST \
S3_SERVICE_PORT=$S3_SERVICE_PORT KEYSTONE_CATALOG_BACKEND=$KEYSTONE_CATALOG_BACKEND \ S3_SERVICE_PORT=$S3_SERVICE_PORT KEYSTONE_CATALOG_BACKEND=$KEYSTONE_CATALOG_BACKEND \
DEVSTACK_DIR=$TOP_DIR ENABLED_SERVICES=$ENABLED_SERVICES HEAT_API_CFN_PORT=$HEAT_API_CFN_PORT \ DEVSTACK_DIR=$TOP_DIR ENABLED_SERVICES=$ENABLED_SERVICES HEAT_API_CFN_PORT=$HEAT_API_CFN_PORT \
HEAT_API_PORT=$HEAT_API_PORT \
bash -x $FILES/keystone_data.sh bash -x $FILES/keystone_data.sh
# Set up auth creds now that keystone is bootstrapped # Set up auth creds now that keystone is bootstrapped