AWS SDK Version 2 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

.NET Framework 4.5
 
Helper class to import a virtual machine image or disk image to Amazon EC2 using Amazon S3 to hold the in-flight artifacts.

Inheritance Hierarchy

System.Object
  Amazon.EC2.Import.DiskImageImporter

Namespace: Amazon.EC2.Import
Assembly: AWSSDK.dll
Version: (assembly version)

Syntax

C#
public class DiskImageImporter : Object

The DiskImageImporter type exposes the following members

Constructors

NameDescription
Public Method DiskImageImporter(RegionEndpoint, string) Constructs an image importer to upload and convert virtual machine image or disk volumes for use with Amazon EC2. AWS credentials will be obtained from the application configuration settings.
Public Method DiskImageImporter(IAmazonS3, IAmazonEC2, string) Constructs an image importer to upload and convert virtual machine image or disk volumes for use with Amazon EC2. The importer will use the supplied clients for communicating with Amazon S3 and Amazon EC2. Note that the clients should be configured to use the same region and AWS account.
Public Method DiskImageImporter(AWSCredentials, RegionEndpoint, string) Constructs an image importer to upload and convert virtual machine image or disk volumes for use with Amazon EC2.

Properties

NameTypeDescription
Public Property ArtifactsKeyPrefix System.String S3 object key beneath which all artifacts will be uploaded in the bucket; by convention this is a GUID preceeded by any custom prefix the user has specified.
Public Property BucketName System.String The name of the bucket that will hold the artifacts. An attempt will be made to create the bucket if it does not already exist.
Public Property EC2Client Amazon.EC2.IAmazonEC2 Client for EC2 operations, created using the credentials and region scoping we are handed on construction, or assigned from an existing EC2 client instance.
Public Property ImageFilePath System.String The absolute path to the image file being imported.
Public Property ImportManifest Amazon.EC2.Import.ImportManifestRoot The constructed manifest describing the import artifacts.
Public Property ManifestFileKey System.String The Amazon S3 object key to the uploaded manifest file.
Public Property Region Amazon.RegionEndpoint The region in which the import will take place.
Public Property RollbackOnUploadError System.Boolean

Controls Amazon S3 clean-up of image file and import manifest artifacts if an error occurs during upload.

By default, if an error occurs when uploading the image file to S3 the importer will exit and leave what has been uploaded still present in S3. This enables a 'resume mode' where the importer can be run again to continue upload of the remaining parts based on inspection of the bucket vs the manifest. Note that this does leave the potential for storage costs if the user decides to abandon the import (the PowerShell cmdlets that use this importer emit error messages detailing the resume/cleanup instructions).

If this option is set, the importer instead automatically cleans the bucket of all uploaded content on error.

Public Property S3Client Amazon.S3.IAmazonS3 Client for S3 operations, created using the credentials and region scoping we are handed on construction, or assigned from an existing S3 client instance.
Public Property UploadThreads System.Int32

The number of threads to use to upload the image file parts to Amazon S3. Each thread will consume a 10MB buffer to process the part data.

Default: 10. Max: 30.

Public Property UrlExpirationInDays System.Int32 The maximum age, in days, before the Amazon S3 presigned urls generated in the import manifest expire. The default value is 30. Note that for AWS regions that require Signature Version 4 request signing, the maximum value will not exceed 7 days.

Methods

NameDescription
Public Method Static Method FromManifest(AWSCredentials, RegionEndpoint, string, string, bool) Constructs an importer instance for a previously uploaded manifest. The manifest is downloaded using a new Amazon S3 client constructed for the specified region and deserialized, ready for use in constructing the appropriate ImportInstance or ImportVolume request to Amazon EC2.
Public Method ImportInstance(string, string, Nullable<Int64>, string, ImportLaunchConfiguration, ImportProgressCallback) Uploads and requests import conversion of a virtual machine image file to an Amazon EC2 instance.
Public Method ImportVolume(string, string, Nullable<Int64>, string, string, string, ImportProgressCallback) Uploads and requests import conversion of a virtual disk file to an Amazon EBS volume.
Public Method PopulateDiskImage(string, string) Helper to populate a DiskImage instance from the SDK that will be used in an ImportInstance API request using data previously recorded in the import manifest.
Public Method PopulateDiskImageDetail(string) Helper to populate a DiskImageDetail instance from the SDK that will be used in an ImportVolume API request using data previously recorded in the import manifest.
Public Method Static Method PopulateLaunchSpecificationInstance(ImportLaunchConfiguration) Helper to populate an SDK ImportInstanceLaunchSpecification instance that will be used in an ImportInstance API request.
Public Method PopulateVolumeDetail() Helper to populate a VolumeDetail instance from the SDK that will be used in an ImportInstance or ImportVolume API request using data previously recorded in the import manifest.
Public Method StartInstanceConversion(ImportLaunchConfiguration) Initiates a conversion task to yield a new Amazon EC2 instance for a set of image file artifacts uploaded previously to Amazon S3.
Public Method StartVolumeConversion(string, string) Initiates a conversion task to yield a new EBS volume for a set of image file artifacts uploaded previously to Amazon S3.
Public Method Upload(string)

Constructs the import manifest for the image and then uploads it and the virtual machine image or disk image to Amazon S3. The S3 key to the uploaded manifest file is returned.

If an error occurs during upload of the image file the RetainArtifactsOnUploadError property governs whether the partially uploaded content is deleted or retained. If the content is retained, the import can be resumed. By default the RetainArtifactsOnUploadError property is false and the content deleted, avoiding storage charges for potentially orphaned content if the command is not re-run.

Public Method Upload(string, string, Nullable<Int64>, string, ImportProgressCallback, bool)

Constructs the import manifest for the image and then uploads it and the virtual machine image or disk image to Amazon S3. The S3 key to the uploaded manifest file is returned.

If an error occurs during upload of the image file the RetainArtifactsOnUploadError property governs whether the partially uploaded content is deleted or retained. If the content is retained, the import can be resumed. By default the RetainArtifactsOnUploadError property is false and the content deleted, avoiding storage charges for potentially orphaned content if the command is not re-run.

Fields

NameTypeDescription
Field Static Field DefaultUploadThreads System.Int32 The default number of threads that will be used to upload the parts comprising the image file. Each thread will consume a 10MB buffer to process the part data.
Field Static Field DefaultUrlExpirationInDays System.Int32 The default validity period for the signed Amazon S3 URLs that allow Amazon EC2 to access the manifest.
Field Static Field MaxUploadThreads System.Int32 The maximum number of threads that can be used to upload the image file parts.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5