@@ -430,13 +430,18 @@ SWIFT_PARTITION_POWER_SIZE=${SWIFT_PARTITION_POWER_SIZE:-9}
430430# only some quick testing.
431431SWIFT_REPLICAS=${SWIFT_REPLICAS:- 3}
432432
433- # We only ask for Swift Hash if we have enabled swift service.
434433if is_service_enabled swift; then
434+ # If we are using swift, we can default the s3 port to swift instead
435+ # of nova-objectstore
436+ S3_SERVICE_PORT=${S3_SERVICE_PORT:- 8080}
437+ # We only ask for Swift Hash if we have enabled swift service.
435438 # SWIFT_HASH is a random unique string for a swift cluster that
436439 # can never change.
437440 read_password SWIFT_HASH " ENTER A RANDOM SWIFT HASH."
438441fi
439442
443+ # Set default port for nova-objectstore
444+ S3_SERVICE_PORT=${S3_SERVICE_PORT:- 3333}
440445
441446# Keystone
442447# --------
10171022
10181023# Storage Service
10191024if is_service_enabled swift; then
1025+ # Install memcached for swift.
1026+ apt_get install memcached
1027+
10201028 # We first do a bit of setup by creating the directories and
10211029 # changing the permissions so we can run it as our user.
10221030
@@ -1176,7 +1184,7 @@ if is_service_enabled swift; then
11761184
11771185 # TODO: Bring some services in foreground.
11781186 # Launch all services.
1179- swift-init all start
1187+ swift-init all restart
11801188
11811189 unset s swift_hash swift_auth_server
11821190fi
@@ -1243,9 +1251,8 @@ add_nova_opt "root_helper=sudo /usr/local/bin/nova-rootwrap"
12431251add_nova_opt " compute_scheduler_driver=$SCHEDULER "
12441252add_nova_opt " dhcpbridge_flagfile=$NOVA_CONF_DIR /$NOVA_CONF "
12451253add_nova_opt " fixed_range=$FIXED_RANGE "
1246- if is_service_enabled n-obj; then
1247- add_nova_opt " s3_host=$SERVICE_HOST "
1248- fi
1254+ add_nova_opt " s3_host=$SERVICE_HOST "
1255+ add_nova_opt " s3_port=$S3_SERVICE_PORT "
12491256if is_service_enabled quantum; then
12501257 add_nova_opt " network_manager=nova.network.quantum.manager.QuantumManager"
12511258 add_nova_opt " quantum_connection_host=$Q_HOST "
@@ -1471,6 +1478,7 @@ if is_service_enabled key; then
14711478
14721479 sudo sed -e " s,%SERVICE_HOST%,$SERVICE_HOST ,g" -i $KEYSTONE_CATALOG
14731480
1481+ sudo sed -e " s,%S3_SERVICE_PORT%,$S3_SERVICE_PORT ,g" -i $KEYSTONE_CATALOG
14741482
14751483 if [ " $SYSLOG " != " False" ]; then
14761484 cp $KEYSTONE_DIR /etc/logging.conf.sample $KEYSTONE_DIR /etc/logging.conf
@@ -1500,6 +1508,16 @@ if is_service_enabled key; then
15001508 SERVICE_ENDPOINT=$KEYSTONE_AUTH_PROTOCOL ://$KEYSTONE_AUTH_HOST :$KEYSTONE_AUTH_PORT /v2.0
15011509 ADMIN_PASSWORD=$ADMIN_PASSWORD SERVICE_TENANT_NAME=$SERVICE_TENANT_NAME SERVICE_PASSWORD=$SERVICE_PASSWORD SERVICE_TOKEN=$SERVICE_TOKEN SERVICE_ENDPOINT=$SERVICE_ENDPOINT DEVSTACK_DIR=$TOP_DIR ENABLED_SERVICES=$ENABLED_SERVICES \
15021510 bash $FILES /keystone_data.sh
1511+
1512+ # create an access key and secret key for nova ec2 register image
1513+ if is_service_enabled swift && is_service_enabled nova; then
1514+ CREDS=$( keystone --os_auth_url=$SERVICE_ENDPOINT --os_username=nova --os_password=$SERVICE_PASSWORD --os_tenant_name=$SERVICE_TENANT_NAME ec2-credentials-create)
1515+ ACCESS_KEY=$( echo " $CREDS " | awk ' / access / { print $4 }' )
1516+ SECRET_KEY=$( echo " $CREDS " | awk ' / secret / { print $4 }' )
1517+ add_nova_opt " s3_access_key=$ACCESS_KEY "
1518+ add_nova_opt " s3_secret_key=$SECRET_KEY "
1519+ add_nova_opt " s3_affix_tenant=True"
1520+ fi
15031521fi
15041522
15051523# launch the nova-api and wait for it to answer before continuing
0 commit comments