From 0c71eb5bd46d9ebc8940e6f75550a23713bedf64 Mon Sep 17 00:00:00 2001 From: nofaralfasi Date: Sun, 28 Jul 2024 20:00:06 +0300 Subject: [PATCH] Fixes #37692 - Add firmware option for Libvirt hosts creation New `firmware` option for creating new hosts in Libvirt, allowing users to specify the VM firmware type, including Secure Boot. --- doc/host_create.md | 1 + lib/hammer_cli_foreman/compute_resource/libvirt.rb | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/host_create.md b/doc/host_create.md index 31ffe16de..072404eed 100644 --- a/doc/host_create.md +++ b/doc/host_create.md @@ -195,6 +195,7 @@ Available keys for `--compute-attributes`: cpus # number of CPUs memory # string, amount of memory, value in bytes start # Must be a 1 or 0, whether to start the machine or not +firmware # one of [automatic, bios, uefi, uefi_secure_boot] ``` Available keys for `--interface`: diff --git a/lib/hammer_cli_foreman/compute_resource/libvirt.rb b/lib/hammer_cli_foreman/compute_resource/libvirt.rb index bf04a86e4..26a5e079c 100644 --- a/lib/hammer_cli_foreman/compute_resource/libvirt.rb +++ b/lib/hammer_cli_foreman/compute_resource/libvirt.rb @@ -9,7 +9,8 @@ def compute_attributes [ ['cpus', _('Number of CPUs'), { bold: true }], ['memory', _('String, amount of memory, value in bytes'), { bold: true }], - ['boot_order', _('Device names to specify the boot order')] + ['boot_order', _('Device names to specify the boot order')], + ['firmware', _('automatic/bios/uefi/uefi_secure_boot (EFI with Secure Boot enabled)')] ] end @@ -49,7 +50,9 @@ def provider_vm_specific_fields Fields::Field.new(:label => _('OS Type'), :path => [:os_type]), Fields::Field.new(:label => _('Domain Type'), :path => [:domain_type]), Fields::Field.new(:label => _('Persistent'), :path => [:persistent]), - Fields::List.new(:label => _('Boot order'), :path => [:boot_order]) + Fields::List.new(:label => _('Boot order'), :path => [:boot_order]), + Fields::Field.new(:label => _('Firmware'), :path => [:firmware]), + Fields::Field.new(:label => _('Secure Boot'), :path => [:secure_boot]) ] end