diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 354ffe344f..76d36fff24 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -701,7 +701,12 @@ IRONIC_ANSIBLE_SSH_USER=${IRONIC_ANSIBLE_SSH_USER:-} # DevStack deployment, as we do not distribute this generated key to subnodes yet. IRONIC_ANSIBLE_SSH_KEY=${IRONIC_ANSIBLE_SSH_KEY:-$IRONIC_DATA_DIR/ansible_ssh_key} -IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE=${IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE:-swift} +if is_service_enabled swift; then + IRONIC_DEFAULT_DOWNLOAD_SOURCE=swift +else + IRONIC_DEFAULT_DOWNLOAD_SOURCE= +fi +IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE=${IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE:-$IRONIC_DEFAULT_DOWNLOAD_SOURCE} # Functions # --------- @@ -811,7 +816,12 @@ function is_ansible_with_tinyipa { } function is_glance_configuration_required { - is_deployed_by_agent || is_ansible_deploy_enabled || [[ "$IRONIC_CONFIGURE_GLANCE_WITH_SWIFT" == "True" ]] && return 0 + # Always configure if we're asked to + [[ "$IRONIC_CONFIGURE_GLANCE_WITH_SWIFT" == "True" ]] && return 0 + # Do not require swift configuration if using image_download_source!=swift + [[ "$IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE" == "swift" ]] || return 1 + # Otherwise require for direct and ansible deploy + is_deployed_by_agent || is_ansible_deploy_enabled && return 0 return 1 } @@ -1403,7 +1413,9 @@ function configure_ironic { iniset $IRONIC_CONF_FILE agent deploy_logs_storage_backend $IRONIC_DEPLOY_LOGS_STORAGE_BACKEND iniset $IRONIC_CONF_FILE agent deploy_logs_local_path $IRONIC_DEPLOY_LOGS_LOCAL_PATH # Set image_download_source for direct interface - iniset $IRONIC_CONF_FILE agent image_download_source $IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE + if [[ -n "$IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE" ]]; then + iniset $IRONIC_CONF_FILE agent image_download_source $IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE + fi # Configure JSON RPC backend iniset $IRONIC_CONF_FILE DEFAULT rpc_transport $IRONIC_RPC_TRANSPORT iniset $IRONIC_CONF_FILE json_rpc port $IRONIC_JSON_RPC_PORT diff --git a/ironic/conf/agent.py b/ironic/conf/agent.py index 85b0fc4e01..3fc8aac34b 100644 --- a/ironic/conf/agent.py +++ b/ironic/conf/agent.py @@ -105,7 +105,7 @@ opts = [ ('local', _('Same as "http", but HTTP images ' 'are also cached locally, converted ' 'and served from the conductor'))], - default='swift', + default='http', mutable=True, help=_('Specifies whether direct deploy interface should try ' 'to use the image source directly or if ironic should ' diff --git a/ironic/tests/unit/drivers/modules/test_agent.py b/ironic/tests/unit/drivers/modules/test_agent.py index f817779c28..66b5a7bbda 100644 --- a/ironic/tests/unit/drivers/modules/test_agent.py +++ b/ironic/tests/unit/drivers/modules/test_agent.py @@ -175,6 +175,7 @@ class TestAgentMethods(db_base.DbTestCase): @mock.patch.object(deploy_utils, 'check_for_missing_params', autospec=True) def test_validate_http_provisioning_not_http(self, utils_mock): + CONF.set_override('image_download_source', 'swift', group='agent') i_info = self.node.instance_info i_info['image_source'] = '0448fa34-4db1-407b-a051-6357d5f86c59' self.node.instance_info = i_info @@ -182,7 +183,6 @@ class TestAgentMethods(db_base.DbTestCase): utils_mock.assert_not_called() def test_validate_http_provisioning_missing_args(self): - CONF.set_override('image_download_source', 'http', group='agent') CONF.set_override('http_url', None, group='deploy') i_info = self.node.instance_info i_info['image_source'] = '0448fa34-4db1-407b-a051-6357d5f86c59' diff --git a/ironic/tests/unit/drivers/modules/test_deploy_utils.py b/ironic/tests/unit/drivers/modules/test_deploy_utils.py index 85ecd46e0b..0a582dee73 100644 --- a/ironic/tests/unit/drivers/modules/test_deploy_utils.py +++ b/ironic/tests/unit/drivers/modules/test_deploy_utils.py @@ -1747,6 +1747,7 @@ class TestBuildInstanceInfoForDeploy(db_base.DbTestCase): self.node = obj_utils.create_test_node(self.context, boot_interface='pxe', deploy_interface='direct') + cfg.CONF.set_override('image_download_source', 'swift', group='agent') @mock.patch.object(image_service.HttpImageService, 'validate_href', autospec=True) diff --git a/releasenotes/notes/image-download-http-976c82f440c61c96.yaml b/releasenotes/notes/image-download-http-976c82f440c61c96.yaml new file mode 100644 index 0000000000..60b8458857 --- /dev/null +++ b/releasenotes/notes/image-download-http-976c82f440c61c96.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + The default value of the configuration option + ``[agent]image_download_source`` has been changed to ``http`` to simplify + transition from the ``iscsi`` deploy interface. Set it to ``swift`` + explicitly to maintain the previous behavior. diff --git a/zuul.d/ironic-jobs.yaml b/zuul.d/ironic-jobs.yaml index 72fedb9297..6786c09b4b 100644 --- a/zuul.d/ironic-jobs.yaml +++ b/zuul.d/ironic-jobs.yaml @@ -112,6 +112,7 @@ tempest_concurrency: 2 devstack_localrc: FORCE_CONFIG_DRIVE: False + IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE: http IRONIC_AUTOMATED_CLEAN_ENABLED: False IRONIC_DEFAULT_DEPLOY_INTERFACE: direct IRONIC_DEFAULT_RESCUE_INTERFACE: agent @@ -128,8 +129,6 @@ # a small root partition, so use /opt which is mounted from a bigger # ephemeral partition on such nodes LIBVIRT_STORAGE_POOL_PATH: /opt/libvirt/images - SWIFT_ENABLE_TEMPURLS: True - SWIFT_TEMPURL_KEY: secretkey devstack_services: n-api: False n-api-meta: False @@ -141,10 +140,10 @@ n-sch: False nova: False placement-api: False - s-account: True - s-container: True - s-object: True - s-proxy: True + s-account: False + s-container: False + s-object: False + s-proxy: False - job: name: ironic-standalone-redfish @@ -171,6 +170,7 @@ tempest_concurrency: 2 devstack_localrc: FORCE_CONFIG_DRIVE: False + IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE: http IRONIC_AUTOMATED_CLEAN_ENABLED: False IRONIC_DEPLOY_DRIVER: redfish IRONIC_ENABLED_BOOT_INTERFACES: "ipxe,redfish-virtual-media" @@ -189,8 +189,6 @@ # a small root partition, so use /opt which is mounted from a bigger # ephemeral partition on such nodes LIBVIRT_STORAGE_POOL_PATH: /opt/libvirt/images - SWIFT_ENABLE_TEMPURLS: True - SWIFT_TEMPURL_KEY: secretkey devstack_services: n-api: False n-api-meta: False @@ -202,10 +200,10 @@ n-sch: False nova: False placement-api: False - s-account: True - s-container: True - s-object: True - s-proxy: True + s-account: False + s-container: False + s-object: False + s-proxy: False - job: name: ironic-tempest-partition-bios-redfish-pxe @@ -384,30 +382,6 @@ s-object: True s-proxy: True -- job: - name: ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-indirect - description: ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-indirect - parent: ironic-tempest-ipa-wholedisk-bios-agent_ipmitool - vars: - devstack_localrc: - IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE: http - IRONIC_AUTOMATED_CLEAN_ENABLED: False - IRONIC_DEFAULT_RESCUE_INTERFACE: no-rescue - IRONIC_ENABLED_RESCUE_INTERFACES: "fake,no-rescue" - -- job: - name: ironic-tempest-ipa-partition-bios-agent_ipmitool-indirect - description: ironic-tempest-ipa-partition-bios-agent_ipmitool-indirect - parent: ironic-tempest-ipa-wholedisk-bios-agent_ipmitool - vars: - devstack_localrc: - IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE: http - IRONIC_TEMPEST_WHOLE_DISK_IMAGE: False - IRONIC_AUTOMATED_CLEAN_ENABLED: False - IRONIC_DEFAULT_RESCUE_INTERFACE: no-rescue - IRONIC_ENABLED_RESCUE_INTERFACES: "fake,no-rescue" - IRONIC_DEFAULT_BOOT_OPTION: netboot - - job: name: ironic-tempest-functional-python3 description: ironic-tempest-functional-python3 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 75b72448be..f08cc73f7f 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -25,8 +25,6 @@ - ironic-tempest-ipa-partition-uefi-pxe_ipmitool - ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode - ironic-tempest-bios-ipmi-direct-tinyipa - - ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-indirect - - ironic-tempest-ipa-partition-bios-agent_ipmitool-indirect - ironic-tempest-bfv - ironic-tempest-ipa-partition-uefi-pxe-grub2 - ironic-tempest-ipxe-ipv6: