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
diff --git a/files/default_catalog.templates b/files/default_catalog.templates
index 1ecf890..277904a 100644
--- a/files/default_catalog.templates
+++ b/files/default_catalog.templates
@@ -24,6 +24,12 @@
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 3472dcd..2bdc29b 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -339,6 +339,18 @@
--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
}