From 903700584d25136156fa3cb3599eb9350fafaaae Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 1 May 2018 10:11:55 +0100 Subject: [PATCH] Enable iPXE boot in ironic a new variable, kolla_enable_ironic_ipxe is added to control whether or not iPXE is used as the network boot program in ironic. You can set this is in etc/kayobe/kolla.yml, e.g: kolla_enable_ironic_ipxe: True Change-Id: I7da15e7ceea580e5b7bee7fc732351cbec666f4c Story: 2001949 Task: 15068 Depends-On: I08fca1864a00afb768494406c49e968920c83ae7 --- ansible/group_vars/all/kolla | 1 + ansible/roles/kolla-ansible/defaults/main.yml | 1 + .../templates/overcloud-services.j2 | 3 +++ ansible/roles/kolla-ansible/vars/main.yml | 1 + .../templates/ironic-dnsmasq.conf.j2 | 17 +++++++++++++++-- etc/kayobe/kolla.yml | 1 + 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ansible/group_vars/all/kolla b/ansible/group_vars/all/kolla index dfe89dd70..a55241569 100644 --- a/ansible/group_vars/all/kolla +++ b/ansible/group_vars/all/kolla @@ -308,6 +308,7 @@ kolla_enable_heat: "yes" kolla_enable_horizon: "yes" kolla_enable_influxdb: "no" kolla_enable_ironic: "yes" +kolla_enable_ironic_ipxe: "no" kolla_enable_kafka: "no" kolla_enable_kibana: "{{ 'yes' if kolla_enable_central_logging | bool else 'no' }}" kolla_enable_magnum: "no" diff --git a/ansible/roles/kolla-ansible/defaults/main.yml b/ansible/roles/kolla-ansible/defaults/main.yml index 9384e04fd..abbdc28aa 100644 --- a/ansible/roles/kolla-ansible/defaults/main.yml +++ b/ansible/roles/kolla-ansible/defaults/main.yml @@ -207,6 +207,7 @@ kolla_openstack_logging_debug: #kolla_enable_horizon: #kolla_enable_influxdb: #kolla_enable_ironic: +#kolla_enable_ironic_ipxe: #kolla_enable_kafka: #kolla_enable_kuryr: #kolla_enable_magnum: diff --git a/ansible/roles/kolla-ansible/templates/overcloud-services.j2 b/ansible/roles/kolla-ansible/templates/overcloud-services.j2 index b8491621b..d1d245b4d 100644 --- a/ansible/roles/kolla-ansible/templates/overcloud-services.j2 +++ b/ansible/roles/kolla-ansible/templates/overcloud-services.j2 @@ -216,6 +216,9 @@ ironic [ironic-pxe:children] ironic +[ironic-ipxe:children] +ironic + # Magnum [magnum-api:children] magnum diff --git a/ansible/roles/kolla-ansible/vars/main.yml b/ansible/roles/kolla-ansible/vars/main.yml index 6cb220df9..29dd9a657 100644 --- a/ansible/roles/kolla-ansible/vars/main.yml +++ b/ansible/roles/kolla-ansible/vars/main.yml @@ -87,6 +87,7 @@ kolla_feature_flags: - horizon - influxdb - ironic + - ironic_ipxe - ironic_pxe_uefi - kafka - karbor diff --git a/ansible/roles/kolla-openstack/templates/ironic-dnsmasq.conf.j2 b/ansible/roles/kolla-openstack/templates/ironic-dnsmasq.conf.j2 index 7a8dda9b8..01bb40ccd 100644 --- a/ansible/roles/kolla-openstack/templates/ironic-dnsmasq.conf.j2 +++ b/ansible/roles/kolla-openstack/templates/ironic-dnsmasq.conf.j2 @@ -8,12 +8,25 @@ dhcp-option=option:tftp-server,{% raw %}{{ hostvars[inventory_hostname]['ansible dhcp-option=option:server-ip-address,{% raw %}{{ hostvars[inventory_hostname]['ansible_' ~ provision_interface | replace('-', '_')]['ipv4']['address'] }}{% endraw %} +dhcp-option=210,/tftpboot/ + {% if kolla_inspector_default_gateway %} dhcp-option=3,{{ kolla_inspector_default_gateway }} {% endif %} -dhcp-option=option:bootfile-name,pxelinux.0 -dhcp-option=210,/tftpboot/ +{% raw %}{% if enable_ironic_ipxe | bool %} +dhcp-match=ipxe,175 +dhcp-match=set:efi,option:client-arch,7 +dhcp-match=set:efi,option:client-arch,9 +# Client is already running iPXE; move to next stage of chainloading +dhcp-option=tag:ipxe,option:bootfile-name,{{ ironic_ipxe_url }}/inspector.ipxe +# Client is PXE booting over EFI without iPXE ROM, +# send EFI version of iPXE chainloader +dhcp-option=tag:efi,tag:!ipxe,option:bootfile-name,ipxe.efi +dhcp-option=option:bootfile-name,{{ ironic_dnsmasq_boot_file | default('undionly.kpxe') }} +{% else %} +dhcp-option=option:bootfile-name,{{ ironic_dnsmasq_boot_file | default('pxelinux.0') }} +{% endif %}{% endraw %} {% if kolla_extra_ironic_dnsmasq %} {{ kolla_extra_ironic_dnsmasq }} diff --git a/etc/kayobe/kolla.yml b/etc/kayobe/kolla.yml index dafdade74..ca588c0f8 100644 --- a/etc/kayobe/kolla.yml +++ b/etc/kayobe/kolla.yml @@ -174,6 +174,7 @@ #kolla_enable_horizon: #kolla_enable_influxdb: #kolla_enable_ironic: +#kolla_enable_ironic_ipxe: #kolla_enable_ironic_pxe_uefi: #kolla_enable_iscsid: #kolla_enable_karbor: