Amazon Elastic Compute Cloud
API Reference (API Version 2014-06-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

ImportInstance

Description

Creates an import instance task using metadata from the specified disk image. After importing the image, you then upload it using the ec2-import-volume command. For more information, see Step 4: Importing Your VM into Amazon EC2 in the Amazon EC2 User Guide for Linux Instances.

Request Parameters

For information about the common parameters that all actions use, see Common Query Parameters.

Description

A description for the instance being imported.

Type: String

Default: None

Required: No

LaunchSpecification.Architecture

The architecture of the instance.

Type: String

Valid values: i386 | x86_64

Default: None

Required: Yes

LaunchSpecification.GroupName.n

One or more security group names. This is not supported for VMs imported into a VPC, which are assigned the default security group. After a VM is imported into a VPC, you can specify another security group using the AWS Management Console.

Type: String

Default: Your default security group.

Required: No

LaunchSpecification.UserData

User data to be made available to the instance.

Type: String

Default: None

Required: No

LaunchSpecification.InstanceType

The instance type. For more information, see Instance Types in the Amazon EC2 User Guide for Linux Instances. For more information about the Linux instance types you can import, see Before You Get Started in the Amazon EC2 User Guide for Linux Instances.

Type: String

Default: None

Required: Yes

LaunchSpecification.Placement.AvailabilityZone

The Availability Zone to launch the instance into.

Type: String

Default: Amazon EC2 chooses a zone for you.

Required: No

LaunchSpecification.Monitoring.Enabled

Indicates whether to enable detailed monitoring for the instance.

Type: Boolean

Default: false

Required: No

LaunchSpecification.SubnetId

[EC2-VPC] The ID of the subnet to launch the instance into.

Type: String

Default: None

Required: No

LaunchSpecification.InstanceInitiatedShutdownBehavior

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Type: String

Valid values: stop | terminate

Default: stop

Required: No

LaunchSpecification.PrivateIpAddress

[EC2-VPC] Optionally, you can use this parameter to assign the instance a specific available IP address from the IP address range of the subnet.

Type: String

Default: Amazon EC2 selects an IP address from the IP address range of subnet for the instance.

Required: No

DiskImage.n.Image.Format

The file format of the disk image.

Type: String

Valid values: VMDK | RAW | VHD

Default: None

Required: Yes

DiskImage.n.Image.Bytes

The number of bytes in the disk image.

Type: Long

Default: None

Required: Yes

DiskImage.n.Image.ImportManifestUrl

The manifest for the disk image, stored in Amazon S3 and presented here as an Amazon S3 presigned URL. For information about creating a presigned URL for an Amazon S3 object, read the "Signing and Authenticating REST Requests" section of the Signing and Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide.

Type: String

Default: None

Required: Yes

DiskImage.n.Image.Description

An optional description for the disk image.

Type: String

Default: None

Required: No

DiskImage.n.Volume.Size

The size, in GiB, of the Amazon EBS volume that will hold the converted image.

Required: Yes

Platform

The instance operating system.

Type: String

Default: None

Valid values: Windows | Linux

Required: No

Response Elements

The following elements are returned in an ImportInstanceResponse element.

conversionTask

Information about the import instance task.

Type: ConversionTaskType

Errors

The following are some of the client API errors you might encounter when using this request. For more information about common API errors, see Common Causes of Client Errors. For a summary of API error codes, see Client Error Codes.

Examples

Example Request

This example creates an import instance task that migrates a Windows Server 2008 SP2 (32-bit) VM into the AWS us-east-1 region.

https://ec2.amazonaws.com/?Action=ImportInstance
&LaunchSpecification.Architecture=x86_64
&LaunchSpecification.InstanceType=m1.xlarge
&DiskImage.1.Image.Format=VMDK
&DiskImage.1.Image.Bytes=1179593728
&DiskImage.1.Image.ImportManifestUrl=https://s3.amazonaws.com/myawsbucket/​a3a5e1b6-590d-43cc-97c1-15c7325d3f41/​Win_2008_Server_Data_Center_SP2_32-bit.​vmdkmanifest.xml?AWSAccessKeyId=​AKIAIOSFODNN7EXAMPLE&​Expires=1294855591&​Signature=5snej01TlTtL0uR7KExtEXAMPLE%3D
&DiskImage.1.Volume.Size=12	
&Platform=Windows
&AUTHPARAMS

Example Response

<ImportInstanceResponse xmlns="http://ec2.amazonaws.com/doc/2014-06-15/">
  <conversionTask>
    <conversionTaskId>import-i-ffvko9js</conversionTaskId>
    <expirationTime>2010-12-22T12:01Z</expirationTime>
    <importInstance>
       <volumes>
          <item>
             <bytesConverted>0</bytesConverted>
             <availabilityZone>us-east-1a</availabilityZone>
             <image>
                <format>VMDK</format>
                <size>1179593728</size>
                <importManifestUrl>
                 https://s3.amazonaws.com/myawsbucket/​a3a5e1b6-590d-43cc-97c1-15c7325d3f41/​Win_2008_Server_Data_Center_SP2_32-bit.​vmdkmanifest.xml?AWSAccessKeyId=​AKIAIOSFODNN7EXAMPLE&​Expires=1294855591&​Signature=5snej01TlTtL0uR7KExtEXAMPLE%3D
                </importManifestUrl>
             </image>
             <description/>
             <volume>
                <size>12</size>
                <id>vol-1a2b3c4d</id>
             </volume>
             <status>active</status>
             <statusMessage/>
          </item>
       </volumes>
       <instanceId>i-12655a7f</instanceId>
       <description/>
    </importInstance>
  </conversionTask>
</ImportInstanceResponse>