Adds snapshot_image_format configuration
Some filesystems deal better with snapshots in a particular format to handle deduplication and cloning. This adds support for configuring this. Change-Id: Ic3027ac4bb89e8d596a92ba0d517f80a69c65214 Implements: add_snapshot_image_format Closes-Bug: #1671575 (cherry picked from commit630ebbc874
) (cherry picked from commit70195d886b
)
This commit is contained in:
parent
a64ddc7f28
commit
f29635814b
|
@ -33,6 +33,11 @@
|
|||
# cpu_mode="custom" and virt_type="kvm|qemu".
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*libvirt_snapshot_image_format*]
|
||||
# (optional) Format to save snapshots to. Some filesystems
|
||||
# have a preference and only operate on raw or qcow2
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*libvirt_disk_cachemodes*]
|
||||
# (optional) A list of cachemodes for different disk types, e.g.
|
||||
# ["file=directsync", "block=none"]
|
||||
|
@ -111,6 +116,7 @@ class nova::compute::libvirt (
|
|||
$migration_support = false,
|
||||
$libvirt_cpu_mode = false,
|
||||
$libvirt_cpu_model = undef,
|
||||
$libvirt_snapshot_image_format = $::os_service_default,
|
||||
$libvirt_disk_cachemodes = [],
|
||||
$libvirt_hw_disk_discard = $::os_service_default,
|
||||
$libvirt_inject_password = false,
|
||||
|
@ -177,14 +183,15 @@ class nova::compute::libvirt (
|
|||
}
|
||||
|
||||
nova_config {
|
||||
'DEFAULT/compute_driver': value => $compute_driver;
|
||||
'vnc/vncserver_listen': value => $vncserver_listen;
|
||||
'libvirt/virt_type': value => $libvirt_virt_type;
|
||||
'libvirt/cpu_mode': value => $libvirt_cpu_mode_real;
|
||||
'libvirt/inject_password': value => $libvirt_inject_password;
|
||||
'libvirt/inject_key': value => $libvirt_inject_key;
|
||||
'libvirt/inject_partition': value => $libvirt_inject_partition;
|
||||
'libvirt/hw_disk_discard': value => $libvirt_hw_disk_discard;
|
||||
'DEFAULT/compute_driver': value => $compute_driver;
|
||||
'vnc/vncserver_listen': value => $vncserver_listen;
|
||||
'libvirt/virt_type': value => $libvirt_virt_type;
|
||||
'libvirt/cpu_mode': value => $libvirt_cpu_mode_real;
|
||||
'libvirt/snapshot_image_format': value => $libvirt_snapshot_image_format;
|
||||
'libvirt/inject_password': value => $libvirt_inject_password;
|
||||
'libvirt/inject_key': value => $libvirt_inject_key;
|
||||
'libvirt/inject_partition': value => $libvirt_inject_partition;
|
||||
'libvirt/hw_disk_discard': value => $libvirt_hw_disk_discard;
|
||||
}
|
||||
|
||||
# cpu_model param is only valid if cpu_mode=custom
|
||||
|
|
|
@ -49,6 +49,7 @@ describe 'nova::compute::libvirt' do
|
|||
it { is_expected.to contain_nova_config('libvirt/virt_type').with_value('kvm')}
|
||||
it { is_expected.to contain_nova_config('libvirt/cpu_mode').with_value('host-model')}
|
||||
it { is_expected.to contain_nova_config('libvirt/cpu_model').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/snapshot_image_format').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/disk_cachemodes').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/inject_password').with_value(false)}
|
||||
it { is_expected.to contain_nova_config('libvirt/inject_key').with_value(false)}
|
||||
|
@ -66,6 +67,7 @@ describe 'nova::compute::libvirt' do
|
|||
:vncserver_listen => '0.0.0.0',
|
||||
:libvirt_cpu_mode => 'host-passthrough',
|
||||
:libvirt_cpu_model => 'kvm64',
|
||||
:libvirt_snapshot_image_format => 'raw',
|
||||
:libvirt_disk_cachemodes => ['file=directsync','block=none'],
|
||||
:libvirt_hw_disk_discard => 'unmap',
|
||||
:remove_unused_base_images => true,
|
||||
|
@ -86,6 +88,7 @@ describe 'nova::compute::libvirt' do
|
|||
it { is_expected.to contain_nova_config('libvirt/virt_type').with_value('qemu')}
|
||||
it { is_expected.to contain_nova_config('libvirt/cpu_mode').with_value('host-passthrough')}
|
||||
it { is_expected.to contain_nova_config('libvirt/cpu_model').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/snapshot_image_format').with_ensure('absent')}
|
||||
it { is_expected.to contain_nova_config('libvirt/disk_cachemodes').with_value('file=directsync,block=none')}
|
||||
it { is_expected.to contain_nova_config('libvirt/hw_disk_discard').with_value('unmap')}
|
||||
it { is_expected.to contain_nova_config('vnc/vncserver_listen').with_value('0.0.0.0')}
|
||||
|
@ -123,6 +126,14 @@ describe 'nova::compute::libvirt' do
|
|||
it { is_expected.to contain_nova_config('libvirt/cpu_model').with_value('kvm64')}
|
||||
end
|
||||
|
||||
describe 'with qcow2 as snapshot_image_format' do
|
||||
let :params do
|
||||
{ :libvirt_snapshot_image_format => 'qcow2' }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_nova_config('libvirt/snapshot_image_format').with_value('qcow2')}
|
||||
end
|
||||
|
||||
describe 'with qemu as virt_type' do
|
||||
let :params do
|
||||
{ :libvirt_virt_type => 'qemu' }
|
||||
|
|
Loading…
Reference in New Issue