POSThttps://api.spotinst.io/aws/ec2/managedInstance/migration?accountId={ACCOUNT_ID}

Import an instance from AWS into Managed Instance, while keeping the instance data and its persistence settings.

This call is starting the migration and returns migration ID.

In order to get migration status use the Get Migration Status call.

URL Parameters

Parameter Type Description
ACCOUNT_ID String

Your Spotinst accountId associated with your token

Example: act-123abc
Request

Headers
Copied!
Downloaded!
{
    "Content-Type": "application/json",
    "Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "migration": {
    "shouldKeepPrivateIp": false,
    "originalInstanceId": "i-123",
    "region": "us-west-2",
    "shouldTerminateInstance": true,
    "managedInstanceName": "MI-NAME",
    "product": "Linux/UNIX",
    "spotInstanceTypes": [
      "t2.micro",
      "t2.large"
    ],
    "availabilityZones": [
      "us-west-2a",
      "us-west-2b"
    ]
  }
}
Attribute Type Description
migration Object

migration.shouldKeepPrivateIp * Boolean

Set whether the instance should keep its private ip or not

migration.originalInstanceId * String

The instance ID on AWS

migration.region * String

Set instance's region

migration.shouldTerminateInstance Boolean

Set true or false whether to terminate the instance in AWS. Note: If shouldKeepPrivateIp is true, then shouldTerminateInstance must be true. Otherwise an error will be returned.

migration.managedInstanceName String

Set Managed Instance name

migration.product String

Set instance's product

Example: Linux/UNIX
migration.spotInstanceTypes Array<String>

List of possible instance types for the Managed Instance

migration.availabilityZones Array<String>

List of availability zones for the Managed Instance. Should exist only if shouldKeepPrivateIp is false.

Response - 200

Headers
Copied!
Downloaded!
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "request": {
    "id": "18cb4ad1-24f0-4705-8b65-a8386690630c",
    "url": "/aws/ec2/managedInstance/migration?accountId=act-123",
    "method": "POST",
    "timestamp": "2020-01-05T10:08:10.582Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:aws:ec2:managedInstance:migration",
    "items": [
      {
        "migrationId": "smg-123",
        "managedInstanceId": "smi-123",
        "data": {
          "originalInstanceId": "i-123",
          "shouldKeepPrivateIp": false
        },
        "state": "MIGRATE_START"
      }
    ],
    "count": 1
  }
}