Add initial support for EFI booting

In order to support EFI booting, we need to respond to the DHCP request
with the appropriate binary for booting the node.

At present, holding off on documentation until this has had an
opportunity to be fully tested and that we're sure that EFI booting
works without issues.

Change-Id: Ibdbeedb481796da03351daf56c91b8bd50480470
Co-Authored-By: Pierre Riteau <pierre@stackhpc.com>
Story: #1524845
Task: #8755
This commit is contained in:
Julia Kreger 2016-01-17 14:48:57 -05:00 committed by Pierre Riteau
parent 72825c3788
commit d446038141
5 changed files with 56 additions and 1 deletions

View File

@ -44,6 +44,10 @@ ans_network_interface: "{{ network_interface | replace('-', '_') }}"
ipa_file_protocol: "http"
ipa_upstream_release: "master"
enable_uefi_ipxe: true
ipxe_efi_binary: ipxe.efi
ipa_kernel: "{{http_boot_folder}}/ipa.vmlinuz"
ipa_ramdisk: "{{http_boot_folder}}/ipa.initramfs"
ipa_kernel_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{file_url_port}}/ipa.vmlinuz"

View File

@ -52,6 +52,31 @@
- name: "Copy full iPXE image into /tftpboot"
copy: src={{ ipxe_dir }}/{{ ipxe_full_binary }} dest=/tftpboot/ remote_src=true
- name: "Set up iPXE for EFI booting"
block:
- name: "Check if the iPXE EFI image is present"
stat:
path: "{{ ipxe_dir }}/{{ ipxe_efi_binary }}"
get_md5: false
register: test_ipxe_efi_binary_path
ignore_errors: true
- name: "Abort if iPXE EFI image is missing"
fail:
msg: >
Aborting installation: The {{ ipxe_efi_binary }} image was not found
at the {{ ipxe_dir }} location. Please place this file or consider
re-running with download_ipxe set to a value of true.
when:
- test_ipxe_efi_binary_path.stat.exists | bool == false
- name: "Copy iPXE EFI image into {{ http_boot_folder }}/"
copy: src={{ ipxe_dir }}/{{ ipxe_efi_binary }} dest={{ http_boot_folder }}/ remote_src=true
- name: "Copy iPXE EFI image into /tftpboot"
copy: src={{ ipxe_dir }}/{{ ipxe_efi_binary }} dest=/tftpboot/ remote_src=true
when: enable_uefi_ipxe | bool == true
# Similar logic to below can be utilized to retrieve files
- name: "Determine if folder exists, else create and populate folder."
stat: path="{{ ironic_tftp_master_path }}"

View File

@ -24,7 +24,7 @@
group=root
mode=0755
- name: Get ipxe files
- name: Get iPXE files
get_url:
url: "https://boot.ipxe.org/{{ item }}"
dest: "{{ ipxe_dir }}/{{ item }}"
@ -37,3 +37,17 @@
- undionly.kpxe
- ipxe.pxe
environment: "{{ venv }}"
- name: Get iPXE EFI binary
get_url:
url: "https://boot.ipxe.org/{{ item }}"
dest: "{{ ipxe_dir }}/{{ item }}"
force: yes
register: ipxe_efi_binary_download_done
until: ipxe_efi_binary_download_done|succeeded
retries: 5
delay: 10
with_items:
- "{{ ipxe_efi_binary }}"
environment: "{{ venv }}"
when: enable_uefi_ipxe | bool == true

View File

@ -94,6 +94,14 @@ dhcp-userclass=set:gpxe,"gPXE"
dhcp-boot=tag:gpxe,/ipxe.pxe
dhcp-match=set:ipxe,175 # iPXE sends a 175 option.
{% if enable_uefi_ipxe | bool == true %}
dhcp-match=set:efi,option:client-arch,7
dhcp-match=set:efi,option:client-arch,9
dhcp-match=set:efi,option:client-arch,11
# Client is PXE booting over EFI without iPXE ROM; send EFI version of iPXE chainloader
dhcp-boot=tag:efi,tag:!ipxe,/{{ ipxe_efi_binary }}
{% endif %}
{% if testing | bool == true %}
dhcp-boot=tag:ipxe,http://192.168.122.1:{{ file_url_port }}/boot.ipxe
{% else %}

View File

@ -47,6 +47,10 @@ pxe_bootfile_name = undionly.kpxe
ipxe_enabled = true
ipxe_boot_script = /etc/ironic/boot.ipxe
tftp_master_path = {{ ironic_tftp_master_path }}
{% if enable_uefi_ipxe | bool %}
uefi_pxe_bootfile_name = {{ ipxe_efi_binary }}
uefi_pxe_config_template = $pybasedir/drivers/modules/ipxe_config.template
{% endif %}
[deploy]
http_url = http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ file_url_port }}/