axiom icon indicating copy to clipboard operation
axiom copied to clipboard

Axiom fleet init fails on AWS + multiple regions.

Open vulnerablecodes opened this issue 1 year ago • 2 comments

PROVIDER: AWS

COMMAND: axiom-fleet test-deploy -i 500 --regions eu-north-1,ap-south-1,eu-west-3,eu-west-2,eu-west-1,ap-northeast-3,ap-northeast-2,me-south-1,ap-northeast-1,sa-east-1,ca-central-1,ap-east-1,ap-southeast-1,ap-southeast-2,eu-central-1,us-east-1,us-east-2,us-west-1,us-west-2

OUTPUT / ERROR: Initializing new fleet 'test-deploy' with 500 instances... Cycling through following regions:eu-north-1,ap-south-1,eu-west-3,eu-west-2,eu-west-1,ap-northeast-3,ap-northeast-2,me-south-1,ap-northeast-1,sa-east-1,ca-central-1,ap-east-1,ap-southeast-1,ap-southeast-2,eu-central-1,us-east-1,us-east-2,us-west-1,us-west-2... INITIALIZING IN 5 SECONDS, CTRL+C to quit... Instances: [ test-deploy01 An error occurred (InvalidAMIID.NotFound) when calling the RunInstances operation: The image id '[ami-02ea4697a7r5c4e1]' does not exist

ISSUE: When I saw the above error, I assumed I simply had to copy my current axiom image to all of my enabled regions and it would solve the problem.

I wrote a small script that copies my current ami to all of my enabled AWS regions. The problem with this approach is that AWS (in all its glory), changes the ami id once the ami copy is placed in the new region.

Therefore I was able to confirm the error above (The image id '[ami-02ea4697a7r5c4e1]' does not exist), because that specific ami id truly does not exist since it got changed upon being copied to the new region.

POSSIBLE FIX: Update axiom to pull/honor/use the unique ami id (from each new copy) in each respective region instead of requiring the original source ami id (ami-02ea4697a7r5c4e1) from the original axiom image where it was copied from.

vulnerablecodes avatar Sep 14 '22 16:09 vulnerablecodes

@vulnerablecodes Could you share your script? I also encounter the same issue. I will attempt a solution...

nicoandmee avatar Sep 19 '22 09:09 nicoandmee

@vulnerablecodes I can haz script? I would like to add: I have this issue even with a single region, but if I go into the EC2 console I'm able to spin up the instances manually using the AMI. 🤔

nicoandmee avatar Sep 24 '22 01:09 nicoandmee