Add support for image download via rbd
This change introduces some new parameters to the nova::glance class, which are required for the new feature to download glance image via RBD instead of API[1]. [1] https://review.opendev.org/c/openstack/nova/+/574301 Change-Id: I0c9ebc5fd980204c59cc903372820e1ee1245630
This commit is contained in:
parent
6b99fa975e
commit
896bf1ff5e
|
@ -12,9 +12,37 @@
|
|||
# (optional) Number of retries in glance operation
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*enable_rbd_download*]
|
||||
# (optional) Enable download of Glance images directly via RBD
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rbd_user*]
|
||||
# (optional) The RADOS client name for accessing Glance images stored as
|
||||
# rbd volumes.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rbd_connect_timeout*]
|
||||
# (optional) THe RADOS client timeout in seconds when initially connecting
|
||||
# to the cluster.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rbd_pool*]
|
||||
# (optional) The RADOS pool in which the Glance images are stored as rbd
|
||||
# volumes.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rbd_ceph_conf*]
|
||||
# (optional) Path to the ceph configuration file to use.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
class nova::glance (
|
||||
$endpoint_override = $::os_service_default,
|
||||
$num_retries = $::os_service_default,
|
||||
$enable_rbd_download = $::os_service_default,
|
||||
$rbd_user = $::os_service_default,
|
||||
$rbd_connect_timeout = $::os_service_default,
|
||||
$rbd_pool = $::os_service_default,
|
||||
$rbd_ceph_conf = $::os_service_default,
|
||||
) {
|
||||
|
||||
include nova::deps
|
||||
|
@ -25,5 +53,10 @@ class nova::glance (
|
|||
nova_config {
|
||||
'glance/endpoint_override': value => $endpoint_override_real;
|
||||
'glance/num_retries': value => $num_retries_real;
|
||||
'glance/enable_rbd_download': value => $enable_rbd_download;
|
||||
'glance/rbd_user': value => $rbd_user;
|
||||
'glance/rbd_connect_timeout': value => $rbd_connect_timeout;
|
||||
'glance/rbd_pool': value => $rbd_pool;
|
||||
'glance/rbd_ceph_conf': value => $rbd_ceph_conf;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Now puppet-nova supports configurations required to download Glance images
|
||||
into the libvirt image cache via RBD.
|
|
@ -11,6 +11,11 @@ describe 'nova::glance' do
|
|||
it 'configure default params' do
|
||||
is_expected.to contain_nova_config('glance/endpoint_override').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('glance/num_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('glance/enable_rbd_download').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('glance/rbd_user').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('glance/rbd_connect_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('glance/rbd_pool').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('glance/rbd_ceph_conf').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -19,12 +24,22 @@ describe 'nova::glance' do
|
|||
{
|
||||
:endpoint_override => 'http://localhost:9292',
|
||||
:num_retries => 3,
|
||||
:enable_rbd_download => true,
|
||||
:rbd_user => 'nova',
|
||||
:rbd_connect_timeout => 5,
|
||||
:rbd_pool => 'images',
|
||||
:rbd_ceph_conf => '/etc/ceph/ceph.conf',
|
||||
}
|
||||
end
|
||||
|
||||
it 'configure glance params' do
|
||||
is_expected.to contain_nova_config('glance/endpoint_override').with_value('http://localhost:9292')
|
||||
is_expected.to contain_nova_config('glance/num_retries').with_value(3)
|
||||
is_expected.to contain_nova_config('glance/enable_rbd_download').with_value(true)
|
||||
is_expected.to contain_nova_config('glance/rbd_user').with_value('nova')
|
||||
is_expected.to contain_nova_config('glance/rbd_connect_timeout').with_value(5)
|
||||
is_expected.to contain_nova_config('glance/rbd_pool').with_value('images')
|
||||
is_expected.to contain_nova_config('glance/rbd_ceph_conf').with_value('/etc/ceph/ceph.conf')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue