From c36e1f0519b888c99cdcef6ef8d50a77139d52e3 Mon Sep 17 00:00:00 2001 From: Piotr Kopec Date: Wed, 19 Feb 2020 15:55:47 +0100 Subject: [PATCH] Add `max_disk_devices_to_attach` parameter This adds parameter that controls `compute/max_disk_devices_to_attach` Nova parameter which sets maximum number of disk devices allowed to attach to a single server. Change-Id: I2750f445f420bbee7e905d59efae9c642142b7e0 --- manifests/compute.pp | 12 ++++++++++++ ..._max_disk_devices_to_attach-061c48948416d8c5.yaml | 10 ++++++++++ spec/classes/nova_compute_spec.rb | 4 ++++ 3 files changed, 26 insertions(+) create mode 100644 releasenotes/notes/add_max_disk_devices_to_attach-061c48948416d8c5.yaml diff --git a/manifests/compute.pp b/manifests/compute.pp index f86d90234..975722355 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -172,6 +172,16 @@ # (optional) whether to wait for ``network-vif-plugged`` events before starting guest transfer # Defaults to $::os_service_default # +# [*max_disk_devices_to_attach*] +# (optional) specifies max number of devices that can be attached +# to a single server. +# Note that the number of disks supported by an server depends +# on the bus used. For example, the ide disk bus is limited +# to 4 attached devices. The configured maximum is enforced +# during server create, rebuild, evacuate, unshelve, live migrate, +# and attach volume. +# Defaults to $::os_service_default +# # DEPRECATED PARAMETERS # # [*vnc_keymap*] @@ -234,6 +244,7 @@ class nova::compute ( $neutron_physnets_numa_nodes_mapping = {}, $neutron_tunnel_numa_nodes = [], $live_migration_wait_for_vif_plug = $::os_service_default, + $max_disk_devices_to_attach = $::os_service_default, # DEPRECATED PARAMETERS $vnc_keymap = undef, $neutron_enabled = undef, @@ -368,6 +379,7 @@ class nova::compute ( 'compute/consecutive_build_service_disable_threshold': value => $consecutive_build_service_disable_threshold; 'compute/live_migration_wait_for_vif_plug': value => $live_migration_wait_for_vif_plug; + 'compute/max_disk_devices_to_attach': value => $max_disk_devices_to_attach; } ensure_resource('nova_config', 'DEFAULT/allow_resize_to_same_host', { value => $allow_resize_to_same_host }) diff --git a/releasenotes/notes/add_max_disk_devices_to_attach-061c48948416d8c5.yaml b/releasenotes/notes/add_max_disk_devices_to_attach-061c48948416d8c5.yaml new file mode 100644 index 000000000..f9cd5ce98 --- /dev/null +++ b/releasenotes/notes/add_max_disk_devices_to_attach-061c48948416d8c5.yaml @@ -0,0 +1,10 @@ +--- +features: + - | + Add parameter `max_disk_devices_to_attach` that specifies + max number of devices that can be attached to a single server. + Note that the number of disks supported by an server depends + on the bus used. For example, the ide disk bus is limited + to 4 attached devices. The configured maximum is enforced + during server create, rebuild, evacuate, unshelve, live migrate, + and attach volume. diff --git a/spec/classes/nova_compute_spec.rb b/spec/classes/nova_compute_spec.rb index d9068840a..707c09b1b 100644 --- a/spec/classes/nova_compute_spec.rb +++ b/spec/classes/nova_compute_spec.rb @@ -39,6 +39,7 @@ describe 'nova::compute' do 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('') } it { is_expected.to_not contain_package('cryptsetup').with( :ensure => 'present' )} @@ -100,6 +101,7 @@ describe 'nova::compute' do :verify_glance_signatures => true, :consecutive_build_service_disable_threshold => '9', :live_migration_wait_for_vif_plug => true, + :max_disk_devices_to_attach => 20, } end @@ -161,6 +163,8 @@ describe 'nova::compute' do it { is_expected.to contain_nova_config('compute/live_migration_wait_for_vif_plug').with_value(true) } + it { is_expected.to contain_nova_config('compute/max_disk_devices_to_attach').with_value(20) } + it 'configures nova config_drive_format to vfat' do is_expected.to contain_nova_config('DEFAULT/config_drive_format').with_value('vfat') is_expected.to_not contain_package('genisoimage').with(