Mengekspor custom image ke bucket Object Storage Service (OSS) di region yang sama dengan custom image.
Deskripsi operasi
Sebelum Anda mengekspor image:
-
Pastikan Anda memahami prasyarat dan pertimbangannya. Untuk informasi lebih lanjut, lihat Mengekspor custom image.
-
Parameter
ImageFormat, yang menentukan format image yang diekspor, hanya tersedia di beberapa region, termasuk Jepang (Tokyo), Indonesia (Jakarta), Jerman (Frankfurt), UEA (Dubai), AS (Virginia), Inggris (London), Singapura, Malaysia (Kuala Lumpur), dan AS (Silicon Valley). Di region yang tidak mendukung pengaturan format image, image diekspor dalam format RAW secara default. -
Anda harus menggunakan RAM untuk memberikan izin kepada Elastic Compute Service (ECS) untuk menulis data ke OSS. Prosedur:
Buat role bernama
AliyunECSImageExportDefaultRole(nama role lain tidak valid) dan lampirkan kebijakan role berikut ke role tersebut:{ "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": [ "ecs.aliyuncs.com" ] } } ], "Version": "1" }Lampirkan kebijakan sistem default
AliyunECSImageExportRolePolicyke roleAliyunECSImageExportDefaultRole. Kebijakan ini adalah kebijakan default yang disediakan oleh ECS untuk mengekspor image. Untuk informasi lebih lanjut, lihat Otorisasi Akses Resource Cloud. Anda juga dapat membuat kebijakan kustom yang berisi izin berikut:{ "Version": "1", "Statement": [ { "Action": [ "oss:GetObject", "oss:PutObject", "oss:DeleteObject", "oss:GetBucketLocation", "oss:GetBucketInfo", "oss:AbortMultipartUpload", "oss:ListMultipartUploads", "oss:ListParts" ], "Resource": "*", "Effect": "Allow" } ] }
Setelah Anda mengekspor image:
Custom image disimpan di bucket OSS yang ditentukan dan dapat diunduh. Untuk informasi lebih lanjut, lihat Mengunduh berkas custom image.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ExportImage |
update |
*Image
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID region dari custom image. Anda dapat memanggil operasi DescribeRegions untuk mengkueri daftar region Alibaba Cloud terbaru. |
cn-hangzhou |
| ImageId |
string |
Yes |
ID dari custom image. |
m-bp67acfmxazb4p**** |
| OSSBucket |
string |
Yes |
Bucket OSS untuk menyimpan image yang diekspor. |
testexportImage |
| OSSPrefix |
string |
No |
Prefiks dari OSS object Anda. Prefiks dapat berisi angka dan huruf serta harus memiliki panjang 1 hingga 30 karakter. |
EcsExport |
| ImageFormat |
string |
No |
Format dari image yang diekspor. Nilai yang valid:
Nilai default: raw. |
raw |
| RoleName |
string |
No |
Nama role Resource Access Management (RAM) yang digunakan untuk mengekspor image. |
AliyunECSImageExportDefaultRole |
| DryRun |
boolean |
No |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. |
C8B26B44-0189-443E-9816-D951F596**** |
| TaskId |
string |
ID dari task ekspor image. |
tsk-bp67acfmxazb4p**** |
| RegionId |
string |
ID region. |
cn-hangzhou |
Contoh
Respons sukses
JSONformat
{
"RequestId": "C8B26B44-0189-443E-9816-D951F596****",
"TaskId": "tsk-bp67acfmxazb4p****",
"RegionId": "cn-hangzhou"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | MissingParameter | An input parameter "RegionId" that is mandatory for processing the request is not supplied. | |
| 400 | InvalidImageName.Malformed | The specified Image name is wrongly formed. | |
| 400 | InvalidOSSPrefix.Malformed | The specified OSSPrefix format is wrongly formed. | |
| 400 | InvalidRegionId.NotFound | The specified RegionId does not exist. | |
| 400 | InvalidRegion.NotSupport | The specified region does not support image import or export. | |
| 400 | IncorrectImageStatus | The specified Image is not available. | |
| 400 | InvalidImageFormat.Malformed | The specified Image Format is wrongly formed. | |
| 400 | InvalidOSSBucket.NotFound | The specified OSS bucket does not exist in this region. | |
| 400 | OperationDenied | The specified image contains the snapshot of the data disk,does not support this operation. | |
| 400 | InvalidImage.DiskAmountOrSize | %s | |
| 400 | ImageNotSupported | The specified Image contains encrypted snapshots, do not support export. | |
| 400 | InvalidOSSObject.NeedRestore | The specified OSS object is a archive object, need restore first. | |
| 400 | InvalidOSSBucket.NotMatched | The specified OSS bucket is incorrect, %s. | |
| 400 | InvalidImageFormat.RegionNotSupported | The specified image format is not supported in current region. | |
| 400 | InvalidOSSBucket.ArchiveOssBucketNotSupported | Exporting an image to an OSS bucket with Archive, Cold Archive, or Deep Cold Archive storage class is not supported. | |
| 403 | ImageNotSupported | The specified image from the image market, do not support export image. | |
| 403 | ImageIsExporting | The specified Image is being exported. You can use the DescribeTasks API to check the status of existing tasks. | |
| 403 | ExportImageFailed | Exporting image is failed, Please contact the administrator. | |
| 403 | UserNotInTheWhiteList | The user is not in the white list of exporting image. | |
| 403 | NoSetRoletoECSServiceAcount | ECS service account Have no right to access your OSS.please attach a role of access your oss to ECS service account. | |
| 403 | InvalidOSS.NotAuthorized | The specified OSS bucket or object is not allowed to access. | |
| 403 | ConcurrentQuotaExceed.ExportImage | %s | |
| 403 | WeeklyQuotaExceed.ExportImage | %s | |
| 403 | InvalidImageLicense.NotSupported | %s | |
| 403 | InvalidImageCategory.NotSupported | The specified image category is not supported. | |
| 403 | InvalidOSSBucket.EncryptUnsupported | Accessing objects from encrypted OSS bucket is not supported. | |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.