import_image
async
¶
import_image(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = 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/async_ec2.py
48746 48747 48748 48749 48750 48751 48752 48753 48754 48755 48756 48757 48758 48759 48760 48761 48762 48763 48764 48765 48766 48767 48768 48769 48770 48771 48772 48773 48774 48775 48776 48777 48778 48779 48780 48781 48782 48783 48784 48785 48786 48787 48788 48789 48790 48791 48792 48793 48794 48795 48796 48797 48798 48799 48800 48801 48802 48803 48804 48805 48806 48807 48808 48809 48810 48811 48812 48813 48814 48815 48816 48817 48818 48819 48820 48821 48822 48823 48824 48825 48826 48827 48828 48829 48830 48831 48832 48833 48834 48835 48836 48837 48838 48839 48840 48841 48842 48843 48844 48845 48846 48847 48848 48849 48850 48851 48852 48853 48854 48855 48856 48857 48858 48859 48860 48861 48862 48863 48864 48865 48866 48867 48868 48869 48870 48871 48872 | |