flatcar / Flatcar

Flatcar project repository for issue tracking, project documentation, etc.
https://www.flatcar.org/
Apache License 2.0
749 stars 32 forks source link

AWS AMI does not support instance type m6a.4xlarge any longer. #1380

Open evilbulgarian opened 8 months ago

evilbulgarian commented 8 months ago

Description

[ 1 paragraph concisely describing the bug ] I started using m6a.4xlarge instances with flatcar. I currently get the current ami via this terraform code:

data "aws_ami" "flatcar_stable_latest" {
  most_recent = true
  owners      = ["aws-marketplace"]

  filter {
    name   = "architecture"
    values = ["x86_64"]
  }

  filter {
    name   = "virtualization-type"
    values = ["hvm"]
  }

  filter {
    name   = "name"
    values = ["Flatcar-stable-*"]
  }
}

This is the subscription I need for the above generated ami: https://us-east-1.console.aws.amazon.com/marketplace/home?region=ap-south-1#/subscriptions/7b88ef15-f132-4f76-80aa-a06e68eb0117

but recently I am not able to create instances with this ami and m6a.4xlarge because they are unsupported. Any idea what has changed?

Impact

no support for common aws instance types.

Environment and steps to reproduce

go to subscription https://us-east-1.console.aws.amazon.com/marketplace/home?region=ap-south-1#/subscriptions/7b88ef15-f132-4f76-80aa-a06e68eb0117 and select provision, then try and select m6a.4xlarge

Expected behavior

new instance should work with that ami

Additional information

Please add any information here that does not fit the above format.

jepio commented 8 months ago

@evilbulgarian what is the error that you see?

Running the follow returns the correct image metadata for me:

$ aws --region ap-south-1 ec2 describe-images --image-ids ami-0d894090ed3f32fb4
{
    "Images": [
        {
            "Architecture": "x86_64",
            "CreationDate": "2024-02-13T17:09:45.000Z",
            "ImageId": "ami-0d894090ed3f32fb4",
            "ImageLocation": "075585003325/Flatcar-stable-3815.2.0-hvm",
            "ImageType": "machine",
            "Public": true,
            "OwnerId": "075585003325",
            "PlatformDetails": "Linux/UNIX",
            "UsageOperation": "RunInstances",
            "State": "available",
            "BlockDeviceMappings": [
                {
                    "DeviceName": "/dev/xvda",
                    "Ebs": {
                        "DeleteOnTermination": true,
                        "SnapshotId": "snap-0221273149e395c5d",
                        "VolumeSize": 8,
                        "VolumeType": "gp2",
                        "Encrypted": false
                    }
                },
                {
                    "DeviceName": "/dev/xvdb",
                    "VirtualName": "ephemeral0"
                }
            ],
            "Description": "Flatcar Container Linux stable 3815.2.0 (HVM)",
            "EnaSupport": true,
            "Hypervisor": "xen",
            "Name": "Flatcar-stable-3815.2.0-hvm",
            "RootDeviceName": "/dev/xvda",
            "RootDeviceType": "ebs",
            "SriovNetSupport": "simple",
            "Tags": [
                {
                    "Key": "Channel",
                    "Value": "stable"
                },
                {
                    "Key": "Name",
                    "Value": "Flatcar-stable-3815.2.0-hvm"
                },
                {
                    "Key": "Version",
                    "Value": "3815.2.0"
                }
            ],
            "VirtualizationType": "hvm",
            "DeprecationTime": "2026-02-13T17:09:45.000Z"
        }
    ]
}
jepio commented 8 months ago

and i tested deploying it onto m6a.4xlarge and everything worked.

evilbulgarian commented 8 months ago

hi, @jepio thanks for looking into it. I am not able to deploy it into all of our environments except our development ones where its been running for months now. I am getting this error:

│ Error: creating Auto Scaling Group (aws-euw1-xxxx): ValidationError: You must use a valid fully-formed launch template. The instance configuration for this AWS Marketplace product is not supported. Please see the AWS Marketplace site for more information about supported instance types, regions, and operating systems.

