Add image preallocation mode option
Image preallocation allows storage to be fully allocated at instance start. This should significantly improve performance on writes to new blocks and may even improve I/O performance to prewritten blocks due to reduced fragmentation. Change-Id: I1be99c9af8f32b1a7f8408ddeb695fd05a603ace
This commit is contained in:

committed by
Alex Schultz

parent
7b897406aa
commit
abe5075878
@@ -101,6 +101,11 @@
|
|||||||
# (optional) Compute driver.
|
# (optional) Compute driver.
|
||||||
# Defaults to 'libvirt.LibvirtDriver'
|
# Defaults to 'libvirt.LibvirtDriver'
|
||||||
#
|
#
|
||||||
|
# [*preallocate_images*]
|
||||||
|
# (optional) The image preallocation mode to use.
|
||||||
|
# Valid values are 'none' or 'space'.
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
# [*manage_libvirt_services*]
|
# [*manage_libvirt_services*]
|
||||||
# (optional) Whether or not deploy Libvirt services.
|
# (optional) Whether or not deploy Libvirt services.
|
||||||
# In the case of micro-services, set it to False and use
|
# In the case of micro-services, set it to False and use
|
||||||
@@ -128,6 +133,7 @@ class nova::compute::libvirt (
|
|||||||
$virtlock_service_name = $::nova::params::virtlock_service_name,
|
$virtlock_service_name = $::nova::params::virtlock_service_name,
|
||||||
$virtlog_service_name = $::nova::params::virtlog_service_name,
|
$virtlog_service_name = $::nova::params::virtlog_service_name,
|
||||||
$compute_driver = 'libvirt.LibvirtDriver',
|
$compute_driver = 'libvirt.LibvirtDriver',
|
||||||
|
$preallocate_images = $::os_service_default,
|
||||||
$manage_libvirt_services = true,
|
$manage_libvirt_services = true,
|
||||||
) inherits nova::params {
|
) inherits nova::params {
|
||||||
|
|
||||||
@@ -186,15 +192,16 @@ class nova::compute::libvirt (
|
|||||||
}
|
}
|
||||||
|
|
||||||
nova_config {
|
nova_config {
|
||||||
'DEFAULT/compute_driver': value => $compute_driver;
|
'DEFAULT/compute_driver': value => $compute_driver;
|
||||||
'vnc/vncserver_listen': value => $vncserver_listen;
|
'DEFAULT/preallocate_images': value => $preallocate_images;
|
||||||
'libvirt/virt_type': value => $libvirt_virt_type;
|
'vnc/vncserver_listen': value => $vncserver_listen;
|
||||||
'libvirt/cpu_mode': value => $libvirt_cpu_mode_real;
|
'libvirt/virt_type': value => $libvirt_virt_type;
|
||||||
'libvirt/inject_password': value => $libvirt_inject_password;
|
'libvirt/cpu_mode': value => $libvirt_cpu_mode_real;
|
||||||
'libvirt/inject_key': value => $libvirt_inject_key;
|
'libvirt/inject_password': value => $libvirt_inject_password;
|
||||||
'libvirt/inject_partition': value => $libvirt_inject_partition;
|
'libvirt/inject_key': value => $libvirt_inject_key;
|
||||||
'libvirt/hw_disk_discard': value => $libvirt_hw_disk_discard;
|
'libvirt/inject_partition': value => $libvirt_inject_partition;
|
||||||
'libvirt/hw_machine_type': value => $libvirt_hw_machine_type;
|
'libvirt/hw_disk_discard': value => $libvirt_hw_disk_discard;
|
||||||
|
'libvirt/hw_machine_type': value => $libvirt_hw_machine_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
# cpu_model param is only valid if cpu_mode=custom
|
# cpu_model param is only valid if cpu_mode=custom
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Added preallocate_images option which allows storage for instance images
|
||||||
|
to be allocated up front when the instance is initially provisioned.
|
||||||
|
This should significantly improve performance on writes to new blocks.
|
@@ -46,6 +46,7 @@ describe 'nova::compute::libvirt' do
|
|||||||
}
|
}
|
||||||
|
|
||||||
it { is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
it { is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')}
|
||||||
|
it { is_expected.to contain_nova_config('DEFAULT/preallocate_images').with_value('<SERVICE DEFAULT>')}
|
||||||
it { is_expected.to contain_nova_config('libvirt/virt_type').with_value('kvm')}
|
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_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/cpu_model').with_ensure('absent')}
|
||||||
@@ -76,6 +77,7 @@ describe 'nova::compute::libvirt' do
|
|||||||
:virtlock_service_name => 'virtlock',
|
:virtlock_service_name => 'virtlock',
|
||||||
:virtlog_service_name => 'virtlog',
|
:virtlog_service_name => 'virtlog',
|
||||||
:compute_driver => 'libvirt.FoobarDriver',
|
:compute_driver => 'libvirt.FoobarDriver',
|
||||||
|
:preallocate_images => 'space',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -84,6 +86,7 @@ describe 'nova::compute::libvirt' do
|
|||||||
:ensure => 'latest'
|
:ensure => 'latest'
|
||||||
) }
|
) }
|
||||||
it { is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.FoobarDriver')}
|
it { is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.FoobarDriver')}
|
||||||
|
it { is_expected.to contain_nova_config('DEFAULT/preallocate_images').with_value('space')}
|
||||||
it { is_expected.to contain_nova_config('libvirt/virt_type').with_value('qemu')}
|
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_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/cpu_model').with_ensure('absent')}
|
||||||
|
Reference in New Issue
Block a user