fbpx
POSThttps://api.spotinst.io/aws/ec2/statefulMigrationGroup?accountId={ACCOUNT_ID}

Create a new Stateful Elastigroup – this Elastigroup will have the same configuration and state of the imported instance.

URL Parameters

Parameter Type Description
ACCOUNT_ID * String

Your account id in spotinst

Example: act-12345

Available Body Attributes


Attribute Type Description
statefulMigrationGroup * Object

Holding the Group configuration

statefulMigrationGroup.shouldKeepPrivateIp * Boolean

Setting this value to true will maintain the initial instance private IP. This will also require that the original instance be terminated in the import process incurring maintenance time

statefulMigrationGroup.originalInstanceId * String

The originating Instance ID. This instance will be imported along with its State

statefulMigrationGroup.region * String

Specify the AWS Region the instance is running in and the new Elastigroup will be created in.

statefulMigrationGroup.name * String

Specify the new Elastigroup name

statefulMigrationGroup.product String

Operation system type. Possible values: Linux/UNIX | SUSE | Linux Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)

statefulMigrationGroup.spotInstanceTypes Array<String>

An Array holding the types of instances to be used in the Elastigroup

Example: [“m3.large”,“m4.large”]
Request

Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "statefulMigrationGroup": {
    "shouldKeepPrivateIp": true,
    "originalInstanceId": "i-123c53d9f152a1234",
    "name": "MyNewElastigroup",
    "product": "Linux/UNIX (Amazon VPC)",
    "spotInstanceTypes": [
      "m3.large",
      "m4.large"
    ],
    "region": "us-west-2"
  }
}

Available Response Parameters

Parameter Type Description
id String

The Stateful Import process id

state String

The stateful Import process status

Response - 200

Headers
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "request": {
    "id": "d1b6003c-b02b-4088-b146-e7fb73bd6ad3",
    "url": "/aws/ec2/statefulMigrationGroup?spotinstAccountId=act-57761234",
    "method": "POST",
    "timestamp": "2018-01-23T11:38:34.101Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:aws:ec2:statefulMigrationGroup",
    "items": [
      {
        "id": "smg-7f041234",
        "groupId": "sig-1ed12345",
        "data": {
          "shouldTerminateInstance": true,
          "originalInstanceId": "i-0a9c53d9f15212345",
          "shouldKeepPrivateIp": true
        },
        "state": "MIGRATE_START"
      }
    ],
    "count": 1
  }
}