From 1fcb6df06143f8f866ab69eb751b19be1adbd8d1 Mon Sep 17 00:00:00 2001 From: Alexander Noskov Date: Tue, 11 Aug 2020 20:17:59 +0000 Subject: [PATCH] Enable UEFI in addition to legacy bootmode In order to enable UEFI support we need to configure guests VM to use OVMF (Open Virtual Machine Firmware) Closes: #319 Change-Id: I4b1c3b9fa8f1f0fe42ced7ec3e57b9d95dd4a3f5 --- manifests/site/test-site/shared/catalogues/hosts.yaml | 3 ++- roles/airship-libvirt-gate/tasks/build-infra.yaml | 3 +++ roles/libvirt-domain/defaults/main.yaml | 3 +++ roles/libvirt-install/tasks/main.yaml | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/manifests/site/test-site/shared/catalogues/hosts.yaml b/manifests/site/test-site/shared/catalogues/hosts.yaml index ae5936b5b..b7fb6b4cf 100644 --- a/manifests/site/test-site/shared/catalogues/hosts.yaml +++ b/manifests/site/test-site/shared/catalogues/hosts.yaml @@ -7,6 +7,7 @@ metadata: hosts: m3: node01: + bootMode: UEFI macAddress: 52:54:00:b6:ed:31 bmcAddress: redfish+http://10.23.25.1:8000/redfish/v1/Systems/air-target-1 bmcUsername: root @@ -17,9 +18,9 @@ hosts: macAddresses: oam: 52:54:00:9b:27:4c pxe: 52:54:00:b6:ed:31 - bootMode: legacy hardwareProfile: default # defined in the hostgenerator-m3 function node02: + bootMode: UEFI macAddress: 52:54:00:b6:ed:02 bmcAddress: redfish+http://10.23.25.2:8000/redfish/v1/Systems/air-target-2 bmcUsername: username diff --git a/roles/airship-libvirt-gate/tasks/build-infra.yaml b/roles/airship-libvirt-gate/tasks/build-infra.yaml index 915458e19..7edde6d7a 100644 --- a/roles/airship-libvirt-gate/tasks/build-infra.yaml +++ b/roles/airship-libvirt-gate/tasks/build-infra.yaml @@ -70,6 +70,7 @@ name: libvirt-domain vars: libvirt_domain: + boot_mode: UEFI enable_vnc: true console_log_enabled: true state: shutdown @@ -99,6 +100,7 @@ name: libvirt-domain vars: libvirt_domain: + boot_mode: UEFI enable_vnc: true console_log_enabled: true state: shutdown @@ -167,6 +169,7 @@ name: libvirt-domain vars: libvirt_domain: + boot_mode: UEFI enable_vnc: true console_log_enabled: true state: shutdown diff --git a/roles/libvirt-domain/defaults/main.yaml b/roles/libvirt-domain/defaults/main.yaml index 41c0d3314..0c7a27660 100644 --- a/roles/libvirt-domain/defaults/main.yaml +++ b/roles/libvirt-domain/defaults/main.yaml @@ -106,6 +106,9 @@ libvirt_domain_template_default: | destroy hvm + {% if libvirt_domain.boot_mode is defined and libvirt_domain.boot_mode == 'UEFI' %} + /usr/share/OVMF/OVMF_CODE.fd + {% endif %} diff --git a/roles/libvirt-install/tasks/main.yaml b/roles/libvirt-install/tasks/main.yaml index 9d050d8dd..d54a44c8c 100644 --- a/roles/libvirt-install/tasks/main.yaml +++ b/roles/libvirt-install/tasks/main.yaml @@ -25,7 +25,9 @@ - python3-libvirt - dnsmasq - ebtables + - ovmf RedHat: + - edk2-ovmf - libguestfs-tools - libvirt - libvirt-devel