add rbd backend support to glance
Change-Id: I03b59e627b66e744a6efe45db24b8929e75f5e2e
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
# [db_user] Name of glance DB user. Optional. Defaults to 'glance'
|
# [db_user] Name of glance DB user. Optional. Defaults to 'glance'
|
||||||
# [db_name] Name of glance DB. Optional. Defaults to 'glance'
|
# [db_name] Name of glance DB. Optional. Defaults to 'glance'
|
||||||
# [backend] Backends used to store images. Defaults to file.
|
# [backend] Backends used to store images. Defaults to file.
|
||||||
|
# [rbd_store_user] The RBD store user name.
|
||||||
|
# [rbd_store_pool] The RBD pool name to store images.
|
||||||
# [swift_store_user] The Swift service user account. Defaults to false.
|
# [swift_store_user] The Swift service user account. Defaults to false.
|
||||||
# [swift_store_key] The Swift service user password Defaults to false.
|
# [swift_store_key] The Swift service user password Defaults to false.
|
||||||
# [swift_store_auth_addres] The URL where the Swift auth service lives. Defaults to "http://${keystone_host}:5000/v2.0/"
|
# [swift_store_auth_addres] The URL where the Swift auth service lives. Defaults to "http://${keystone_host}:5000/v2.0/"
|
||||||
@@ -52,6 +54,8 @@ class openstack::glance (
|
|||||||
$swift_store_user = false,
|
$swift_store_user = false,
|
||||||
$swift_store_key = false,
|
$swift_store_key = false,
|
||||||
$swift_store_auth_address = 'http://127.0.0.1:5000/v2.0/',
|
$swift_store_auth_address = 'http://127.0.0.1:5000/v2.0/',
|
||||||
|
$rbd_store_user = undef,
|
||||||
|
$rbd_store_pool = 'images',
|
||||||
$verbose = false,
|
$verbose = false,
|
||||||
$debug = false,
|
$debug = false,
|
||||||
$enabled = true
|
$enabled = true
|
||||||
@@ -115,6 +119,11 @@ class openstack::glance (
|
|||||||
} elsif($backend == 'file') {
|
} elsif($backend == 'file') {
|
||||||
# Configure file storage backend
|
# Configure file storage backend
|
||||||
class { 'glance::backend::file': }
|
class { 'glance::backend::file': }
|
||||||
|
} elsif($backend == 'rbd') {
|
||||||
|
class { 'glance::backend::rbd':
|
||||||
|
rbd_store_user => $rbd_store_user,
|
||||||
|
rbd_store_pool => $rbd_store_pool,
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fail("Unsupported backend ${backend}")
|
fail("Unsupported backend ${backend}")
|
||||||
}
|
}
|
||||||
|
@@ -111,4 +111,27 @@ describe 'openstack::glance' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'when configuring rbd as the backend' do
|
||||||
|
|
||||||
|
before do
|
||||||
|
params.merge!({
|
||||||
|
:backend => 'rbd',
|
||||||
|
:rbd_store_user => 'don',
|
||||||
|
:rbd_store_pool => 'images'
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should configure rbd as the backend' do
|
||||||
|
should_not contain_class('glance::backend::file')
|
||||||
|
|
||||||
|
should_not contain_class('glance::backend::swift')
|
||||||
|
|
||||||
|
should contain_class('glance::backend::rbd').with(
|
||||||
|
:rbd_store_user => 'don',
|
||||||
|
:rbd_store_pool => 'images'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user