Install OVMF package

The OVMF package is required to allow UEFI boot of instances[1].

[1] https://docs.openstack.org/nova/latest/admin/uefi.html

Closes-Bug: #1853845
Change-Id: Ibb63750f20788c22c535a61c32ca09d484040ed0
This commit is contained in:
Takashi Kajinami 2023-11-01 12:50:53 +09:00
parent 29378852ad
commit 4d604ff4a9
4 changed files with 30 additions and 1 deletions

View File

@ -49,6 +49,10 @@
# (optional) virtstorage service name.
# Defaults to $::nova::params::virtstorage_socket_name
#
# [*manage_ovmf*]
# (optional) install the OVMF package.
# Defaults to true
#
class nova::compute::libvirt::services (
$ensure_package = 'present',
$libvirt_service_name = $::nova::params::libvirt_service_name,
@ -60,7 +64,8 @@ class nova::compute::libvirt::services (
$virtnodedev_service_name = $::nova::params::virtnodedev_socket_name,
$virtqemu_service_name = $::nova::params::virtqemu_socket_name,
$virtproxy_service_name = $::nova::params::virtproxy_socket_name,
$virtstorage_service_name = $::nova::params::virtstorage_socket_name
$virtstorage_service_name = $::nova::params::virtstorage_socket_name,
Boolean $manage_ovmf = true,
) inherits nova::params {
include nova::deps
@ -70,6 +75,16 @@ class nova::compute::libvirt::services (
fail('Modular libvirt daemons are not supported in this distribution')
}
if $manage_ovmf {
package { 'ovmf':
ensure => $ensure_package,
name => $::nova::params::ovmf_package_name,
tag => ['openstack', 'nova-support-package'],
}
Package['ovmf'] ~> Service<| tag == 'libvirt-qemu-service' |>
Package['ovmf'] ~> Service<| title == 'nova-compute'|>
}
if $libvirt_service_name {
# libvirt-nwfilter
if $facts['os']['family'] == 'RedHat' {

View File

@ -36,6 +36,7 @@ class nova::params {
$oslo_vmware_package_name = 'python3-oslo-vmware'
$mkisofs_package_name = 'xorriso'
$mkisofs_cmd = 'mkisofs'
$ovmf_package_name = 'edk2-ovmf'
# service names
$api_service_name = 'openstack-nova-api'
$api_metadata_service_name = undef
@ -85,6 +86,7 @@ class nova::params {
$oslo_vmware_package_name = 'python3-oslo-vmware'
$mkisofs_package_name = 'genisoimage'
$mkisofs_cmd = false
$ovmf_package_name = 'ovmf'
# service names
$api_service_name = 'nova-api'
$compute_service_name = 'nova-compute'

View File

@ -0,0 +1,6 @@
---
features:
- |
The ``nova::compute::libvirt::services`` now installs the OVMF package to
allow UEFI boot of instances. The package installation can be disabled by
setting the ``manage_ovmf`` parameter.

View File

@ -6,6 +6,7 @@ describe 'nova::compute::libvirt::services' do
context 'with default parameters' do
it 'deploys libvirt packages and services' do
is_expected.to contain_package('ovmf')
is_expected.to contain_package('libvirt')
is_expected.to contain_service('libvirt')
end
@ -16,6 +17,7 @@ describe 'nova::compute::libvirt::services' do
{
:libvirt_service_name => false,
:modular_libvirt => false,
:manage_ovmf => false,
}
end
@ -23,6 +25,10 @@ describe 'nova::compute::libvirt::services' do
is_expected.not_to contain_package('libvirt')
is_expected.not_to contain_service('libvirt')
end
it 'skips installing ovmf' do
is_expected.not_to contain_package('ovmf')
end
end
end