redhat-developer / redhat-developer/mapt

[bug] aws rhel-ai create: AMI architecture hard-coded to x86_64, ARM64 instance types fail

Open
#901 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

info-required os/RHEL-AI
Dominant language
Go
Stars
24
Forks
36
Avg merge
6d 13h
Merged PRs (30d)
8

Description

When using aws rhel-ai create with ARM64 instance types (e.g. Graviton-based g5g.*), the provisioning fails because the AMI lookup is hard-coded to x86_64. The selected AMI architecture doesn't match the requested instance architecture.

Steps to Reproduce

mapt aws rhel-ai create \
  --project-name test \
  --backed-url file:///workspace \
  --conn-details-output /workspace \
  --version 3.4.0 \
  --spot --spot-eviction-tolerance medium \
  --compute-sizes g5g.xlarge,g5g.2xlarge,g5g.4xlarge

Error

error: sdk-v2/provider2.go:571: sdk.helper_schema: creating Auto Scaling Group (main-araid-asg-19f8de4):
operation error Auto Scaling: CreateAutoScalingGroup, api error ValidationError:
You must use a valid fully-formed launch template. The architecture 'arm64' of the specified instance type
does not match the architecture 'x86_64' of the specified AMI.

Root Cause (Opus says...)

The AMI architecture is hard-coded to "x86_64" in pkg/provider/aws/action/rhel-ai/constants.go:25 and used in all AMI lookups. Unlike aws rhel create, the aws rhel-ai create command does not expose an --arch flag.

Specifically:

  • constants.go:25 defines amiArch = "x86_64" as a package-level variable
  • rhelai.go lines 136, 140, 288-298 all use this hard-coded value for AMI filtering
  • cmd/mapt/cmd/aws/hosts/rhelai.go does not register a --arch flag (compare with rhel.go:77)
  • The RHELAIArgs.Arch field exists but is never populated from CLI flags, and its value is stored in rhelAIRequest.arch but never used

Expected Behavior

aws rhel-ai create should select the correct AMI based on the VM type it selects, or support an --arch flag, and use it when filtering AMIs/selecting instance types.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/provider/aws/action/rhel-ai/constants.go:25 and the AMI lookup and instance-selection logic in rhelai.go:136, 140, and 288-298. Compare CLI architecture handling in cmd/mapt/cmd/aws/hosts/rhelai.go with rhel.go:77, then trace RHELAIArgs.Arch and rhelAIRequest.arch. Done means ARM64 instance types select a matching AMI, or an --arch value is consistently supported through filtering and instance selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.