Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use UEFI instead of legacy as default boot mode #1326

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
#
# Set libvirt firmware and BMC bootMode
# Choose "legacy" (bios), "UEFI", or "UEFISecureBoot"
# Defaults to legacy for ipv4, UEFI for ipv6
# Defaults to UEFI
# export BOOT_MODE="UEFI"

# Select the Cluster API provider Metal3 version
Expand Down
1 change: 1 addition & 0 deletions lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ source "${CONFIG}"
export CI_CONFIG_FILE="${TMP_DIR:-/tmp}/config_ci.sh"

# Set variables
export BOOT_MODE="${BOOT_MODE:-UEFI}"
export MARIADB_HOST="mariaDB"
export MARIADB_HOST_IP="127.0.0.1"
# Additional DNS
Expand Down
1 change: 0 additions & 1 deletion lib/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ if [[ "${BARE_METAL_PROVISIONER_SUBNET_IPV6_ONLY}" == "true" ]]; then
export BOOT_MODE="${BOOT_MODE:-UEFI}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this export is no longer needed?

export BARE_METAL_PROVISIONER_NETWORK="${BARE_METAL_PROVISIONER_NETWORK:-fd2e:6f44:5dd8:b856::/64}"
else
export BOOT_MODE="${BOOT_MODE:-legacy}"
Rozzii marked this conversation as resolved.
Show resolved Hide resolved
Rozzii marked this conversation as resolved.
Show resolved Hide resolved
export BARE_METAL_PROVISIONER_NETWORK="${BARE_METAL_PROVISIONER_NETWORK:-172.22.0.0/24}"
fi

Expand Down
2 changes: 1 addition & 1 deletion vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ assured that they are persisted.
| BMO_ROLLOUT_WAIT | Number of minutes(Until max 10m that is the default value of deployment.spec.progressDeadlineSeconds) to wait for BMO rollout | | 5 |
| BMC_DRIVER | Set the BMC driver | "ipmi", "redfish", "redfish-virtualmedia" | "mixed" |
| BMORELEASEBRANCH | BMO Release branch | "main", "release-0.4" | Set via jjb for CI, for local dev it gets default value based on CAPM3 branch |
| BOOT_MODE | Set libvirt firmware and BMH bootMode | "legacy", "UEFI", "UEFISecureBoot" | "legacy" |
| BOOT_MODE | Set libvirt firmware and BMH bootMode | "legacy", "UEFI", "UEFISecureBoot" | "UEFI" |
Rozzii marked this conversation as resolved.
Show resolved Hide resolved
| IMAGE_OS | OS of the image to boot the nodes from, overriden by IMAGE\_\* if set | "centos", "cirros", "FCOS", "ubuntu", "flatcar" | "centos" |
| IMAGE_NAME | Image for target hosts deployment | | "CENTOS_9_NODE_IMAGE_K8S_${KUBERNETES_VERSION}.qcow2" |
| IMAGE_LOCATION | Location of the image to download | | https://artifactory.nordix.org/artifactory/metal3/images/${KUBERNETES_VERSION} |
Expand Down
2 changes: 2 additions & 0 deletions vm-setup/roles/common/tasks/vm_nodes_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
loop: "{{ range(0, lookup('vars', 'num_' + flavor.key + 's')|int)|list }}"
- set_fact:
vm_nodes_index: "{{vm_nodes_index|int + lookup('vars', 'num_' + flavor.key + 's')|int }}"
- set_fact:
host_os: "{{ lookup('ansible.builtin.env', 'OS') }}"
2 changes: 1 addition & 1 deletion vm-setup/roles/libvirt/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ libvirt_diskbus: scsi
libvirt_cdrombus: sata
libvirt_arch: x86_64
libvirt_cpu_mode: host-model
libvirt_firmware: bios
libvirt_firmware: uefi
libvirt_secure_boot: false

# Where to log serial console output
Expand Down
14 changes: 9 additions & 5 deletions vm-setup/roles/libvirt/templates/baremetalvm.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,25 @@
<os>
<type arch='{{ libvirt_arch }}' machine='q35'>hvm</type>
{% if libvirt_firmware == 'uefi' %}
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
{% if libvirt_secure_boot|bool %}
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_VARS.secboot.fd</loader>
<nvram template="/usr/share/OVMF/OVMF_VARS.secboot.fd">/var/lib/libvirt/qemu/nvram/{{ item.name }}.fd</nvram>
{% elif host_os == 'centos' or host_os == 'rhel' %}
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_VARS.fd</loader>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/VARS/CODE/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On centos it is VARS on ubuntu it is CODE, this is the centos condition

<nvram template="/usr/share/OVMF/OVMF_VARS.fd">/var/lib/libvirt/qemu/nvram/{{ item.name }}.fd</nvram>
{% else %}
<nvram>/var/lib/libvirt/qemu/nvram/{{ item.name }}.fd</nvram>
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<nvram template="/usr/share/OVMF/OVMF_CODE.fd">/var/lib/libvirt/qemu/nvram/{{ item.name }}.fd</nvram>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/CODE/VARS/

{% endif %}
{% endif %}
<boot dev='network'/>
<bootmenu enable='no'/>
<bios useserial='yes' rebootTimeout='10000'/>
</os>
{% else %}
<os firmware='efi'>
<type arch='aarch64' machine='virt-rhel8.2.0'>hvm</type>
</os>
<os firmware='efi'>
<type arch='aarch64' machine='virt-rhel8.2.0'>hvm</type>
</os>
{% endif %}

<features>
Expand Down