From 87865791eaae6b03db587f5ba187d628b8279aca Mon Sep 17 00:00:00 2001 From: ZHU ZHU Date: Thu, 13 Nov 2014 10:14:28 -0600 Subject: [PATCH] Register cinder v2 service and endpoint to support recent nova changes Recently nova merged commit https://review.openstack.org/#/c/124468/ have switch to use cinder v2. Block-storage cookbook need to be updated for this change. Compute cookbook already updated to adopt v2 from commit: https://review.openstack.org/#/c/133908/ This commit will depends on common cookbook: https://review.openstack.org/#/c/134275/ Change-Id: I096b4015f637d2df811cf9abb4d7233f706ce8d1 --- CHANGELOG.md | 1 + recipes/identity_registration.rb | 16 +++++++------- spec/identity_registration_spec.rb | 34 +++++++++++++++--------------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76286a5..e465d50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This file is used to list changes made in each version of the openstack-block-st * Add glance_ca_certificates_file * Add default_volume_type config option * Update gpfs volume driver path and fix gpfs_images_share_mode initialization +* Change to cinder v2 service and endpoint ## 10.0.0 * Upgrading to Juno diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb index 6f1d8f9..e8758f5 100644 --- a/recipes/identity_registration.rb +++ b/recipes/identity_registration.rb @@ -45,12 +45,12 @@ openstack_identity_register 'Register Service Tenant' do action :create_tenant end -openstack_identity_register 'Register Cinder Volume Service' do +openstack_identity_register 'Register Cinder V2 Volume Service' do auth_uri auth_uri bootstrap_token bootstrap_token - service_name 'cinder' - service_type 'volume' - service_description 'Cinder Volume Service' + service_name 'cinderv2' + service_type 'volumev2' + service_description 'Cinder Volume Service V2' endpoint_region region endpoint_adminurl ::URI.decode cinder_api_endpoint.to_s endpoint_internalurl ::URI.decode cinder_api_endpoint.to_s @@ -58,12 +58,12 @@ openstack_identity_register 'Register Cinder Volume Service' do action :create_service end -openstack_identity_register 'Register Cinder Volume Endpoint' do +openstack_identity_register 'Register Cinder V2 Volume Endpoint' do auth_uri auth_uri bootstrap_token bootstrap_token - service_name 'cinder' - service_type 'volume' - service_description 'Cinder Volume Service' + service_name 'cinderv2' + service_type 'volumev2' + service_description 'Cinder Volume Service V2' endpoint_region region endpoint_adminurl ::URI.decode cinder_api_endpoint.to_s endpoint_internalurl ::URI.decode cinder_api_endpoint.to_s diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb index 0e0884d..0d3b1a1 100644 --- a/spec/identity_registration_spec.rb +++ b/spec/identity_registration_spec.rb @@ -23,43 +23,43 @@ describe 'openstack-block-storage::identity_registration' do ) end - it 'registers cinder volume service' do + it 'registers cinder v2 volume service' do expect(chef_run).to create_service_openstack_identity_register( - 'Register Cinder Volume Service' + 'Register Cinder V2 Volume Service' ).with( auth_uri: 'http://127.0.0.1:35357/v2.0', bootstrap_token: 'bootstrap-token', - service_name: 'cinder', - service_type: 'volume', - service_description: 'Cinder Volume Service', + service_name: 'cinderv2', + service_type: 'volumev2', + service_description: 'Cinder Volume Service V2', endpoint_region: 'RegionOne', - endpoint_adminurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s', - endpoint_internalurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s', - endpoint_publicurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s' + endpoint_adminurl: 'http://127.0.0.1:8776/v2/%(tenant_id)s', + endpoint_internalurl: 'http://127.0.0.1:8776/v2/%(tenant_id)s', + endpoint_publicurl: 'http://127.0.0.1:8776/v2/%(tenant_id)s' ) end - context 'registers volume endpoint' do + context 'registers v2 volume endpoint' do it 'with default values' do expect(chef_run).to create_endpoint_openstack_identity_register( - 'Register Cinder Volume Endpoint' + 'Register Cinder V2 Volume Endpoint' ).with( auth_uri: 'http://127.0.0.1:35357/v2.0', bootstrap_token: 'bootstrap-token', - service_name: 'cinder', - service_type: 'volume', - service_description: 'Cinder Volume Service', + service_name: 'cinderv2', + service_type: 'volumev2', + service_description: 'Cinder Volume Service V2', endpoint_region: 'RegionOne', - endpoint_adminurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s', - endpoint_internalurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s', - endpoint_publicurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s' + endpoint_adminurl: 'http://127.0.0.1:8776/v2/%(tenant_id)s', + endpoint_internalurl: 'http://127.0.0.1:8776/v2/%(tenant_id)s', + endpoint_publicurl: 'http://127.0.0.1:8776/v2/%(tenant_id)s' ) end it 'with custom region override' do node.set['openstack']['block-storage']['region'] = 'volumeRegion' expect(chef_run).to create_endpoint_openstack_identity_register( - 'Register Cinder Volume Endpoint' + 'Register Cinder V2 Volume Endpoint' ).with(endpoint_region: 'volumeRegion') end end