From 739647dffaee468122fa3984ab907c07cb6b9c16 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 31 May 2019 15:30:15 -0400 Subject: [PATCH] kvm: add support for booting uefi instances In order to boot UEFI instances successfully, the OVMF image must be installed and located at the path that is hardcoded inside Nova. This patch takes care of installing the OVMF images and sets up links to point towards the hardcoded path for operating systems that don't install at the expected path. Change-Id: I62f4aa26ffd0d2f3ba4aa19fbdb72578ef0223e4 Closes-Bug: #1825386 Closes-Bug: #1831279 --- tasks/drivers/kvm/nova_compute_kvm.yml | 25 +++++++++++++++++++++++++ vars/debian.yml | 1 + vars/redhat-7.yml | 1 + vars/suse.yml | 1 + 4 files changed, 28 insertions(+) diff --git a/tasks/drivers/kvm/nova_compute_kvm.yml b/tasks/drivers/kvm/nova_compute_kvm.yml index 5238f886..f884df81 100644 --- a/tasks/drivers/kvm/nova_compute_kvm.yml +++ b/tasks/drivers/kvm/nova_compute_kvm.yml @@ -158,3 +158,28 @@ - nova-kvm - nova-libvirt - nova-kvm-virsh-net + +# NOTE(mnaser): These 2 tasks should disappear once the following bug is fixed +# https://bugs.launchpad.net/nova/+bug/1825386 +- name: Create UEFI firmware folder + file: + path: /usr/share/OVMF + state: directory + when: + - ansible_os_family == 'Suse' + tags: + - nova-config + - nova-kvm + - nova-libvirt + +- name: Symlink UEFI firmware files + file: + src: "{{ (ansible_os_family == 'RedHat') | ternary('/usr/share/OVMF/OVMF_CODE.secboot.fd', '/usr/share/qemu/ovmf-x86_64-ms-code.bin') }}" + dest: /usr/share/OVMF/OVMF_CODE.fd + state: link + when: + - ansible_os_family in ['RedHat', 'Suse'] + tags: + - nova-config + - nova-kvm + - nova-libvirt diff --git a/vars/debian.yml b/vars/debian.yml index 5a5fb5be..061aa089 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -93,6 +93,7 @@ nova_compute_kvm_distro_packages: - qemu-utils - qemu-user - qemu-kvm + - ovmf nova_compute_kvm_packages_to_symlink: - python-libvirt diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index 5c5b332f..c9e48676 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -73,6 +73,7 @@ nova_compute_kvm_distro_packages: - python-libguestfs - qemu-img-ev - sysfsutils + - "{{ (ansible_architecture == 'aarch64') | ternary('AAVMF', 'OVMF') }}" nova_compute_kvm_packages_to_symlink: - libvirt-python diff --git a/vars/suse.yml b/vars/suse.yml index d9b1c9fd..41373eaf 100644 --- a/vars/suse.yml +++ b/vars/suse.yml @@ -79,6 +79,7 @@ nova_compute_kvm_distro_packages: - qemu-block-iscsi - qemu-block-rbd - qemu-block-ssh + - qemu-ovmf-x86_64 - libvirt-python - nfs-utils - python-libguestfs