From fe880c2d80f863c570ecc062f79fc32da3b6e7c3 Mon Sep 17 00:00:00 2001 From: Pablo Fontanilla Date: Tue, 9 Jun 2026 11:56:50 +0200 Subject: [PATCH 1/8] NO-JIRA: Fix hardcoded x86_64 references in agent and boot-image paths Replace hardcoded x86_64 architecture strings with $(uname -m) or ${ARCH} so that agent-based installation scripts work on aarch64 hosts (e.g. AWS Graviton bare metal). Co-Authored-By: Claude Opus 4.6 --- agent/01_agent_requirements.sh | 2 +- agent/07_agent_add_extraworker_nodes.sh | 2 +- agent/common.sh | 2 +- agent/iscsi_utils.sh | 4 ++-- agent/iso_no_registry.sh | 6 +++--- rhcos.sh | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/agent/01_agent_requirements.sh b/agent/01_agent_requirements.sh index 5a60a6466..456a40b47 100755 --- a/agent/01_agent_requirements.sh +++ b/agent/01_agent_requirements.sh @@ -41,7 +41,7 @@ if [[ "${MIRROR_COMMAND}" == oc-mirror ]]; then oc_mirror_file=oc-mirror.tar.gz oc_mirror_exec=${oc_mirror_file%%.*} if [[ ! -f "/usr/local/bin/${oc_mirror_exec}" ]]; then - curl -O -L https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/${oc_mirror_file} + curl -O -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/${oc_mirror_file} tar xzf ${oc_mirror_file} chmod +x "${oc_mirror_exec}" sudo mv -f "${oc_mirror_exec}" /usr/local/bin diff --git a/agent/07_agent_add_extraworker_nodes.sh b/agent/07_agent_add_extraworker_nodes.sh index 277c52b46..edfe5690d 100755 --- a/agent/07_agent_add_extraworker_nodes.sh +++ b/agent/07_agent_add_extraworker_nodes.sh @@ -76,7 +76,7 @@ case "${AGENT_E2E_TEST_BOOT_MODE}" in for (( n=0; n < NUM_EXTRA_WORKERS; n++ )) do - sudo virt-xml "${CLUSTER_NAME}_extraworker_${n}" --add-device --disk "$OCP_DIR/add-node//node.x86_64.iso,device=cdrom,target.dev=sdc" + sudo virt-xml "${CLUSTER_NAME}_extraworker_${n}" --add-device --disk "$OCP_DIR/add-node//node.$(uname -m).iso,device=cdrom,target.dev=sdc" sudo virt-xml "${CLUSTER_NAME}_extraworker_${n}" --edit target=sda --disk="boot_order=1" sudo virt-xml "${CLUSTER_NAME}_extraworker_${n}" --edit target=sdc --disk="boot_order=2" --start done diff --git a/agent/common.sh b/agent/common.sh index 9579aff24..a0421a933 100644 --- a/agent/common.sh +++ b/agent/common.sh @@ -48,7 +48,7 @@ export EXTRA_MANIFESTS_PATH="${OCP_DIR}/openshift" # in install-config.yaml, OR # 3. ISCSI, to contain the iPXE file needed for iSCSI booting export BOOT_SERVER_DIR=${WORKING_DIR}/boot-artifacts -export PXE_BOOT_FILE=agent.x86_64.ipxe +export PXE_BOOT_FILE=agent.$(uname -m).ipxe # FIXME: agent/common.sh is sourced without network.sh # wrap_if_ipv6 and PROVISIONING_HOST_EXTERNAL_IP are undefined # errors masked by export which returns true diff --git a/agent/iscsi_utils.sh b/agent/iscsi_utils.sh index b5e6b2692..20b100714 100755 --- a/agent/iscsi_utils.sh +++ b/agent/iscsi_utils.sh @@ -31,7 +31,7 @@ function agent_create_iscsi_network() { - + @@ -79,7 +79,7 @@ function agent_create_iscsi_pxe_file() { # Set 'hostname' variable in file. It will be resolved by host during PXE boot # in order to access a unique target for this host. -cat > "${boot_dir}/agent.x86_64-iscsi.ipxe" << EOF +cat > "${boot_dir}/agent.$(uname -m)-iscsi.ipxe" << EOF #!ipxe set initiator-iqn ${ISCSI_INITIATOR_BASE}:\${hostname} sanboot --keep iscsi:${ISCSI_NETWORK_SUBNET}.1::::${ISCSI_INITIATOR_BASE}:\${hostname} diff --git a/agent/iso_no_registry.sh b/agent/iso_no_registry.sh index d3397d6e2..e71925ac3 100755 --- a/agent/iso_no_registry.sh +++ b/agent/iso_no_registry.sh @@ -106,7 +106,7 @@ function create_agent_iso_no_registry() { # Deletes all files and directories under asset_dir # example, ocp/ostest/iso_builder/4.19.* -# except the final generated ISO file (agent-ove.x86_64.iso), +# except the final generated ISO file (agent-ove.${ARCH}.iso), # to free up disk space while preserving the built artifact. # Note: This optional cleanup is relevant only when the # AGENT_CLEANUP_ISO_BUILDER_CACHE_LOCAL_DEV is set as as true, @@ -119,8 +119,8 @@ function cleanup_diskspace_agent_iso_noregistry() { echo "Cleaning up directory: $dir" - # Delete all files and symlinks except the agent-ove.x86_64.iso - sudo find "$dir" \( -type f -o -type l \) ! -name 'agent-ove.x86_64.iso' -print -delete + # Delete all files and symlinks except the agent-ove ISO + sudo find "$dir" \( -type f -o -type l \) ! -name "agent-ove.${ARCH}.iso" -print -delete # Remove any empty directories left behind sudo find "$dir" -type d -empty -print -delete diff --git a/rhcos.sh b/rhcos.sh index 399377726..a092052ef 100644 --- a/rhcos.sh +++ b/rhcos.sh @@ -1,6 +1,6 @@ if $OPENSHIFT_INSTALLER coreos print-stream-json >/dev/null 2>&1; then $OPENSHIFT_INSTALLER coreos print-stream-json > "$OCP_DIR/rhcos.json" - TOP_LEVEL_FORMAT="$(jq -r '.architectures.x86_64.artifacts.openstack.formats | keys[]' "$OCP_DIR/rhcos.json" | head -n1)" + TOP_LEVEL_FORMAT="$(jq -r ".architectures.$(uname -m).artifacts.openstack.formats | keys[]" "$OCP_DIR/rhcos.json" | head -n1)" MACHINE_OS_INSTALLER_IMAGE_URL=$(jq -r ".architectures.$(uname -m).artifacts.openstack.formats[\"${TOP_LEVEL_FORMAT}\"].disk.location" "$OCP_DIR/rhcos.json") export MACHINE_OS_INSTALLER_IMAGE_URL MACHINE_OS_INSTALLER_IMAGE_SHA256=$(jq -r ".architectures.$(uname -m).artifacts.openstack.formats[\"${TOP_LEVEL_FORMAT}\"].disk[\"sha256\"]" "$OCP_DIR/rhcos.json") From 15c417fff531cc73d30f3dc889f8f4f51d25f765 Mon Sep 17 00:00:00 2001 From: Pablo Fontanilla Date: Tue, 9 Jun 2026 11:04:13 +0200 Subject: [PATCH 2/8] NO-JIRA: Fix aarch64 CPU model for native KVM deployments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The metal3-dev-env baremetalvm.xml.j2 template hardcodes cortex-a57 for all aarch64 VMs. This CPU model only works under QEMU emulation; native aarch64 KVM (e.g. AWS Graviton bare metal) requires host-passthrough. Narrow the CPU-section conditional from `{% if is_aarch64 %}` to `{% if is_aarch64 and libvirt_domain_type == 'qemu' %}` so that native KVM falls through to host-passthrough. The other three is_aarch64 blocks (, , VNC) are unaffected — the sed targets only the CPU block by matching its adjacent HTML comment line. Tested on AWS c7g.metal (Graviton3) with OCP 4.22.0-rc.5 — full fencing-IPI deployment with Pacemaker/STONITH operational. Co-Authored-By: Claude Opus 4.6 --- 02_configure_host.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/02_configure_host.sh b/02_configure_host.sh index f6bcb1a97..a43c67d5e 100755 --- a/02_configure_host.sh +++ b/02_configure_host.sh @@ -129,6 +129,15 @@ export VNC_CONSOLE=true if [[ $(uname -m) == "aarch64" ]]; then VNC_CONSOLE=false echo "libvirt_cdrombus: scsi" >> vm_setup_vars.yml + # On native aarch64 KVM (e.g. AWS Graviton), the upstream metal3-dev-env + # template hardcodes cortex-a57 for all aarch64 VMs. That model only works + # under qemu emulation; native KVM requires host-passthrough. Narrow the + # CPU conditional so native aarch64 falls through to host-passthrough, + # without affecting the or sections that must still fire. + TEMPLATE="${VM_SETUP_PATH}/roles/libvirt/templates/baremetalvm.xml.j2" + if [ -f "${TEMPLATE}" ]; then + sed -i '/{% if is_aarch64 %}/{N; /