Amazon Elastic Compute Cloud
API Reference (API Version 2013-02-01)
« 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 a new import instance task using metadata from the specified disk image. After importing the image, you then upload it using the ec2-upload-disk-image command in the EC2 command line tools. For more information, see Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 in the Amazon Elastic Compute Cloud User Guide.

Request Parameters

Description

A description of the instance being imported.

Type: String

Default: None

Required: No

LaunchSpecification.Architecture

The architecture of the instance.

Type: String

Default: None

Valid values: i386 | x86_64

Required: Yes

LaunchSpecification.GroupName.n

One or more security group names.

Type: String

Default: None

Required: No

LaunchSpecification.UserData

User data to be made available to the instance.

Type: String

Default: None

Required: No

LaunchSpecification.InstanceType

The instance type. See Available Instance Types for more information.

Type: String

Default: None

Required: Yes

LaunchSpecification.Placement.AvailabilityZone

The Availability Zone to launch the instance into.

Type: String

Default: We choose a zone for you

Required: No

LaunchSpecification.Monitoring.Enabled

Specifies 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

Specifies whether the instance stops or terminates on instance-initiated shutdown.

Type: String

Valid values: stop | terminate

Default: stop

Required: No

LaunchSpecification.PrivateIpAddress

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

Type: String

Default: We 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

Default: None

Valid values: VMDK | RAW | VHD

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 of the disk image.

Type: String

Default: None

Required: No

DiskImage.n.Volume.Size

The size, in GB (2^30 bytes), of the Amazon EBS volume that will hold the converted image.

Required: Yes

Platform

The instance operating system.

Type: String

Default: None

Valid value: Windows

Required: No

Response Elements

The following elements are returned in an ImportInstanceResponse element.

conversionTask

Information about the import instance task.

Type: ConversionTaskType

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/2013-02-01/">
  <conversionTask>
    <conversionTaskId>import-i-ffvko9js</conversionTaskId>
    <expirationTime>2010-12-22T12:01Z</expirationTime>
    <importInstance>
       <volumes>
          <item>
             <bytesConverted>0</bytesConverted>
             <availabilityZone>&region_iad;&az1;</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>