import_volume

EC2.Client.import_volume(**kwargs)

Creates an import volume task using metadata from the specified disk image.

This API action supports only single-volume VMs. To import multi-volume VMs, use ImportImage instead. To import a disk to a snapshot, use ImportSnapshot instead.

This API action is not supported by the Command Line Interface (CLI). For information about using the Amazon EC2 CLI, which is deprecated, see Importing Disks to Amazon EBS in the Amazon EC2 CLI Reference PDF file.

For information about the import manifest referenced by this API action, see VM Import Manifest.

See also: AWS API Documentation

Request Syntax

response = client.import_volume(
    AvailabilityZone='string',
    Description='string',
    DryRun=True|False,
    Image={
        'Bytes': 123,
        'Format': 'VMDK'|'RAW'|'VHD',
        'ImportManifestUrl': 'string'
    },
    Volume={
        'Size': 123
    }
)
Parameters
  • AvailabilityZone (string) --

    [REQUIRED]

    The Availability Zone for the resulting EBS volume.

  • Description (string) -- A description of the volume.
  • DryRun (boolean) -- Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .
  • Image (dict) --

    [REQUIRED]

    The disk image.

    • Bytes (integer) -- [REQUIRED]

      The size of the disk image, in GiB.

    • Format (string) -- [REQUIRED]

      The disk image format.

    • ImportManifestUrl (string) -- [REQUIRED]

      A presigned URL for the import manifest 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 "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .

      For information about the import manifest referenced by this API action, see VM Import Manifest.

  • Volume (dict) --

    [REQUIRED]

    The volume size.

    • Size (integer) -- [REQUIRED]

      The size of the volume, in GiB.

Return type

dict

Returns

Response Syntax

{
    'ConversionTask': {
        'ConversionTaskId': 'string',
        'ExpirationTime': 'string',
        'ImportInstance': {
            'Description': 'string',
            'InstanceId': 'string',
            'Platform': 'Windows',
            'Volumes': [
                {
                    'AvailabilityZone': 'string',
                    'BytesConverted': 123,
                    'Description': 'string',
                    'Image': {
                        'Checksum': 'string',
                        'Format': 'VMDK'|'RAW'|'VHD',
                        'ImportManifestUrl': 'string',
                        'Size': 123
                    },
                    'Status': 'string',
                    'StatusMessage': 'string',
                    'Volume': {
                        'Id': 'string',
                        'Size': 123
                    }
                },
            ]
        },
        'ImportVolume': {
            'AvailabilityZone': 'string',
            'BytesConverted': 123,
            'Description': 'string',
            'Image': {
                'Checksum': 'string',
                'Format': 'VMDK'|'RAW'|'VHD',
                'ImportManifestUrl': 'string',
                'Size': 123
            },
            'Volume': {
                'Id': 'string',
                'Size': 123
            }
        },
        'State': 'active'|'cancelling'|'cancelled'|'completed',
        'StatusMessage': 'string',
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • ConversionTask (dict) --

      Information about the conversion task.

      • ConversionTaskId (string) --

        The ID of the conversion task.

      • ExpirationTime (string) --

        The time when the task expires. If the upload isn't complete before the expiration time, we automatically cancel the task.

      • ImportInstance (dict) --

        If the task is for importing an instance, this contains information about the import instance task.

        • Description (string) --

          A description of the task.

        • InstanceId (string) --

          The ID of the instance.

        • Platform (string) --

          The instance operating system.

        • Volumes (list) --

          The volumes.

          • (dict) --

            Describes an import volume task.

            • AvailabilityZone (string) --

              The Availability Zone where the resulting instance will reside.

            • BytesConverted (integer) --

              The number of bytes converted so far.

            • Description (string) --

              A description of the task.

            • Image (dict) --

              The image.

              • Checksum (string) --

                The checksum computed for the disk image.

              • Format (string) --

                The disk image format.

              • ImportManifestUrl (string) --

                A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .

                For information about the import manifest referenced by this API action, see VM Import Manifest.

              • Size (integer) --

                The size of the disk image, in GiB.

            • Status (string) --

              The status of the import of this particular disk image.

            • StatusMessage (string) --

              The status information or errors related to the disk image.

            • Volume (dict) --

              The volume.

              • Id (string) --

                The volume identifier.

              • Size (integer) --

                The size of the volume, in GiB.

      • ImportVolume (dict) --

        If the task is for importing a volume, this contains information about the import volume task.

        • AvailabilityZone (string) --

          The Availability Zone where the resulting volume will reside.

        • BytesConverted (integer) --

          The number of bytes converted so far.

        • Description (string) --

          The description you provided when starting the import volume task.

        • Image (dict) --

          The image.

          • Checksum (string) --

            The checksum computed for the disk image.

          • Format (string) --

            The disk image format.

          • ImportManifestUrl (string) --

            A presigned URL for the import manifest stored in Amazon S3. For information about creating a presigned URL for an Amazon S3 object, read the "Query String Request Authentication Alternative" section of the Authenticating REST Requests topic in the Amazon Simple Storage Service Developer Guide .

            For information about the import manifest referenced by this API action, see VM Import Manifest.

          • Size (integer) --

            The size of the disk image, in GiB.

        • Volume (dict) --

          The volume.

          • Id (string) --

            The volume identifier.

          • Size (integer) --

            The size of the volume, in GiB.

      • State (string) --

        The state of the conversion task.

      • StatusMessage (string) --

        The status message related to the conversion task.

      • Tags (list) --

        Any tags assigned to the task.

        • (dict) --

          Describes a tag.

          • Key (string) --

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .

          • Value (string) --

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.