3

是否可以更改 DCOS 模板以使用 Spot 实例?我环顾四周,似乎没有太多关于此的信息。

4

1 回答 1

5

Okay, given the DCOS template, the LaunchConfiguration for the slaves looks like this: (I've shortened it somewhat)

"MasterLaunchConfig": {
  "Type": "AWS::AutoScaling::LaunchConfiguration",
  "Properties": {
    "IamInstanceProfile": { "Ref": "MasterInstanceProfile" },
    "SecurityGroups": [ ... ],
    "ImageId": { ... },
    "InstanceType": { ... },
    "KeyName": { "Ref": "KeyName" },
    "UserData": { ... }
  }
}

To get started, all you need to do is add the SpotPrice property in there. The value of SpotPrice is, obviously, the maximum price you want to pay. You'll probably need to do more work around autoscaling, especially with alarms and time of day. So here's your new LaunchConfiguration with a spot price of $1.00 per hour:

"MasterLaunchConfig": {
  "Type": "AWS::AutoScaling::LaunchConfiguration",
  "Properties": {
    "IamInstanceProfile": { "Ref": "MasterInstanceProfile" },
    "SecurityGroups": [ ... ],
    "ImageId": { ... },
    "InstanceType": { ... },
    "KeyName": { "Ref": "KeyName" },
    "UserData": { ... },
    "SpotPrice": 1.00
  }
}
于 2015-07-16T17:12:44.930 回答