From b3862f98718317042dd48871d50da1e5255c0329 Mon Sep 17 00:00:00 2001 From: Mike Perez Date: Tue, 12 Feb 2013 02:16:41 -0800 Subject: [PATCH] Add Cinder V2 API to keystone catalog Support both SQL and templated keystone backend. This will add an additional endpoint to go with v1. Change-Id: I19168d55c2ffad2b1cd668b6c1341dc8e49e9c1f --- files/default_catalog.templates | 6 ++++++ lib/cinder | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/files/default_catalog.templates b/files/default_catalog.templates index 1ecf890241..277904a8e3 100644 --- a/files/default_catalog.templates +++ b/files/default_catalog.templates @@ -24,6 +24,12 @@ catalog.RegionOne.volume.internalURL = http://%SERVICE_HOST%:8776/v1/$(tenant_id catalog.RegionOne.volume.name = Volume Service +catalog.RegionOne.volumev2.publicURL = http://%SERVICE_HOST%:8776/v2/$(tenant_id)s +catalog.RegionOne.volumev2.adminURL = http://%SERVICE_HOST%:8776/v2/$(tenant_id)s +catalog.RegionOne.volumev2.internalURL = http://%SERVICE_HOST%:8776/v2/$(tenant_id)s +catalog.RegionOne.volumev2.name = Volume Service V2 + + catalog.RegionOne.ec2.publicURL = http://%SERVICE_HOST%:8773/services/Cloud catalog.RegionOne.ec2.adminURL = http://%SERVICE_HOST%:8773/services/Admin catalog.RegionOne.ec2.internalURL = http://%SERVICE_HOST%:8773/services/Cloud diff --git a/lib/cinder b/lib/cinder index 3472dcd519..2bdc29b0ae 100644 --- a/lib/cinder +++ b/lib/cinder @@ -339,6 +339,18 @@ create_cinder_accounts() { --publicurl "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \ --adminurl "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \ --internalurl "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" + CINDER_V2_SERVICE=$(keystone service-create \ + --name=cinder \ + --type=volumev2 \ + --description="Cinder Volume Service V2" \ + | grep " id " | get_field 2) + keystone endpoint-create \ + --region RegionOne \ + --service_id $CINDER_V2_SERVICE \ + --publicurl "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \ + --adminurl "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \ + --internalurl "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" + fi fi }