Browse Source

Add snapshorts directory config option

Change-Id: Ifba4f0738113341db54d1abd9919bc8c2327961b
(cherry picked from commit ea62370b1e)
changes/18/761118/1
Rocky 9 months ago
parent
commit
c20b005857
  1. 7
      manifests/compute/libvirt.pp
  2. 5
      releasenotes/notes/add_snapshots_directory_option-f67c0b93bb6b6d38.yaml
  3. 3
      spec/classes/nova_compute_libvirt_spec.rb

7
manifests/compute/libvirt.pp

@ -44,6 +44,11 @@
# have a preference and only operate on raw or qcow2
# Defaults to $::os_service_default
#
# [*snapshots_directory*]
# (optional) Location where libvirt driver will store snapshots before
# uploading them to image service
# Defaults to $::os_service_default
#
# [*disk_cachemodes*]
# (optional) A list of cachemodes for different disk types, e.g.
# ["file=directsync", "block=none"]
@ -291,6 +296,7 @@ class nova::compute::libvirt (
$cpu_models = [],
$cpu_model_extra_flags = undef,
$snapshot_image_format = $::os_service_default,
$snapshots_directory = $::os_service_default,
$disk_cachemodes = [],
$hw_disk_discard = $::os_service_default,
$hw_machine_type = $::os_service_default,
@ -556,6 +562,7 @@ in a future release. Use the enabled_perf_events parameter instead')
'libvirt/virt_type': value => $virt_type_real;
'libvirt/cpu_mode': value => $cpu_mode_default;
'libvirt/snapshot_image_format': value => $snapshot_image_format_real;
'libvirt/snapshots_directory': value => $snapshots_directory;
'libvirt/inject_password': value => $inject_password_real;
'libvirt/inject_key': value => $inject_key_real;
'libvirt/inject_partition': value => $inject_partition_real;

5
releasenotes/notes/add_snapshots_directory_option-f67c0b93bb6b6d38.yaml

@ -0,0 +1,5 @@
---
features:
- |
Add the parameter ``snapshots_directory`` to specify the location where
libvirt driver will store snapshots before uploading them to image service.

3
spec/classes/nova_compute_libvirt_spec.rb

@ -53,6 +53,7 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_nova_config('libvirt/cpu_model').with_ensure('absent')}
it { is_expected.to contain_nova_config('libvirt/cpu_model_extra_flags').with_ensure('absent')}
it { is_expected.to contain_nova_config('libvirt/snapshot_image_format').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_nova_config('libvirt/snapshots_directory').with_value('<SERVICE DEFAULT>')}
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)}
@ -83,6 +84,7 @@ describe 'nova::compute::libvirt' do
:cpu_models => ['kvm64', 'qemu64'],
:cpu_model_extra_flags => 'pcid',
:snapshot_image_format => 'raw',
:snapshots_directory => '/var/lib/nova/snapshots',
:disk_cachemodes => ['file=directsync','block=none'],
:hw_disk_discard => 'unmap',
:hw_machine_type => 'x86_64=machinetype1,armv7l=machinetype2',
@ -121,6 +123,7 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_nova_config('libvirt/cpu_model').with_ensure('absent')}
it { is_expected.to contain_nova_config('libvirt/cpu_model_extra_flags').with_value('pcid')}
it { is_expected.to contain_nova_config('libvirt/snapshot_image_format').with_value('raw')}
it { is_expected.to contain_nova_config('libvirt/snapshots_directory').with_value('/var/lib/nova/snapshots')}
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('libvirt/hw_machine_type').with_value('x86_64=machinetype1,armv7l=machinetype2')}

Loading…
Cancel
Save