From 0ee55e19fa9889b807e72f7f018800a1761d92a0 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 12 Jul 2019 12:44:09 +0100 Subject: [PATCH] Fix inspector iPXE boot with UEFI compute nodes The IPA ramdisk fails to boot on UEFI compute nodes with iPXE. We see the following error on the console, followed by a kernel panic: Fix kernel panic-not syncing: VFS: unable to mount root fs on unknown block(0,0) The cause is the lack of an initrd=ironic-agent.initramfs kernel argument in inspector.ipxe. The initrd argument is present in the kolla-ansible version of inspector.ipxe, and now contains all parameters that we need (since Rocky), so this change simply removes our custom template, and passes through the extra kernel argument option configuration value. Story: 2006214 Task: 35804 Story: 2006213 Task: 35803 Depends-On: https://review.opendev.org/670566 Change-Id: I8a103b7c6d3dd1f0433f922ae90deae9b92c0c78 --- ansible/kolla-ansible.yml | 1 + ansible/kolla-openstack.yml | 1 - ansible/roles/kolla-ansible/defaults/main.yml | 3 +++ ansible/roles/kolla-ansible/templates/globals.yml.j2 | 4 ++++ ansible/roles/kolla-openstack/defaults/main.yml | 3 --- .../molecule/enable-everything/tests/test_default.py | 3 +-- ansible/roles/kolla-openstack/tasks/config.yml | 2 -- .../roles/kolla-openstack/templates/inspector.ipxe.j2 | 10 ---------- .../kolla-openstack/templates/pxelinux.default.j2 | 7 ------- ansible/roles/kolla-openstack/vars/main.yml | 2 -- .../fix-inspector-ipxe-uefi-86f435ebaf4eee08.yaml | 6 ++++++ 11 files changed, 15 insertions(+), 27 deletions(-) delete mode 100644 ansible/roles/kolla-openstack/templates/inspector.ipxe.j2 delete mode 100644 ansible/roles/kolla-openstack/templates/pxelinux.default.j2 create mode 100644 releasenotes/notes/fix-inspector-ipxe-uefi-86f435ebaf4eee08.yaml diff --git a/ansible/kolla-ansible.yml b/ansible/kolla-ansible.yml index 77705e17e..b5b7bb218 100644 --- a/ansible/kolla-ansible.yml +++ b/ansible/kolla-ansible.yml @@ -299,6 +299,7 @@ kolla_inspector_dhcp_pool_start: "{{ inspection_net_name | net_inspection_allocation_pool_start }}" kolla_inspector_dhcp_pool_end: "{{ inspection_net_name | net_inspection_allocation_pool_end }}" kolla_inspector_default_gateway: "{{ inspection_net_name | net_inspection_gateway or inspection_net_name | net_gateway }}" + kolla_inspector_extra_kernel_options: "{{ inspector_extra_kernel_options }}" # While kayobe has its own support for installing an NTP daemon, the # kolla-ansible baremetal role does a one-time sync which is useful. kolla_enable_host_ntp: "{{ ntp_service_enabled }}" diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index 58c05c575..dd98b5fa9 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -202,7 +202,6 @@ kolla_inspector_keep_ports: "{{ inspector_keep_ports }}" kolla_inspector_enable_discovery: "{{ inspector_enable_discovery }}" kolla_inspector_discovery_enroll_node_driver: "{{ inspector_discovery_enroll_node_driver }}" - kolla_inspector_extra_kernel_options: "{{ inspector_extra_kernel_options }}" # Ironic inspector swift store configuration. Currently only supports the # 'fake' inspection store. kolla_inspector_enable_swift: "{{ inspector_store_enabled }}" diff --git a/ansible/roles/kolla-ansible/defaults/main.yml b/ansible/roles/kolla-ansible/defaults/main.yml index 59afcedd0..e239cf0de 100644 --- a/ansible/roles/kolla-ansible/defaults/main.yml +++ b/ansible/roles/kolla-ansible/defaults/main.yml @@ -219,6 +219,9 @@ kolla_inspector_dhcp_pool_end: # Default gateway to use for inspection network. kolla_inspector_default_gateway: +# List of extra kernel parameters for the inspector default PXE configuration. +kolla_inspector_extra_kernel_options: [] + #################### # OpenStack options #################### diff --git a/ansible/roles/kolla-ansible/templates/globals.yml.j2 b/ansible/roles/kolla-ansible/templates/globals.yml.j2 index ff02ef3b6..05fc332d9 100644 --- a/ansible/roles/kolla-ansible/templates/globals.yml.j2 +++ b/ansible/roles/kolla-ansible/templates/globals.yml.j2 @@ -294,6 +294,10 @@ ironic_dnsmasq_dhcp_range: {{ kolla_inspector_dhcp_pool_start }},{{ kolla_inspec {% if kolla_inspector_default_gateway %} ironic_dnsmasq_default_gateway: {{ kolla_inspector_default_gateway }} {% endif %} +{% if kolla_inspector_extra_kernel_options %} +ironic_inspector_kernel_cmdline_extras: +{{ kolla_inspector_extra_kernel_options | to_nice_yaml }} +{% endif %} ###################################### # Manila - Shared File Systems Options diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml index 3e659a688..356b04eb7 100644 --- a/ansible/roles/kolla-openstack/defaults/main.yml +++ b/ansible/roles/kolla-openstack/defaults/main.yml @@ -262,9 +262,6 @@ kolla_inspector_enable_discovery: # The Ironic driver with which to register newly discovered nodes. kolla_inspector_discovery_enroll_node_driver: -# List of extra kernel parameters for the inspector default PXE configuration. -kolla_inspector_extra_kernel_options: [] - # URL of Ironic Python Agent (IPA) kernel image for Ironic Inspector. # Mutually exclusive with kolla_inspector_ipa_kernel_path. kolla_inspector_ipa_kernel_upstream_url: diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py b/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py index a5e08b87c..519aca9b8 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py @@ -92,8 +92,7 @@ def test_service_ini_file(host, path): @pytest.mark.parametrize( 'path', ['ironic/ironic-agent.initramfs', - 'ironic/ironic-agent.kernel', - 'ironic/pxelinux.default']) + 'ironic/ironic-agent.kernel']) def test_service_non_ini_file(host, path): # TODO(mgoddard): Check config file contents. path = os.path.join('/etc/kolla/config', path) diff --git a/ansible/roles/kolla-openstack/tasks/config.yml b/ansible/roles/kolla-openstack/tasks/config.yml index 513261ac4..2d03cc9d8 100644 --- a/ansible/roles/kolla-openstack/tasks/config.yml +++ b/ansible/roles/kolla-openstack/tasks/config.yml @@ -35,8 +35,6 @@ - { src: neutron.conf.j2, dest: neutron.conf, enabled: "{{ kolla_enable_neutron }}" } - { src: nova.conf.j2, dest: nova.conf, enabled: "{{ kolla_enable_nova }}" } - { src: octavia.conf.j2, dest: octavia.conf, enabled: "{{ kolla_enable_octavia }}" } - - { src: pxelinux.default.j2, dest: ironic/pxelinux.default, enabled: "{{ kolla_enable_ironic }}" } - - { src: inspector.ipxe.j2, dest: ironic/inspector.ipxe, enabled: "{{ kolla_enable_ironic_ipxe }}" } - { src: sahara.conf.j2, dest: sahara.conf, enabled: "{{ kolla_enable_sahara }}" } - { src: backup.my.cnf.j2, dest: backup.my.cnf, enabled: "{{ kolla_enable_xtrabackup }}" } - { src: zookeeper.cfg.j2, dest: zookeeper.cfg, enabled: "{{ kolla_enable_zookeeper }}" } diff --git a/ansible/roles/kolla-openstack/templates/inspector.ipxe.j2 b/ansible/roles/kolla-openstack/templates/inspector.ipxe.j2 deleted file mode 100644 index adfb21064..000000000 --- a/ansible/roles/kolla-openstack/templates/inspector.ipxe.j2 +++ /dev/null @@ -1,10 +0,0 @@ -#!ipxe - -:retry_dhcp -dhcp || goto retry_dhcp - -:retry_boot -imgfree -kernel --timeout 30000 {% raw %}{{ ironic_ipxe_url }}/ironic-agent.kernel{% endraw %} ipa-inspection-callback-url={% raw %}http://{{ kolla_internal_vip_address }}:{{ ironic_inspector_port }}/v1/continue{% endraw %} systemd.journald.forward_to_console=yes {{ kolla_inspector_extra_kernel_options | join(' ') }} {% raw %}BOOTIF=${mac}{% endraw %} || goto retry_boot -initrd --timeout 30000 {% raw %}{{ ironic_ipxe_url }}/ironic-agent.initramfs{% endraw %} || goto retry_boot -boot diff --git a/ansible/roles/kolla-openstack/templates/pxelinux.default.j2 b/ansible/roles/kolla-openstack/templates/pxelinux.default.j2 deleted file mode 100644 index 1e4363972..000000000 --- a/ansible/roles/kolla-openstack/templates/pxelinux.default.j2 +++ /dev/null @@ -1,7 +0,0 @@ -default introspect - -label introspect -kernel ironic-agent.kernel -append initrd=ironic-agent.initramfs ipa-inspection-callback-url={% raw %}http://{{ kolla_internal_vip_address }}:{{ ironic_inspector_port }}/v1/continue{% endraw %} systemd.journald.forward_to_console=yes {{ kolla_inspector_extra_kernel_options | join(' ') }} - -ipappend 3 diff --git a/ansible/roles/kolla-openstack/vars/main.yml b/ansible/roles/kolla-openstack/vars/main.yml index 642ad1170..3ac17bc79 100644 --- a/ansible/roles/kolla-openstack/vars/main.yml +++ b/ansible/roles/kolla-openstack/vars/main.yml @@ -107,8 +107,6 @@ kolla_openstack_custom_config: # These are templated by kayobe, so don't remove them. - ironic-agent.initramfs - ironic-agent.kernel - - pxelinux.default - - inspector.ipxe # Kafka. - src: "{{ kolla_extra_config_path }}/kafka" dest: "{{ kolla_node_custom_config_path }}/kafka" diff --git a/releasenotes/notes/fix-inspector-ipxe-uefi-86f435ebaf4eee08.yaml b/releasenotes/notes/fix-inspector-ipxe-uefi-86f435ebaf4eee08.yaml new file mode 100644 index 000000000..3451fa698 --- /dev/null +++ b/releasenotes/notes/fix-inspector-ipxe-uefi-86f435ebaf4eee08.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue with hardware inspection of bare metal compute nodes + configured to use UEFI. See `story 2006214 + `__ for details.