diff --git a/manifests/compute.pp b/manifests/compute.pp index 97e75b6e5..fdcafe1ec 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -75,6 +75,11 @@ # The amount of memory in MB reserved for the host. # Defaults to '512' # +# [*reserved_host_disk*] +# Reserved host disk +# The amount of disk in MB reserved for the host. +# Defaults to $::os_service_default +# # [*config_drive_format*] # (optional) Config drive format. One of iso9660 (default) or vfat # Defaults to undef @@ -224,6 +229,7 @@ class nova::compute ( $instance_usage_audit_period = 'month', $force_raw_images = true, $reserved_host_memory = '512', + $reserved_host_disk = $::os_service_default, $heal_instance_info_cache_interval = '60', $config_drive_format = $::os_service_default, $resize_confirm_window = $::os_service_default, @@ -369,6 +375,7 @@ Use the same parameter in nova::api class.') nova_config { 'DEFAULT/reserved_host_memory_mb': value => $reserved_host_memory; + 'DEFAULT/reserved_host_disk_mb': value => $reserved_host_disk; 'DEFAULT/reserved_huge_pages': value => $reserved_huge_pages_real; 'DEFAULT/heal_instance_info_cache_interval': value => $heal_instance_info_cache_interval; 'DEFAULT/resize_confirm_window': value => $resize_confirm_window; diff --git a/releasenotes/notes/reserved_host_disk-5caca50abf9e74b4.yaml b/releasenotes/notes/reserved_host_disk-5caca50abf9e74b4.yaml new file mode 100644 index 000000000..fd0fd757e --- /dev/null +++ b/releasenotes/notes/reserved_host_disk-5caca50abf9e74b4.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Add new parameter `reserved_host_disk`. This sets the amount of disk + resources in MB to make them always available to host. diff --git a/spec/classes/nova_compute_spec.rb b/spec/classes/nova_compute_spec.rb index 8eae26551..d08748626 100644 --- a/spec/classes/nova_compute_spec.rb +++ b/spec/classes/nova_compute_spec.rb @@ -24,6 +24,9 @@ describe 'nova::compute' do }) end + it { is_expected.to contain_nova_config('DEFAULT/reserved_host_memory_mb').with_value('512') } + it { is_expected.to contain_nova_config('DEFAULT/reserved_host_disk_mb').with_value('') } + it { is_expected.to contain_nova_config('DEFAULT/reserved_huge_pages').with_value('') } it { is_expected.to contain_nova_config('DEFAULT/resize_confirm_window').with_value('') } it { is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with_value('') } it { is_expected.to_not contain_nova_config('vnc/novncproxy_base_url') } @@ -37,7 +40,6 @@ describe 'nova::compute' do it { is_expected.to contain_nova_config('DEFAULT/sync_power_state_pool_size').with_value('') } it { is_expected.to contain_nova_config('DEFAULT/sync_power_state_interval').with_value('') } it { is_expected.to contain_nova_config('compute/consecutive_build_service_disable_threshold').with_value('') } - it { is_expected.to contain_nova_config('DEFAULT/reserved_huge_pages').with_value('') } it { is_expected.to contain_nova_config('compute/live_migration_wait_for_vif_plug').with_value('') } it { is_expected.to contain_nova_config('compute/max_disk_devices_to_attach').with_value('') } @@ -70,6 +72,7 @@ describe 'nova::compute' do :vncproxy_host => '127.0.0.1', :force_raw_images => false, :reserved_host_memory => '0', + :reserved_host_disk => '20', :heal_instance_info_cache_interval => '120', :config_drive_format => 'vfat', :resize_confirm_window => '3', @@ -104,10 +107,6 @@ describe 'nova::compute' do }) end - it 'configures ironic in nova.conf' do - is_expected.to contain_nova_config('DEFAULT/reserved_host_memory_mb').with_value('0') - end - it 'configures barbican service' do is_expected.to contain_nova_config('key_manager/backend').with_value('castellan.key_manager.barbican_key_manager.BarbicanKeyManager') is_expected.to contain_nova_config('barbican/barbican_endpoint').with_value('http://localhost') @@ -128,6 +127,8 @@ describe 'nova::compute' do is_expected.to contain_nova_config('spice/enabled').with_value(false) end + it { is_expected.to contain_nova_config('DEFAULT/reserved_host_memory_mb').with_value('0') } + it { is_expected.to contain_nova_config('DEFAULT/reserved_host_disk_mb').with_value('20') } it { is_expected.to contain_nova_config('DEFAULT/heal_instance_info_cache_interval').with_value('120') } it { is_expected.to contain_nova_config('DEFAULT/force_raw_images').with(:value => false) } it { is_expected.to contain_nova_config('DEFAULT/resize_confirm_window').with_value('3') }