diff --git a/ironic/common/pxe_utils.py b/ironic/common/pxe_utils.py index 55e602a2cd..ad34f43056 100644 --- a/ironic/common/pxe_utils.py +++ b/ironic/common/pxe_utils.py @@ -441,11 +441,7 @@ def dhcp_options_for_instance(task, ipxe_enabled=False, url_boot=False): else: # NOTE(TheJulia): Booting with v6 means it is always # a URL reply. - if dhcp_provider_name == 'neutron': - # dnsmasq requires ipv6 options be explicitly flagged. :( - boot_file_param = "option6:{}".format(DHCPV6_BOOTFILE_NAME) - else: - boot_file_param = DHCPV6_BOOTFILE_NAME + boot_file_param = DHCPV6_BOOTFILE_NAME url_boot = True # NOTE(TheJulia): The ip_version value config from the PXE config is # guarded in the configuration, so there is no real sense in having @@ -454,6 +450,12 @@ def dhcp_options_for_instance(task, ipxe_enabled=False, url_boot=False): boot_file = _dhcp_option_file_or_url(task, url_boot) if ipxe_enabled: + # TODO(TheJulia): DHCPv6 through dnsmasq + ipxe matching simply + # does not work as the dhcp client is tracked via a different + # identity mechanism in the exchange. This means if we really + # want ipv6 + ipxe, we should be prepared to build a custom + # iso with ipxe inside. Likely this is more secure and better + # aligns with some of the mega-scale ironic operators. script_name = os.path.basename(CONF.pxe.ipxe_boot_script) # TODO(TheJulia): We should make this smarter to handle unwrapped v6 # addresses, since the format is http://[ff80::1]:80/boot.ipxe. diff --git a/ironic/tests/unit/common/test_pxe_utils.py b/ironic/tests/unit/common/test_pxe_utils.py index 12a80edabd..5d99f06105 100644 --- a/ironic/tests/unit/common/test_pxe_utils.py +++ b/ironic/tests/unit/common/test_pxe_utils.py @@ -728,7 +728,7 @@ class TestPXEUtils(db_base.DbTestCase): # options are not imported, although they may be supported # by vendors. The apparent proper option is to return a # URL in the field https://tools.ietf.org/html/rfc5970#section-3 - expected_info = [{'opt_name': 'option6:59', + expected_info = [{'opt_name': '59', 'opt_value': 'tftp://[ff80::1]/fake-bootfile', 'ip_version': ip_version}] elif ip_version == 4: @@ -857,10 +857,10 @@ class TestPXEUtils(db_base.DbTestCase): self.config(dhcp_provider='neutron', group='dhcp') if ip_version == 6: # Boot URL variable set from prior test of isc parameters. - expected_info = [{'opt_name': 'tag:!ipxe,option6:59', + expected_info = [{'opt_name': 'tag:!ipxe,59', 'opt_value': 'tftp://[ff80::1]/fake-bootfile', 'ip_version': ip_version}, - {'opt_name': 'tag:ipxe,option6:59', + {'opt_name': 'tag:ipxe,59', 'opt_value': expected_boot_script_url, 'ip_version': ip_version}] elif ip_version == 4: diff --git a/releasenotes/notes/fix-ipv6-option6-tag-549093681dcf940c.yaml b/releasenotes/notes/fix-ipv6-option6-tag-549093681dcf940c.yaml new file mode 100644 index 0000000000..4b59c614da --- /dev/null +++ b/releasenotes/notes/fix-ipv6-option6-tag-549093681dcf940c.yaml @@ -0,0 +1,16 @@ +--- +issues: + - | + Support for IPv6 and iPXE is restricted and is unlikely to work in default + scenarios and configurations without external intervention. This is due to + the way DHCPv6 and dnsmasq operate. At present this issue is being tracked + in story `2005402 `_. +fixes: + - | + Fixes an issue introduced during the Stein development cycle in an attempt + to fix IPv6 support where the networking service was also prepending the + DHCP option indicator to the number. A fix has been been submitted to the + Networking service to address this issue, and the prepending code has been + removed from ironic. See story + `2004501 `_ for more + information.