Merge "Fix chainloading iPXE (undionly.kpxe)"

This commit is contained in:
Jenkins 2015-05-18 03:45:59 +00:00 committed by Gerrit Code Review
commit fc26d6ccde
3 changed files with 10 additions and 9 deletions

View File

@ -849,12 +849,13 @@ DHCP client to chainload the iPXE image (undionly.kpxe). Neutron needs to
be configured to create this DHCP tag, since it isn't create by default. be configured to create this DHCP tag, since it isn't create by default.
#. Create a custom ``dnsmasq.conf`` file with a setting for the ipxe tag. For #. Create a custom ``dnsmasq.conf`` file with a setting for the ipxe tag. For
example, the following creates the file ``/etc/dnsmasq-ironic.conf`` :: example, create the file ``/etc/dnsmasq-ironic.conf`` with the content::
cat > /etc/dnsmasq-ironic.conf << EOF # Create the "ipxe" tag if request comes from iPXE user class
dhcp-match=ipxe,175 dhcp-userclass=set:ipxe,iPXE
EOF
# Alternatively, create the "ipxe" tag if request comes from DHCP option 175
# dhcp-match=set:ipxe,175
#. In the Neutron DHCP Agent configuration file (typically located at #. In the Neutron DHCP Agent configuration file (typically located at
/etc/neutron/dhcp_agent.ini), set the custom ``/etc/dnsmasq-ironic.conf`` /etc/neutron/dhcp_agent.ini), set the custom ``/etc/dnsmasq-ironic.conf``

View File

@ -260,15 +260,15 @@ def dhcp_options_for_instance(task):
# to neutron "dhcp-match=set:ipxe,175" and use below option # to neutron "dhcp-match=set:ipxe,175" and use below option
dhcp_opts.append({'opt_name': 'tag:!ipxe,bootfile-name', dhcp_opts.append({'opt_name': 'tag:!ipxe,bootfile-name',
'opt_value': CONF.pxe.pxe_bootfile_name}) 'opt_value': CONF.pxe.pxe_bootfile_name})
dhcp_opts.append({'opt_name': 'tag:ipxe,bootfile-name',
'opt_value': ipxe_script_url})
else: else:
# !175 == non-iPXE. # !175 == non-iPXE.
# http://ipxe.org/howto/dhcpd#ipxe-specific_options # http://ipxe.org/howto/dhcpd#ipxe-specific_options
dhcp_opts.append({'opt_name': '!175,bootfile-name', dhcp_opts.append({'opt_name': '!175,bootfile-name',
'opt_value': CONF.pxe.pxe_bootfile_name}) 'opt_value': CONF.pxe.pxe_bootfile_name})
# If the request comes from iPXE, direct it to boot from the dhcp_opts.append({'opt_name': 'bootfile-name',
# iPXE script 'opt_value': ipxe_script_url})
dhcp_opts.append({'opt_name': 'bootfile-name',
'opt_value': ipxe_script_url})
else: else:
if deploy_utils.get_boot_mode_for_deploy(task.node) == 'uefi': if deploy_utils.get_boot_mode_for_deploy(task.node) == 'uefi':
boot_file = CONF.pxe.uefi_pxe_bootfile_name boot_file = CONF.pxe.uefi_pxe_bootfile_name

View File

@ -358,7 +358,7 @@ class TestPXEUtils(db_base.DbTestCase):
'opt_value': '192.0.2.1'}, 'opt_value': '192.0.2.1'},
{'opt_name': 'tftp-server', {'opt_name': 'tftp-server',
'opt_value': '192.0.2.1'}, 'opt_value': '192.0.2.1'},
{'opt_name': 'bootfile-name', {'opt_name': 'tag:ipxe,bootfile-name',
'opt_value': expected_boot_script_url}] 'opt_value': expected_boot_script_url}]
with task_manager.acquire(self.context, self.node.uuid) as task: with task_manager.acquire(self.context, self.node.uuid) as task:
self.assertItemsEqual(expected_info, self.assertItemsEqual(expected_info,