From d4b5fae753a0f7d1b5d68d3286f400de160d5501 Mon Sep 17 00:00:00 2001 From: Min Pae Date: Fri, 28 Feb 2014 03:37:05 -0800 Subject: [PATCH] Add configuration for glance-api used by cinder. Adding configuration for glance-api used by cinder. This is necessary in multi-node installations to allow nova boot from an image based volume to work properly. Glance-api for cinder is currently being set to 127.0.0.1 by default. Closes-Bug: #1286088 Change-Id: I35f789e07ad317e7c8952beb4192c1f4159383d4 --- manifests/cinder/all.pp | 5 +++++ manifests/cinder/controller.pp | 4 ++++ manifests/cinder/storage.pp | 5 +++++ spec/classes/openstack_cinder_all_spec.rb | 3 +++ spec/classes/openstack_cinder_controller_spec.rb | 3 +++ spec/classes/openstack_cinder_storage_spec.rb | 3 +++ 6 files changed, 23 insertions(+) diff --git a/manifests/cinder/all.pp b/manifests/cinder/all.pp index c31a7e1..3c1f070 100644 --- a/manifests/cinder/all.pp +++ b/manifests/cinder/all.pp @@ -15,6 +15,7 @@ class openstack::cinder::all( $rabbit_hosts = undef, $rabbit_port = '5672', $rabbit_virtual_host = '/', + $glance_api_servers = '127.0.0.1:9292', # Database. Currently mysql is the only option. $db_type = 'mysql', $db_user = 'cinder', @@ -113,4 +114,8 @@ class openstack::cinder::all( } } } + + class { '::cinder::glance': + glance_api_servers => $glance_api_servers + } } diff --git a/manifests/cinder/controller.pp b/manifests/cinder/controller.pp index 856142f..95be914 100644 --- a/manifests/cinder/controller.pp +++ b/manifests/cinder/controller.pp @@ -15,6 +15,7 @@ class openstack::cinder::controller( $rabbit_hosts = false, $rabbit_port = '5672', $rabbit_virtual_host = '/', + $glance_api_servers = '127.0.0.1:9292', # Database. Currently mysql is the only option. $db_type = 'mysql', $db_user = 'cinder', @@ -80,4 +81,7 @@ class openstack::cinder::controller( enabled => $scheduler_enabled, } + class { '::cinder::glance': + glance_api_servers => $glance_api_servers + } } diff --git a/manifests/cinder/storage.pp b/manifests/cinder/storage.pp index 9f03ba3..38f7fca 100644 --- a/manifests/cinder/storage.pp +++ b/manifests/cinder/storage.pp @@ -6,6 +6,7 @@ class openstack::cinder::storage( $rabbit_hosts = false, $rabbit_port = '5672', $rabbit_virtual_host = '/', + $glance_api_servers = '127.0.0.1:9292', $package_ensure = 'present', $api_paste_config = '/etc/cinder/api-paste.ini', $volume_package_ensure = 'present', @@ -70,4 +71,8 @@ class openstack::cinder::storage( warning("Unsupported volume driver: ${volume_driver}, make sure you are configuring this yourself") } } + + class { '::cinder::glance': + glance_api_servers => $glance_api_servers + } } diff --git a/spec/classes/openstack_cinder_all_spec.rb b/spec/classes/openstack_cinder_all_spec.rb index 4613c6f..efda534 100644 --- a/spec/classes/openstack_cinder_all_spec.rb +++ b/spec/classes/openstack_cinder_all_spec.rb @@ -57,6 +57,9 @@ describe 'openstack::cinder::all' do :iscsi_ip_address => '127.0.0.1', :volume_group => 'cinder-volumes' ) + should contain_class('cinder::glance').with( + :glance_api_servers => '127.0.0.1:9292' + ) should_not contain_class('cinder::setup_test_volume') end diff --git a/spec/classes/openstack_cinder_controller_spec.rb b/spec/classes/openstack_cinder_controller_spec.rb index 518e081..859051d 100644 --- a/spec/classes/openstack_cinder_controller_spec.rb +++ b/spec/classes/openstack_cinder_controller_spec.rb @@ -49,6 +49,9 @@ describe 'openstack::cinder::controller' do :package_ensure => 'present', :enabled => true ) + should contain_class('cinder::glance').with( + :glance_api_servers => '127.0.0.1:9292' + ) end describe 'with custom syslog settings' do diff --git a/spec/classes/openstack_cinder_storage_spec.rb b/spec/classes/openstack_cinder_storage_spec.rb index 225d61f..2880142 100644 --- a/spec/classes/openstack_cinder_storage_spec.rb +++ b/spec/classes/openstack_cinder_storage_spec.rb @@ -37,6 +37,9 @@ describe 'openstack::cinder::storage' do :iscsi_ip_address => '127.0.0.1', :volume_group => 'cinder-volumes' ) + should contain_class('cinder::glance').with( + :glance_api_servers => '127.0.0.1:9292' + ) should_not contain_class('cinder::setup_test_volume') end