Skip to content

Support for multiple instance types #216

@ErinWeisbart

Description

@ErinWeisbart

h/t @emiglietta

In config:
MACHINE_TYPE = ['m5.xlarge','c5.xlarge','c4.xlarge']

(make sure that the MEMORY allocated to the containers is compatible with all machine types)

In the fleet file, triplicate the multi-subnet ‘Launch specification’ block (current DCP walks through the list of instances in the config file and matches each one with a launch specification):

{
  "IamFleetRole": "arn:aws:iam::XXXXXXXXX:role/aws-ec2-spot-fleet-tagging-role",
  "AllocationStrategy": "lowestPrice",
  "TerminateInstancesWithExpiration": true,
  "LaunchSpecifications": [
    {
      "ImageId": "ami-0ce03502c5bb5e188",
      "SubnetId": "subnet-AAAAAAAAA, subnet-BBBBBBBBB, subnet-CCCCCCCCC, subnet-DDDDDDDDD",
      "KeyName": "KEYNAME",
      "IamInstanceProfile": {
        "Arn": "arn:aws:iam::XXXXXXXXX:instance-profile/ecsInstanceRole"
      },
      "SecurityGroups": [
        {
          "GroupId": "sg-ZZZZZZZZZ"
        }
      ],
      "BlockDeviceMappings": [
        {
          "DeviceName": "/dev/xvda",
          "Ebs": {
            "DeleteOnTermination": true,
            "VolumeType": "gp3",
            "VolumeSize": 24,
            "SnapshotId": "snap-0a7b4ece894d62882"
          }
        },
        {
          "DeviceName": "/dev/xvdcz",
          "Ebs": {
            "DeleteOnTermination": true,
            "VolumeType": "gp3"
          }
        }
      ]
    },
    {
      "ImageId": "ami-0ce03502c5bb5e188",
      "SubnetId": "subnet-AAAAAAAAA, subnet-BBBBBBBBB, subnet-CCCCCCCCC, subnet-DDDDDDDDD",
      "KeyName": "KEYNAME",
      "IamInstanceProfile": {
        "Arn": "arn:aws:iam::XXXXXXXXX:instance-profile/ecsInstanceRole"
      },
      "SecurityGroups": [
        {
          "GroupId": "sg-ZZZZZZZZZ"
        }
      ],
      "BlockDeviceMappings": [
        {
          "DeviceName": "/dev/xvda",
          "Ebs": {
            "DeleteOnTermination": true,
            "VolumeType": "gp3",
            "VolumeSize": 24,
            "SnapshotId": "snap-0a7b4ece894d62882"
          }
        },
        {
          "DeviceName": "/dev/xvdcz",
          "Ebs": {
            "DeleteOnTermination": true,
            "VolumeType": "gp3"
          }
        }
      ]
    },
    {
      "ImageId": "ami-0ce03502c5bb5e188",
      "SubnetId": "subnet-AAAAAAAAA, subnet-BBBBBBBBB, subnet-CCCCCCCCC, subnet-DDDDDDDDD",
      "KeyName": "KEYNAME",
      "IamInstanceProfile": {
        "Arn": "arn:aws:iam::XXXXXXXXX:instance-profile/ecsInstanceRole"
      },
      "SecurityGroups": [
        {
          "GroupId": "sg-ZZZZZZZZZ"
        }
      ],
      "BlockDeviceMappings": [
        {
          "DeviceName": "/dev/xvda",
          "Ebs": {
            "DeleteOnTermination": true,
            "VolumeType": "gp3",
            "VolumeSize": 24,
            "SnapshotId": "snap-0a7b4ece894d62882"
          }
        },
        {
          "DeviceName": "/dev/xvdcz",
          "Ebs": {
            "DeleteOnTermination": true,
            "VolumeType": "gp3"
          }
        }
      ]
    }
  ],
  "Type": "maintain"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions