Browse Source

Merge "Add support for image download via rbd" into stable/victoria

changes/31/774631/1
Zuul 6 months ago
committed by Gerrit Code Review
parent
commit
4c10e4343f
  1. 47
      manifests/glance.pp
  2. 5
      releasenotes/notes/image-download-via-rbd-159f6ccd7fada555.yaml
  3. 53
      spec/classes/nova_glance_spec.rb

47
manifests/glance.pp

@ -0,0 +1,47 @@
# == Class: nova::glance
#
# Configure usage of the glance service in nova
#
# === Parameters
#
# [*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 (
$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
nova_config {
'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;
}
}

5
releasenotes/notes/image-download-via-rbd-159f6ccd7fada555.yaml

@ -0,0 +1,5 @@
---
features:
- |
Now puppet-nova supports configurations required to download Glance images
into the libvirt image cache via RBD.

53
spec/classes/nova_glance_spec.rb

@ -0,0 +1,53 @@
require 'spec_helper'
describe 'nova::glance' do
shared_examples_for 'nova::glance' do
context 'with default params' do
let :params do
{}
end
it 'configure default params' do
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
context 'with specific parameters' do
let :params do
{
: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/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
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'nova::glance'
end
end
end
Loading…
Cancel
Save