summaryrefslogtreecommitdiff
path: root/ironic/common/pxe_utils.py
diff options
context:
space:
mode:
authorJulia Kreger <juliaashleykreger@gmail.com>2019-01-02 09:08:25 -0800
committerJulia Kreger <juliaashleykreger@gmail.com>2019-01-03 05:53:10 -0800
commitcbf1e9d0343b610be6e98c57535cb2c892b2c173 (patch)
tree925eee1df7d563395d4afea925c58741bef6fa9d /ironic/common/pxe_utils.py
parent565cd192fc108bca6fc8394012249aa004743310 (diff)
downloadironic-cbf1e9d0343b610be6e98c57535cb2c892b2c173.tar.gz
Fix IPv6 iPXE support
Adds transmission of an `ipxe6` tag to neutron which is required for neutron to appropriately match and supply configuration to hosts over DHCPv6 when iPXE is in use. This is because neutron prepends options based upon its perception of the IP version being used and the detection of iPXE actively being used varries between IPv4 and IPv6. Story: 2004502 Task: 28221 Change-Id: If68926fd215f707394e5d6a0af9daa9232216abe
Diffstat (limited to 'ironic/common/pxe_utils.py')
-rw-r--r--ironic/common/pxe_utils.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/ironic/common/pxe_utils.py b/ironic/common/pxe_utils.py
index 52d6ebd64..32de2c3a1 100644
--- a/ironic/common/pxe_utils.py
+++ b/ironic/common/pxe_utils.py
@@ -465,15 +465,35 @@ def dhcp_options_for_instance(task, ipxe_enabled=False, url_boot=False):
# if the request comes from dumb firmware send them the iPXE
# boot image.
if dhcp_provider_name == 'neutron':
- # Neutron use dnsmasq as default DHCP agent, add extra config
- # to neutron "dhcp-match=set:ipxe,175" and use below option
+ # Neutron use dnsmasq as default DHCP agent. Neutron carries the
+ # configuration to relate to the tags below. The ipxe6 tag was
+ # added in the Stein cycle which identifies the iPXE User-Class
+ # directly and is only sent in DHCPv6.
+
+ # NOTE(TheJulia): Lets send both, let neutron tag/sort it out as
+ # an ip_version field is also transmitted. Plus, given the
+ # semi-obscure nature of this, being more verbose and letting
+ # the DHCP server do the best thing possible is likely the best
+ # course of action.
dhcp_opts.append({'opt_name': "tag:!ipxe,%s" % boot_file_param,
'opt_value': boot_file})
+ dhcp_opts.append({'opt_name': "tag:!ipxe6,%s" % boot_file_param,
+ 'opt_value': boot_file})
dhcp_opts.append({'opt_name': "tag:ipxe,%s" % boot_file_param,
'opt_value': ipxe_script_url})
+ dhcp_opts.append({'opt_name': "tag:ipxe6,%s" % boot_file_param,
+ 'opt_value': ipxe_script_url})
else:
# !175 == non-iPXE.
# http://ipxe.org/howto/dhcpd#ipxe-specific_options
+ if ip_version == 6:
+ LOG.warning('IPv6 is enabled and the DHCP driver appears set '
+ 'to a plugin aside from "neutron". Node %(name)s '
+ 'may not receive proper DHCPv6 provided '
+ 'boot parameters.'.format(name=task.node.uuid))
+ # NOTE(TheJulia): This was added for ISC DHCPd support, however it
+ # appears that isc support was never added to neutron and is likely
+ # a down stream driver.
dhcp_opts.append({'opt_name': "!%s,%s" % (DHCP_IPXE_ENCAP_OPTS,
boot_file_param),
'opt_value': boot_file})