Spot Event Plugins - Spot Fleet Configuration

Spot Event Plugin

AWS Permissions Setup

Amazon Machine Images

Spot Fleet Requests

Security Credentials Configuration

Spot Fleet Configuration

Spot Event Configuration Options

Spot Event Configuration Utility

Deadline Connectivity Configuration

VPC Endpoints Configuration

Overview

The Spot Fleet Configuration setting is a JSON dictionary. It represents one or more one-to-one mappings between a Deadline Group and a Spot Fleet Request Configuration.

To create the Spot Fleet Configuration, you will need one or more previously created Spot Fleet Requests.

A Spot Fleet Configuration has the form:

{
    "group_name": <Replace with Spot Fleet Request>,
    "2nd_group_name": <Replace with 2nd Spot Fleet Request>
}

Example Spot Fleet Request Configurations

Here is an example with two Deadline Groups, called: group_name and 2nd_group_name:

{
    "group_name":{
        "IamFleetRole": "arn:aws:iam::357432474442:role/aws-ec2-spot-fleet-tagging-role",
        "AllocationStrategy": "capacityOptimized",
        "TargetCapacity": 0,
        "SpotPrice": "0.105",
        "ValidFrom": "2016-12-13T16:48:12Z",
        "ValidUntil": "2017-12-13T16:48:12Z",
        "TerminateInstancesWithExpiration": true,
        "LaunchSpecifications": [
        {
            "ImageId": "ami-b04s92d0",
            "InstanceType": "c3.large",
            "KeyName": "key_pair",
            "SpotPrice": "0.105",
            "BlockDeviceMappings": [
            {
                "DeviceName": "/dev/xvda",
                "Ebs": {
                    "DeleteOnTermination": true,
                    "VolumeType": "gp2",
                    "VolumeSize": 8,
                    "SnapshotId": "snap-c87f35ec"
                }
            }
            ],
            "NetworkInterfaces": [
            {
                "DeviceIndex": 0,
                "SubnetId": "subnet-3efcba4b",
                "DeleteOnTermination": true,
                "Groups": [
                   "sg-2d623a54"
                ],
                "AssociatePublicIpAddress": true
            }
            ]
        }
        ],
        "Type": "maintain"
    },
    "2nd_group_name":{
        "IamFleetRole": "arn:aws:iam::357466224442:role/aws-ec2-spot-fleet-tagging-role",
        "AllocationStrategy": "capacityOptimized",
        "TargetCapacity": 0,
        "SpotPrice": "0.133",
        "ValidFrom": "2016-12-15T16:47:06Z",
        "ValidUntil": "2017-12-15T16:47:06Z",
        "TerminateInstancesWithExpiration": true,
        "LaunchSpecifications": [
        {
            "ImageId": "ami-d722f0b7",
            "InstanceType": "m3.medium",
            "SpotPrice": "0.067",
            "BlockDeviceMappings": [
            {
                "DeviceName": "/dev/sda1",
                "Ebs": {
                    "DeleteOnTermination": true,
                    "VolumeType": "gp2",
                    "VolumeSize": 8,
                    "SnapshotId": "snap-42713105"
                }
            }
            ],
            "SecurityGroups": [
            {
                "GroupId": "sg-06b82060"
            },
            {
                "GroupId": "sg-5058c026"
            }
            ],
            "SubnetId": "subnet-2040e466"
        },
        {
            "ImageId": "ami-d722f0b7",
            "InstanceType": "m4.large",
            "SpotPrice": "0.12",
            "BlockDeviceMappings": [
            {
                "DeviceName": "/dev/sda1",
                "Ebs": {
                    "DeleteOnTermination": true,
                    "VolumeType": "gp2",
                    "VolumeSize": 8,
                    "SnapshotId": "snap-47113105"
                }
            }
            ],
            "SecurityGroups": [
            {
                "GroupId": "sg-06b44060"
            },
            {
                "GroupId": "sg-5238c036"
            }
            ],
            "SubnetId": "subnet-1010e466"
        },
        {
            "ImageId": "ami-d722b0b7",
            "InstanceType": "m3.large",
            "SpotPrice": "0.133",
            "BlockDeviceMappings": [
            {
                "DeviceName": "/dev/sda1",
                "Ebs": {
                    "DeleteOnTermination": true,
                    "VolumeType": "gp2",
                    "VolumeSize": 8,
                    "SnapshotId": "snap-47743105"
                }
            }
            ],
            "SecurityGroups": [
            {
                "GroupId": "sg-06b84063"
            },
            {
                "GroupId": "sg-5058c016"
            }
            ],
            "SubnetId": "subnet-1042e466"
        }
        ],
    "Type": "maintain"
    }
}

Wildcards In Group Names

The Spot Fleet Configuration allows for the use of Wildcards as part of the Group name.

This lets you associate multiple similarly named Groups with a single Spot Fleet Request.

For example, to use the same configuration for any Group starting with “spot_”, you can set up a configuration like the one below:

{
        "spot_*":{
                "IamFleetRole": "arn:aws:iam::357432474442:role/aws-ec2-spot-fleet-tagging-role",
                "AllocationStrategy": "capacityOptimized",
                "TargetCapacity": 0,
                "SpotPrice": "0.105",
                "ValidFrom": "2016-12-13T16:48:12Z",
                "ValidUntil": "2017-12-13T16:48:12Z",
                "TerminateInstancesWithExpiration": true,
                "LaunchSpecifications": [
                {
                        "ImageId": "ami-b04s92d0",
                        "InstanceType": "c3.large",
                        "KeyName": "key_pair",
                        "SpotPrice": "0.105",
                        "BlockDeviceMappings": [
                        {
                                "DeviceName": "/dev/xvda",
                                "Ebs": {
                                        "DeleteOnTermination": true,
                                        "VolumeType": "gp2",
                                        "VolumeSize": 8,
                                        "SnapshotId": "snap-c87f35ec"
                                }
                        }
                        ],
                        "NetworkInterfaces": [
                        {
                                "DeviceIndex": 0,
                                "SubnetId": "subnet-3efcba4b",
                                "DeleteOnTermination": true,
                                "Groups": [
                                   "sg-2d623a54"
                                ],
                                "AssociatePublicIpAddress": true
                        }
                        ]
                }
                ],
                "Type": "maintain"
        }
}

Warning

When using Wildcards in Group names, consider the following caveats:

  • If a Deadline Group matches two Wildcard Groups, an error will be thrown. No Spot Fleets will be started for that Group.

  • If a Deadline Group is explicitly configured in the Spot Event Plugin configuration, but also matches a Wildcard Group, the explicit Spot Fleet Request Configuration will be used.

Spot Fleet Request Group Pools

If you would like the Spot Event Plugin to add the Workers to Deadline’s Pools, you can add a configuration to the Spot Fleet Request Group Pools text field of the configuration dialog in the form:

{
    "group_name":["pool1","pool2"],
    "2nd_group_name":["pool3"]
}