import_image
¶
import_image(
*,
config_overrides: Optional[EC2ClientConfig] = None,
architecture: Optional[String] = None,
client_data: Optional[ClientData] = None,
client_token: Optional[String] = None,
description: Optional[String] = None,
disk_containers: Optional[ImageDiskContainerList] = None,
dry_run: Optional[Boolean] = None,
encrypted: Optional[Boolean] = None,
hypervisor: Optional[String] = None,
kms_key_id: Optional[KmsKeyId] = None,
license_type: Optional[String] = None,
platform: Optional[String] = None,
role_name: Optional[String] = None,
license_specifications: Optional[ImportImageLicenseSpecificationListRequest] = None,
tag_specifications: Optional[TagSpecificationList] = None,
usage_operation: Optional[String] = None,
boot_mode: Optional[BootModeValues] = None,
) -> ImportImageResult
To import your virtual machines (VMs) with a console-based experience, you can use the Import virtual machine images to Amazon Web Services template in the Migration Hub Orchestrator console. For more information, see the Migration Hub Orchestrator User Guide .
Import single or multi-volume disk images or EBS snapshots into an Amazon Machine Image (AMI).
Amazon Web Services VM Import/Export strongly recommends specifying a value for either the --license-type or --usage-operation parameter when you create a new VM Import task. This ensures your operating system is licensed appropriately and your billing is optimized.
For more information, see Importing a VM as an image using VM Import/Export in the VM Import/Export User Guide.
Parameters:
-
architecture(Optional[String], default:None) –The architecture of the virtual machine.
Valid values:
i386|x86_64 -
client_data(Optional[ClientData], default:None) –The client-specific data.
-
client_token(Optional[String], default:None) –The token to enable idempotency for VM import requests.
-
description(Optional[String], default:None) –A description string for the import image task.
-
disk_containers(Optional[ImageDiskContainerList], default:None) –Information about the disk containers.
-
dry_run(Optional[Boolean], default:None) –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 isUnauthorizedOperation. -
encrypted(Optional[Boolean], default:None) –Specifies whether the destination AMI of the imported image should be encrypted. The default KMS key for EBS is used unless you specify a non-default KMS key using
KmsKeyId. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide. -
hypervisor(Optional[String], default:None) –The target hypervisor platform.
Valid values:
xen -
kms_key_id(Optional[KmsKeyId], default:None) –An identifier for the symmetric KMS key to use when creating the encrypted AMI. This parameter is only required if you want to use a non-default KMS key; if this parameter is not specified, the default KMS key for EBS is used. If a
KmsKeyIdis specified, theEncryptedflag must also be set.The KMS key identifier may be provided in any of the following formats:
-
Key ID
-
Key alias
-
ARN using key ID. The ID ARN contains the
arn:aws:kmsnamespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, thekeynamespace, and then the key ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. -
ARN using key alias. The alias ARN contains the
arn:aws:kmsnamespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, thealiasnamespace, and then the key alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
Amazon Web Services parses
KmsKeyIdasynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. This action will eventually report failure.The specified KMS key must exist in the Region that the AMI is being copied to.
Amazon EBS does not support asymmetric KMS keys.
-
-
license_type(Optional[String], default:None) –The license type to be used for the Amazon Machine Image (AMI) after importing.
Specify
AWSto replace the source-system license with an Amazon Web Services license orBYOLto retain the source-system license. Leaving this parameter undefined is the same as choosingAWSwhen importing a Windows Server operating system, and the same as choosingBYOLwhen importing a Windows client operating system (such as Windows 10) or a Linux operating system.To use
BYOL, you must have existing licenses with rights to use these licenses in a third party cloud, such as Amazon Web Services. For more information, see Prerequisites in the VM Import/Export User Guide. -
platform(Optional[String], default:None) –The operating system of the virtual machine. If you import a VM that is compatible with Unified Extensible Firmware Interface (UEFI) using an EBS snapshot, you must specify a value for the platform.
Valid values:
Windows|Linux -
role_name(Optional[String], default:None) –The name of the role to use when not using the default role, 'vmimport'.
-
license_specifications(Optional[ImportImageLicenseSpecificationListRequest], default:None) –The ARNs of the license configurations.
-
tag_specifications(Optional[TagSpecificationList], default:None) –The tags to apply to the import image task during creation.
-
usage_operation(Optional[String], default:None) –The usage operation value. For more information, see Licensing options in the VM Import/Export User Guide.
-
boot_mode(Optional[BootModeValues], default:None) –The boot mode of the virtual machine.
The
uefi-preferredboot mode isn't supported for importing images. For more information, see Boot modes in the VM Import/Export User Guide.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/ec2.py
48084 48085 48086 48087 48088 48089 48090 48091 48092 48093 48094 48095 48096 48097 48098 48099 48100 48101 48102 48103 48104 48105 48106 48107 48108 48109 48110 48111 48112 48113 48114 48115 48116 48117 48118 48119 48120 48121 48122 48123 48124 48125 48126 48127 48128 48129 48130 48131 48132 48133 48134 48135 48136 48137 48138 48139 48140 48141 48142 48143 48144 48145 48146 48147 48148 48149 48150 48151 48152 48153 48154 48155 48156 48157 48158 48159 48160 48161 48162 48163 48164 48165 48166 48167 48168 48169 48170 48171 48172 48173 48174 48175 48176 48177 48178 48179 48180 48181 48182 48183 48184 48185 48186 48187 48188 48189 48190 48191 48192 48193 48194 48195 48196 48197 48198 48199 48200 48201 48202 48203 48204 48205 48206 48207 | |