Skip to content
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
6 changes: 3 additions & 3 deletions deploy/aws-hypervisor/instance.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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=''

Expand Down
12 changes: 11 additions & 1 deletion deploy/aws-hypervisor/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion deploy/aws-hypervisor/scripts/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +32 to +38

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

fd -a 'build-metal3-arm64.sh' .
curl -fsSL https://raw.githubusercontent.com/openshift-metal3/dev-scripts/master/config_example.sh \
  | rg -n 'IRONIC_IMAGE|VBMC_IMAGE|SUSHY_TOOLS_IMAGE'

Repository: openshift-eng/two-node-toolbox

Length of output: 56


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Check whether the referenced helper exists anywhere in this repo
echo "== Local helper search =="
fd -a 'build-metal3-arm64\.sh' . || true
rg -n --hidden --no-ignore-vcs 'build-metal3-arm64|metal3-arm64|SUSHY_TOOLS_IMAGE|VBMC_IMAGE|IRONIC_IMAGE' . || true

# 2) Pull upstream config_example.sh and inspect the relevant parts
echo "== Upstream config_example.sh search =="
curl -fsSL https://raw.githubusercontent.com/openshift-metal3/dev-scripts/master/config_example.sh \
  | rg -n 'IRONIC_IMAGE|VBMC_IMAGE|SUSHY_TOOLS_IMAGE|aarch64|arm64|metal3.*arm|build-metal3-arm64' || true

# 3) Show surrounding context for any match (if present)
curl -fsSL https://raw.githubusercontent.com/openshift-metal3/dev-scripts/master/config_example.sh \
  | rg -n -C 3 'IRONIC_IMAGE|VBMC_IMAGE|SUSHY_TOOLS_IMAGE|aarch64|arm64|build-metal3-arm64' || true

Repository: openshift-eng/two-node-toolbox

Length of output: 2353


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Upstream: OPENSHIFT_RELEASE_IMAGE context =="
curl -fsSL https://raw.githubusercontent.com/openshift-metal3/dev-scripts/master/config_example.sh \
  | rg -n -C 3 'OPENSHIFT_RELEASE_IMAGE' || true

echo "== Upstream: metal3/arm64 helper+image var search =="
curl -fsSL https://raw.githubusercontent.com/openshift-metal3/dev-scripts/master/config_example.sh \
  | rg -n 'IRONIC_IMAGE|VBMC_IMAGE|SUSHY_TOOLS_IMAGE|metal3.*arm|arm64|build-metal3-arm64' || true

Repository: openshift-eng/two-node-toolbox

Length of output: 1686


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n --hidden --no-ignore-vcs 'IRONIC_IMAGE|VBMC_IMAGE|SUSHY_TOOLS_IMAGE' . || true
rg -n --hidden --no-ignore-vcs 'build-metal3-arm64\.sh' . || true
fd -a 'build-metal3.*arm64.*\.sh' . || true

Repository: openshift-eng/two-node-toolbox

Length of output: 710


Fix arm64 Metal3 override example to match current dev-scripts

  • Upstream openshift-metal3/dev-scripts config_example.sh only advises: β€œDo not use for arm64, instead override OPENSHIFT_RELEASE_IMAGE”, and does not mention IRONIC_IMAGE, VBMC_IMAGE, SUSHY_TOOLS_IMAGE, or helpers/build-metal3-arm64.sh.
  • In this repo, those env vars/helper are referenced only in deploy/openshift-clusters/roles/dev-scripts/install-dev/files/config_fencing_example.sh (lines 32-38). Update the example to align with the current upstream arm64 approach (e.g., OPENSHIFT_RELEASE_IMAGE) or reference the correct upstream helper/variables.
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@deploy/openshift-clusters/roles/dev-scripts/install-dev/files/config_fencing_example.sh`
around lines 32 - 38, The arm64 Metal3 override block in
config_fencing_example.sh incorrectly suggests setting IRONIC_IMAGE, VBMC_IMAGE,
SUSHY_TOOLS_IMAGE and referencing helpers/build-metal3-arm64.sh; update this
example to match upstream dev-scripts by removing those commented env vars and
helper reference and instead instruct users to override OPENSHIFT_RELEASE_IMAGE
for arm64 (or reference the correct upstream helper/variable if you prefer that
upstream alternative). Locate the aarch64 block (symbols: IRONIC_IMAGE,
VBMC_IMAGE, SUSHY_TOOLS_IMAGE, helpers/build-metal3-arm64.sh,
OPENSHIFT_RELEASE_IMAGE) and replace the content with a concise comment that
mirrors upstream guidance: "Do not use for arm64; override
OPENSHIFT_RELEASE_IMAGE" (or point to the proper upstream helper) so the example
is accurate.