Allow Controller to manage volumes

Both the basic install guide, and full install guide describe having the controller run cinder-volume:

http://docs.openstack.org/grizzly/basic-install/apt/content/basic-install_controller.html#basic-install_controller-cinder
http://docs.openstack.org/grizzly/openstack-compute/install/apt/content/cinder-install.html

Right now this only supports an LVM backend, but could be extended in the future to support other volume backends.

Change-Id: I59eb05227b264dba164161e9d14502ba2af0f5c2
This commit is contained in:
Logan McNaughton
2013-07-16 15:46:26 +00:00
parent c57bf80e60
commit c73b391c7d
4 changed files with 19 additions and 5 deletions

View File

@@ -20,6 +20,7 @@ class openstack::cinder::all(
$db_user = 'cinder',
$db_host = '127.0.0.1',
$db_dbname = 'cinder',
$sql_idle_timeout = '3600',
$package_ensure = present,
$bind_host = '0.0.0.0',
$api_paste_config = '/etc/cinder/api-paste.ini',
@@ -30,6 +31,7 @@ class openstack::cinder::all(
$iscsi_ip_address = '127.0.0.1',
$setup_test_volume = false,
$manage_volumes = true,
$debug = false,
$verbose = false
) {
@@ -43,6 +45,7 @@ class openstack::cinder::all(
class {'::cinder':
sql_connection => $sql_connection,
sql_idle_timeout => $sql_idle_timeout,
rpc_backend => $rpc_backend,
rabbit_userid => $rabbit_userid,
rabbit_password => $rabbit_password,
@@ -52,6 +55,7 @@ class openstack::cinder::all(
rabbit_virtual_host => $rabbit_virtual_host,
package_ensure => $package_ensure,
api_paste_config => $api_paste_config,
debug => $debug,
verbose => $verbose,
}

View File

@@ -219,6 +219,10 @@ class openstack::controller (
$cinder_db_user = 'cinder',
$cinder_db_dbname = 'cinder',
$cinder_bind_address = '0.0.0.0',
$manage_volumes = false,
$volume_group = 'cinder-volumes',
$setup_test_volume = false,
$iscsi_ip_address = '127.0.0.1',
# Neutron
$neutron = true,
$physical_network = 'default',
@@ -508,7 +512,7 @@ class openstack::controller (
fail('Must set cinder user password when setting up a cinder controller')
}
class { 'openstack::cinder::controller':
class { 'openstack::cinder::all':
bind_host => $cinder_bind_address,
sql_idle_timeout => $sql_idle_timeout,
keystone_auth_host => $keystone_host,
@@ -522,8 +526,11 @@ class openstack::controller (
db_user => $cinder_db_user,
db_type => $db_type,
db_host => $db_host,
api_enabled => $enabled,
scheduler_enabled => $enabled,
manage_volumes => $manage_volumes,
volume_group => $volume_group,
setup_test_volume => $setup_test_volume,
iscsi_ip_address => $iscsi_ip_address,
enabled => $enabled,
debug => $debug,
verbose => $verbose
}

View File

@@ -17,6 +17,7 @@ describe 'openstack::cinder::all' do
it 'should configure using the default values' do
should contain_class('cinder').with(
:sql_connection => "mysql://cinder:#{params[:db_password]}@127.0.0.1/cinder?charset=utf8",
:sql_idle_timeout => '3600',
:rpc_backend => 'cinder.openstack.common.rpc.impl_kombu',
:rabbit_userid => 'openstack',
:rabbit_password => params[:rabbit_password],
@@ -26,6 +27,7 @@ describe 'openstack::cinder::all' do
:rabbit_virtual_host => '/',
:package_ensure => 'present',
:api_paste_config => '/etc/cinder/api-paste.ini',
:debug => false,
:verbose => false
)
should contain_class('cinder::api').with(

View File

@@ -160,7 +160,7 @@ describe 'openstack::controller' do
end
end
context 'when account secutiry is not enabled' do
context 'when account security is not enabled' do
let :params do
default_params.merge(
{:mysql_account_security => false}
@@ -523,7 +523,8 @@ describe 'openstack::controller' do
it 'should not contain cinder classes' do
should_not contain_class('cinder')
should_not contain_class('cinder::api')
should_not contain_class('cinder:"scheduler')
should_not contain_class('cinder::scheduler')
should_not contain_class('cinder::volume')
end
end