diff --git a/manifests/conductor.pp b/manifests/conductor.pp index cda815a7..d9b3da19 100644 --- a/manifests/conductor.pp +++ b/manifests/conductor.pp @@ -50,6 +50,10 @@ # (optional) ironic-conductor node's HTTP root path. # Defaults to $::os_service_default # +# [*force_raw_images*] +# (optional) If true, convert backing images to "raw" disk image format. +# Defaults to $::os_service_default +# # [*automated_clean*] # (optional) Whether to enable automated cleaning on nodes. # Defaults to $::os_service_default @@ -178,6 +182,7 @@ class ironic::conductor ( $force_power_state_during_sync = true, $http_url = $::os_service_default, $http_root = $::os_service_default, + $force_raw_images = $::os_service_default, $automated_clean = $::os_service_default, $cleaning_network = $::os_service_default, $cleaning_disk_erase = undef, @@ -271,6 +276,7 @@ class ironic::conductor ( 'conductor/api_url': value => $api_url; 'deploy/http_url': value => $http_url; 'deploy/http_root': value => $http_root; + 'DEFAULT/force_raw_images': value => $force_raw_images; 'deploy/erase_devices_priority': value => $erase_devices_priority; 'deploy/erase_devices_metadata_priority': value => $erase_devices_metadata_priority; 'deploy/continue_if_disk_secure_erase_fails': value => $continue_if_disk_secure_erase_fails; diff --git a/manifests/drivers/agent.pp b/manifests/drivers/agent.pp index 25c85678..f6a5ad86 100644 --- a/manifests/drivers/agent.pp +++ b/manifests/drivers/agent.pp @@ -19,6 +19,13 @@ # of first caching them in memory. Ignored when iSCSI is used for deploy. # Defaults to $::os_service_default # +# [*image_download_source*] +# (optional) Specifies whether direct deploy interface should try to use +# the image source directly or if ironic should cache the image on +# the conductor and serve it from ironic's own http server. +# Accepts values "swift" (the default) or "http". +# Defaults to $::os_service_default +# # [*post_deploy_get_power_state_retries*] # (optional) Number of retries getting power state after a soft power off. # Must be a valid interger. @@ -56,6 +63,7 @@ class ironic::drivers::agent ( $stream_raw_images = $::os_service_default, + $image_download_source = $::os_service_default, $post_deploy_get_power_state_retries = $::os_service_default, $post_deploy_get_power_state_retry_interval = $::os_service_default, $deploy_logs_collect = $::os_service_default, @@ -70,6 +78,7 @@ class ironic::drivers::agent ( # Configure ironic.conf ironic_config { 'agent/stream_raw_images': value => $stream_raw_images; + 'agent/image_download_source': value => $image_download_source; 'agent/post_deploy_get_power_state_retries': value => $post_deploy_get_power_state_retries; 'agent/post_deploy_get_power_state_retry_interval': value => $post_deploy_get_power_state_retry_interval; 'agent/deploy_logs_collect': value => $deploy_logs_collect; diff --git a/releasenotes/notes/image-download-source-f4882929aa669b30.yaml b/releasenotes/notes/image-download-source-f4882929aa669b30.yaml new file mode 100644 index 00000000..4127d4b2 --- /dev/null +++ b/releasenotes/notes/image-download-source-f4882929aa669b30.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Adds ``ironic::conductor::force_raw_images`` which controls whether ironic + forces the image format to be raw before deployment. + - | + Adds ``ironic::drivers::agent::image_download_source`` which controls how + ironic serves the image when using the ``direct`` deploy interface: via + swift or via its local HTTP server. diff --git a/spec/classes/ironic_conductor_spec.rb b/spec/classes/ironic_conductor_spec.rb index 95db2c7f..2f75ce29 100644 --- a/spec/classes/ironic_conductor_spec.rb +++ b/spec/classes/ironic_conductor_spec.rb @@ -74,6 +74,7 @@ describe 'ironic::conductor' do is_expected.to contain_ironic_config('deploy/continue_if_disk_secure_erase_fails').with(:value => '') is_expected.to contain_ironic_config('deploy/http_url').with(:value => '') is_expected.to contain_ironic_config('deploy/http_root').with(:value => '') + is_expected.to contain_ironic_config('DEFAULT/force_raw_images').with(:value => '') is_expected.to contain_ironic_config('conductor/configdrive_use_swift').with(:value => '') is_expected.to contain_ironic_config('conductor/configdrive_swift_container').with(:value => '') is_expected.to contain_ironic_config('conductor/inspect_wait_timeout').with(:value => '') @@ -101,6 +102,7 @@ describe 'ironic::conductor' do :cleaning_disk_erase => 'metadata', :http_url => 'http://host:port', :http_root => '/src/www', + :force_raw_images => false, :configdrive_use_swift => true, :configdrive_swift_container => 'cont', :inspect_timeout => 600, @@ -127,6 +129,7 @@ describe 'ironic::conductor' do is_expected.to contain_ironic_config('deploy/erase_devices_metadata_priority').with_value(10) is_expected.to contain_ironic_config('deploy/http_url').with_value(p[:http_url]) is_expected.to contain_ironic_config('deploy/http_root').with_value(p[:http_root]) + is_expected.to contain_ironic_config('DEFAULT/force_raw_images').with_value(p[:force_raw_images]) is_expected.to contain_ironic_config('conductor/configdrive_use_swift').with_value(p[:configdrive_use_swift]) is_expected.to contain_ironic_config('conductor/configdrive_swift_container').with_value(p[:configdrive_swift_container]) is_expected.to contain_ironic_config('conductor/inspect_wait_timeout').with_value(p[:inspect_timeout]) diff --git a/spec/classes/ironic_drivers_agent_spec.rb b/spec/classes/ironic_drivers_agent_spec.rb index a530d12d..4f0ae8ff 100644 --- a/spec/classes/ironic_drivers_agent_spec.rb +++ b/spec/classes/ironic_drivers_agent_spec.rb @@ -28,6 +28,7 @@ describe 'ironic::drivers::agent' do it 'configures ironic.conf' do is_expected.to contain_ironic_config('agent/stream_raw_images').with_value('') + is_expected.to contain_ironic_config('agent/image_download_source').with_value('') is_expected.to contain_ironic_config('agent/post_deploy_get_power_state_retries').with_value('') is_expected.to contain_ironic_config('agent/post_deploy_get_power_state_retry_interval').with_value('') is_expected.to contain_ironic_config('agent/deploy_logs_collect').with_value('') @@ -40,6 +41,7 @@ describe 'ironic::drivers::agent' do context 'when overriding parameters' do before do params.merge!(:stream_raw_images => false, + :image_download_source => 'http', :post_deploy_get_power_state_retries => 20, :post_deploy_get_power_state_retry_interval => 10, :deploy_logs_collect => 'always', @@ -50,6 +52,7 @@ describe 'ironic::drivers::agent' do end it 'should replace default parameter with new value' do is_expected.to contain_ironic_config('agent/stream_raw_images').with_value(p[:stream_raw_images]) + is_expected.to contain_ironic_config('agent/image_download_source').with_value(p[:image_download_source]) is_expected.to contain_ironic_config('agent/post_deploy_get_power_state_retries').with_value(p[:post_deploy_get_power_state_retries]) is_expected.to contain_ironic_config('agent/post_deploy_get_power_state_retry_interval').with_value(p[:post_deploy_get_power_state_retry_interval]) is_expected.to contain_ironic_config('agent/deploy_logs_collect').with_value(p[:deploy_logs_collect])