Add support for the libvirt/hw_disk_discard option
The Ceph RBD deployment guide for OpenStack [1] suggests use of hw_disk_discard from Juno. This change adds support into the module for such a config option. 1. http://docs.ceph.com/docs/master/rbd/rbd-openstack/ Change-Id: Ib0198d63d7e1de4677a1345da1f710277a63d13b
This commit is contained in:
@@ -40,6 +40,11 @@
|
||||
# will be removed from nova.conf completely.
|
||||
# Defaults to an empty list
|
||||
#
|
||||
# [*libvirt_hw_disk_discard*]
|
||||
# (optional) Discard option for nova managed disks. Need Libvirt(1.0.6)
|
||||
# Qemu1.5 (raw format) Qemu1.6(qcow2 format).
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*libvirt_inject_password*]
|
||||
# (optional) Inject the admin password at boot time, without an agent.
|
||||
# Defaults to false
|
||||
@@ -100,6 +105,7 @@ class nova::compute::libvirt (
|
||||
$libvirt_cpu_mode = false,
|
||||
$libvirt_cpu_model = undef,
|
||||
$libvirt_disk_cachemodes = [],
|
||||
$libvirt_hw_disk_discard = $::os_service_default,
|
||||
$libvirt_inject_password = false,
|
||||
$libvirt_inject_key = false,
|
||||
$libvirt_inject_partition = -2,
|
||||
@@ -196,6 +202,7 @@ class nova::compute::libvirt (
|
||||
'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
|
||||
|
@@ -62,6 +62,7 @@ describe 'nova::compute::libvirt' do
|
||||
:libvirt_cpu_mode => 'host-passthrough',
|
||||
:libvirt_cpu_model => 'kvm64',
|
||||
:libvirt_disk_cachemodes => ['file=directsync','block=none'],
|
||||
:libvirt_hw_disk_discard => 'unmap',
|
||||
:remove_unused_base_images => true,
|
||||
:remove_unused_kernels => true,
|
||||
:remove_unused_resized_minimum_age_seconds => 3600,
|
||||
@@ -80,6 +81,7 @@ describe 'nova::compute::libvirt' do
|
||||
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/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')}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_value(true)}
|
||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}
|
||||
|
Reference in New Issue
Block a user