Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅
中国的 Amazon Web Services 服务入门
(PDF)。
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
启动导出映像任务
使用 VM Import/Export 导出映像时,将使用以下 S3 密钥将导出的文件写入指定的 S3 存储桶:
prefix
export-ami-xxxxxxxxxxxxxxxxx
.format
例如,如果存储桶名称为amzn-s3-demo-export-bucket
,前缀为exports/
,格式为 VMDK,则导出的图像将被写入。amzn-s3-demo-export-bucket/exports/export-ami-1234567890abcdef0.vmdk
有关所支持格式的信息,请参阅映像导出的注意事项。
- Amazon CLI
-
导出图像
使用 export-image 命令。
aws ec2 export-image \
--description "$(date '+%b %d %H:%M') My image export" \
--image-id ami-1234567890abcdef0
\
--disk-image-format VMDK
\
--s3-export-location S3Bucket=amzn-s3-demo-export-bucket
,S3Prefix=exports/
下面是示例输出。
{
"Description": "Jul 15 16:31 My image export",
"DiskImageFormat": "VMDK",
"ExportImageTaskId": "export-ami-36a041c1000000000",
"ImageId": "ami-1234567890abcdef0",
"Progress": "0",
"S3ExportLocation": {
"S3Bucket": "amzn-s3-demo-export-bucket",
"S3Prefix": "exports/"
},
"Status": "active",
"StatusMessage": "validating"
}
- PowerShell
-
导出图像
使用 Export-EC2Image cmdlet。
Export-EC2Image `
-Description ((Get-Date -Format "MMM dd HH:mm ") + "My image export") `
-ImageId ami-1234567890abcdef0
`
-DiskImageFormat VMDK `
-S3ExportLocation_S3Bucket amzn-s3-demo-export-bucket
`
-S3ExportLocation_S3Prefix exports/
下面是示例输出。
Description : Jul 15 16:35 My image export
DiskImageFormat : VMDK
ExportImageTaskId : export-ami-36a041c1000000000
ImageId : ami-1234567890abcdef0
Progress : 0
RoleName :
S3ExportLocation : Amazon.EC2.Model.ExportTaskS3Location
Status : active
StatusMessage : validating
Tags : {}