From 7be2b57549862c6c21d35183c035d0148d7b3646 Mon Sep 17 00:00:00 2001 From: Pablo Fontanilla Date: Thu, 4 Jun 2026 11:39:41 +0200 Subject: [PATCH] fix: support Graviton (aarch64) bare metal instance types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Broaden metal-detection regex from c-family-only to any .metal suffix, covering Graviton types like c7g.metal, m7g.metal, r7g.metal - Fix AMI auto-detect for aarch64: map aarch64 → arm64 to match AWS naming convention, and drop GA-only filter that excluded arm64 AMIs - Add Graviton hints to instance.env.template - Add commented-out aarch64 Metal3 image overrides to fencing example config Co-Authored-By: Claude Opus 4.6 --- deploy/aws-hypervisor/instance.env.template | 6 +++--- deploy/aws-hypervisor/scripts/common.sh | 12 +++++++++++- deploy/aws-hypervisor/scripts/create.sh | 2 +- .../install-dev/files/config_fencing_example.sh | 8 ++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/deploy/aws-hypervisor/instance.env.template b/deploy/aws-hypervisor/instance.env.template index 19d7917..b8eeaf0 100644 --- a/deploy/aws-hypervisor/instance.env.template +++ b/deploy/aws-hypervisor/instance.env.template @@ -5,9 +5,9 @@ export SHARED_DIR="instance-data" export AWS_PROFILE=microshift-dev export STACK_NAME=${USER}-dev -export RHEL_HOST_ARCHITECTURE=x86_64 +export RHEL_HOST_ARCHITECTURE=x86_64 # Use "aarch64" for Graviton instances export REGION=us-west-2 -export EC2_INSTANCE_TYPE="c5n.metal" +export EC2_INSTANCE_TYPE="c5n.metal" # Graviton bare metal: c7g.metal, m7g.metal, r7g.metal export AWS_DEFAULT_REGION=us-west-2 # EC2 Capacity Reservation Settings @@ -20,7 +20,7 @@ export ENABLE_CAPACITY_RESERVATION=true export SSH_PUBLIC_KEY=/home/${USER}/.ssh/id_ed25519.pub #It is suggested that this key has no passphrase for ease of use -# Leave empty for auto-detect ami for images, defaults to RHEL 9.6 GA +# Leave empty to auto-detect the latest RHEL AMI for RHEL_HOST_ARCHITECTURE export RHEL_HOST_AMI='' export RHEL_VERSION='' diff --git a/deploy/aws-hypervisor/scripts/common.sh b/deploy/aws-hypervisor/scripts/common.sh index 160d1d3..ae4e226 100755 --- a/deploy/aws-hypervisor/scripts/common.sh +++ b/deploy/aws-hypervisor/scripts/common.sh @@ -47,11 +47,21 @@ function msg_info() { echo -e "${COLOR_BLUE}INFO: ${1}${COLOR_CLEAR}" >&2 } +function get_ami_arch() { + local arch="${RHEL_HOST_ARCHITECTURE}" + if [[ "${arch}" == "aarch64" ]]; then + arch="arm64" + fi + echo "${arch}" +} + function aws_ec2_describe_images() { + local ami_arch + ami_arch="$(get_ami_arch)" # shellcheck disable=SC2153 # REGION is an env var from instance.env, not a misspelling of local 'region' aws ec2 describe-images \ --query 'reverse(sort_by(Images, &CreationDate))[].[Name, ImageId, CreationDate]' \ - --filters "Name=name,Values=RHEL-${RHEL_VERSION}.*GA*${RHEL_HOST_ARCHITECTURE}*" \ + --filters "Name=name,Values=RHEL-${RHEL_VERSION}*${ami_arch}*" \ --region "${REGION}" \ --owners amazon \ --output json \ diff --git a/deploy/aws-hypervisor/scripts/create.sh b/deploy/aws-hypervisor/scripts/create.sh index ac2804b..0e5a08c 100755 --- a/deploy/aws-hypervisor/scripts/create.sh +++ b/deploy/aws-hypervisor/scripts/create.sh @@ -91,7 +91,7 @@ else fi ec2Type="VirtualMachine" -if [[ "$EC2_INSTANCE_TYPE" =~ c[0-9]+[a-z]*.metal ]]; then +if [[ "$EC2_INSTANCE_TYPE" =~ \.metal$ ]]; then ec2Type="MetalMachine" fi diff --git a/deploy/openshift-clusters/roles/dev-scripts/install-dev/files/config_fencing_example.sh b/deploy/openshift-clusters/roles/dev-scripts/install-dev/files/config_fencing_example.sh index d5614f9..2291e37 100644 --- a/deploy/openshift-clusters/roles/dev-scripts/install-dev/files/config_fencing_example.sh +++ b/deploy/openshift-clusters/roles/dev-scripts/install-dev/files/config_fencing_example.sh @@ -28,3 +28,11 @@ export OPENSHIFT_RELEASE_IMAGE=quay.io/openshift-release-dev/ocp-release:4.21.0- # Disable sigstore image verification during installation export OPENSHIFT_INSTALL_EXPERIMENTAL_DISABLE_IMAGE_POLICY=true + +# aarch64 (Graviton) Metal3 image overrides — upstream images are x86_64-only. +# Rebuild monthly with: helpers/build-metal3-arm64.sh +# if [ "$(uname -m)" = "aarch64" ]; then +# export IRONIC_IMAGE=quay.io/rh-edge-enablement/ironic:2026-06 +# export VBMC_IMAGE=quay.io/rh-edge-enablement/vbmc:2026-06 +# export SUSHY_TOOLS_IMAGE=quay.io/rh-edge-enablement/sushy-tools:2026-06 +# fi