Also when I go from aws console to that subscription then click on launch ec2 instance from there I am not able to select the m6a.4xlarge or a bunch of other instances actually.

evilbulgarian commented 8 months ago

image region: eu-west-1 ami: ami-051579cd71a0fad8a directly from aws console flatcar stable pro subscription

{
    "Images": [
        {
            "Architecture": "x86_64",
            "CreationDate": "2024-02-13T18:05:27.000Z",
            "ImageId": "ami-051579cd71a0fad8a",
            "ImageLocation": "aws-marketplace/Flatcar-stable-3815.2.0-hvm-7b88ef15-f132-4f76-80aa-a06e68eb0117",
            "ImageType": "machine",
            "Public": true,
            "OwnerId": "679593333241",
            "PlatformDetails": "Linux/UNIX",
            "UsageOperation": "RunInstances",
            "ProductCodes": [
                {
                    "ProductCodeId": "7badopnb0xj09q5lvbsczt82f",
                    "ProductCodeType": "marketplace"
                }
            ],
            "State": "available",
            "BlockDeviceMappings": [
                {
                    "DeviceName": "/dev/xvda",
                    "Ebs": {
                        "DeleteOnTermination": true,
                        "SnapshotId": "snap-01f1de2a50744a76a",
                        "VolumeSize": 8,
                        "VolumeType": "gp2",
                        "Encrypted": false
                    }
                },
                {
                    "DeviceName": "/dev/xvdb",
                    "VirtualName": "ephemeral0"
                }
            ],
            "Description": "Flatcar Container Linux stable 3815.2.0 (HVM)",
            "EnaSupport": true,
            "Hypervisor": "xen",
            "ImageOwnerAlias": "aws-marketplace",
            "Name": "Flatcar-stable-3815.2.0-hvm-7b88ef15-f132-4f76-80aa-a06e68eb0117",
            "RootDeviceName": "/dev/xvda",
            "RootDeviceType": "ebs",
            "SriovNetSupport": "simple",
            "VirtualizationType": "hvm",
            "DeprecationTime": "2026-02-13T18:05:27.000Z"
        }
    ]
}

Lastly changing from m6a.4xlarge to m5a.4xlarge seems to work on regions i tested with same terraform code just instance changed.

jepio commented 8 months ago

Can you check us-west-2? Also, could you try deploying directly from the aws cli? I had no problems creating an m6a.4xlarge instance with our AMIs. I don't see any way for an AMI to specifically indicate compatibility with m6a.

evilbulgarian commented 8 months ago

Can you check us-west-2? Also, could you try deploying directly from the aws cli? I had no problems creating an m6a.4xlarge instance with our AMIs. I don't see any way for an AMI to specifically indicate compatibility with m6a.

Yup I already tried this from terraform which uses the aws cli, in us-west-2 as well. I reached out to our aws support and they did verify the issue:

Testing the launch at my end:
-----------------------------------
To begin with, I first tried to launch an m6a.4xlarge instance from the same image: ami-04d45fee0c91a6cfc in my test environment in us-west-2 region and could see that the m6 instance types in general were greyed out and were not available to choose from.

I also tried to launch this using AWS CLI from my end in different AZs in us-west-2 region and was getting the below error :

---------------------
aws ec2 run-instances --image-id ami-04d45fee0c91a6cfc --instance-type m6a.4xlarge --region us-west-2 --key-name us-west-2.pem

An error occurred (UnsupportedOperation) when calling the RunInstances operation: The instance configuration for this AWS Marketplace product is not supported. Please see the AWS Marketplace site for more information about supported instance types, regions, and operating systems.
---------------------

Checking from cloudtrail, I was able to see that you were getting multiple:client unsupported operation calls messages with the same error as I received above. I am attaching one sample call below for reference:

With respect to the Marketplace image:
---------------------------------------------
I then looked at the supported instance types for this image from their marketplace product details and could see that m6 instance types are currently not supported by this image. You can look at the supported instances here:

[+]https://aws.amazon.com/marketplace/pp/prodview-wyjmaxopwi2pw#pdp-overview