From 32121c073e6571b480898d335d397a06aae9305b Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Thu, 18 Jun 2015 21:07:07 -0400 Subject: [PATCH] Attempt to upgrade iPXE if no mac found Apparently older iPXE implementations that may be burned into ROMs may not recognize the template MAC syntax, and thus be unable to boot. In the event of this happening, we should attempt to chainload the iPXE image. Additionally removed autofree as this may not be recognized by some versions of iPXE. Change-Id: I6e458d6a9383fb2d31d743b0124384a2036520df --- playbooks/roles/ironic-install/files/boot.ipxe | 6 +++++- playbooks/roles/ironic-install/tasks/create_tftpboot.yml | 5 +++++ playbooks/roles/ironic-install/templates/dnsmasq.conf.j2 | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/playbooks/roles/ironic-install/files/boot.ipxe b/playbooks/roles/ironic-install/files/boot.ipxe index 25a0ea8dc..ce2e43054 100644 --- a/playbooks/roles/ironic-install/files/boot.ipxe +++ b/playbooks/roles/ironic-install/files/boot.ipxe @@ -1,7 +1,11 @@ #!ipxe +isset ${mac:hexhyp} && goto boot_system || +chain ipxe.pxe + # load the MAC-specific file or fail if it's not found -chain --autofree pxelinux.cfg/${mac:hexraw} || goto error_no_config +:boot_system +chain pxelinux.cfg/${mac:hexhyp} || goto error_no_config :error_no_config echo PXE boot failed. No configuration found for MAC ${mac} diff --git a/playbooks/roles/ironic-install/tasks/create_tftpboot.yml b/playbooks/roles/ironic-install/tasks/create_tftpboot.yml index f6da95a2e..2b63a654a 100644 --- a/playbooks/roles/ironic-install/tasks/create_tftpboot.yml +++ b/playbooks/roles/ironic-install/tasks/create_tftpboot.yml @@ -37,6 +37,11 @@ copy: src=xinetd.tftp dest=/etc/xinetd.d/tftp - name: "Copy iPXE image into place" copy: src={{ ipxe_dir }}/undionly.kpxe dest=/tftpboot/ +# NOTE(TheJulia): Copy full iPXE chain loader images in case they are required. +- name: "Copy full iPXE image into /httpboot" + copy: src={{ ipxe_dir }}/ipxe.pxe dest=/httpboot/ +- name: "Copy full iPXE image into /tftpboot" + copy: src={{ ipxe_dir }}/ipxe.pxe dest=/tftpboot/ # Similar logic to below can be utilized to retrieve files - name: "Determine if folder exists, else create and populate folder." stat: path=/tftpboot/master_images diff --git a/playbooks/roles/ironic-install/templates/dnsmasq.conf.j2 b/playbooks/roles/ironic-install/templates/dnsmasq.conf.j2 index 7de48e779..89794eb82 100644 --- a/playbooks/roles/ironic-install/templates/dnsmasq.conf.j2 +++ b/playbooks/roles/ironic-install/templates/dnsmasq.conf.j2 @@ -433,6 +433,9 @@ dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},12h # Boot for Etherboot gPXE. The idea is to send two different # filenames, the first loads gPXE, and the second tells gPXE what to # load. The dhcp-match sets the gpxe tag for requests from gPXE. +dhcp-userclass=set:gpxe,"gPXE" +dhcp-boot=tag:gpxe,ipxe.pxe + dhcp-match=set:ipxe,175 # iPXE sends a 175 option. dhcp-boot=tag:!ipxe,undionly.kpxe {% if testing %}