Menyalin gambar kustom dari satu wilayah ke wilayah lain. Menyalin gambar memungkinkan Anda mendeploy Instance ECS di berbagai wilayah, mereplikasi Instance ECS di berbagai wilayah, dan sebagainya.
Deskripsi operasi
Catatan penggunaan
Anda dapat menggunakan gambar yang disalin untuk membuat Instance ECS (RunInstances) di wilayah lain, atau untuk mengganti disk sistem Instans (ReplaceSystemDisk).
Saat memanggil operasi ini, perhatikan hal-hal berikut:
Status gambar kustom harus Available (
Available).Jika gambar adalah gambar kustom di bawah akun Anda, Anda dapat menyalin gambar ke berbagai wilayah. Jika gambar dibagikan kepada Anda oleh pengguna lain, Anda hanya dapat menyalin gambar di dalam wilayah yang sama.
Selama penyalinan gambar, Anda tidak dapat langsung menghapus gambar yang sedang disalin dengan memanggil DeleteImage. Namun, Anda dapat menghapus gambar yang sedang disalin dengan membatalkan tugas penyalinan (dengan memanggil CancelCopyImage).
Hanya lima tugas penyalinan gambar yang dapat berjalan secara bersamaan di wilayah yang sama. Tugas lain harus menunggu dalam antrian hingga salah satu tugas yang berjalan selesai sebelum dieksekusi secara berurutan.
Anda dapat menggunakan parameter
ResourceGroupIduntuk menentukan kelompok sumber daya tempat gambar yang disalin berada. Jika Anda tidak mengatur parameterResourceGroupId, gambar yang disalin akan termasuk dalam kelompok sumber daya default.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:CopyImage |
update |
*Image
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| DestinationImageName |
string |
No |
Nama gambar yang disalin. Panjang nama harus 2 hingga 128 karakter. Harus diawali dengan huruf (tidak peka huruf besar/kecil) atau karakter Tionghoa, dan tidak boleh diawali dengan |
YourImageName |
| DestinationDescription |
string |
No |
Deskripsi gambar yang disalin. Panjang deskripsi harus 2 hingga 256 karakter dan tidak boleh diawali dengan |
This is a description example. |
| ImageId |
string |
Yes |
ID gambar kustom sumber. |
m-bp1h46wfpjsjastc**** |
| RegionId |
string |
Yes |
ID wilayah gambar kustom sumber. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah Alibaba Cloud terbaru. |
cn-hangzhou |
| DestinationRegionId |
string |
No |
ID wilayah tujuan tempat gambar disalin. |
cn-shanghai |
| Encrypted |
boolean |
No |
Apakah akan mengenkripsi gambar yang disalin.
Nilai default: tidak ditentukan. |
false |
| KMSKeyId |
string |
No |
ID kunci yang digunakan untuk mengenkripsi gambar. |
e522b26d-abf6-4e0d-b5da-04b7******3c |
| EncryptAlgorithm |
string |
No |
Catatan
Parameter ini belum tersedia untuk digunakan. |
hide |
| ResourceGroupId |
string |
No |
ID kelompok sumber daya tempat gambar yang disalin berada. Jika Anda tidak mengatur parameter ini, gambar yang disalin akan termasuk dalam kelompok sumber daya default. Catatan
Jika Anda menggunakan Pengguna RAM untuk memanggil operasi ini dan membiarkan |
rg-bp67acfmxazb4p**** |
| Tag |
array<object> |
No |
Daftar tag. |
|
|
object |
No |
Daftar tag. |
||
| Value |
string |
No |
Nilai tag gambar yang disalin. Nilai valid N: 1 hingga 20. Setelah nilai ditentukan, dapat berupa string kosong. Panjang nilai dapat hingga 128 karakter, tidak boleh diawali dengan |
TestValue |
| Key |
string |
No |
Kunci tag gambar yang disalin. Nilai valid N: 1 hingga 20. Setelah nilai ditentukan, tidak boleh berupa string kosong. Panjang kunci dapat hingga 128 karakter, tidak boleh diawali dengan |
TestKey |
| DryRun |
boolean |
No |
Apakah akan menjalankan dry run saja, tanpa menjalankan permintaan aktual. Nilai valid:
Nilai default: false. |
false |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan idempotensi permintaan. Anda dapat menggunakan klien untuk menghasilkan nilai, tetapi Anda harus memastikan bahwa nilai tersebut unik di antara permintaan yang berbeda. ClientToken hanya dapat berisi karakter ASCII dan panjangnya tidak boleh melebihi 64 karakter. Untuk informasi lebih lanjut, lihat Cara memastikan idempotensi. |
123e4567-e89b-12d3-a456-426655440000 |
| Skenario | Status gambar sumber | Parameter Encrypted | Parameter KMSKeyId | Apakah enkripsi EBS tingkat akun telah dikonfigurasi di wilayah tujuan | Hasil gambar tujuan | Deskripsi hasil |
| 1 | Gambar tidak terenkripsi | False atau tidak ditentukan | Tidak ditentukan | Tidak dikonfigurasi | Gambar tidak terenkripsi | Tidak ada enkripsi yang diterapkan. Gambar tetap seperti semula. |
| 2 | Gambar tidak terenkripsi | True | Tidak ditentukan | Apa pun | Gambar terenkripsi penuh | Pengguna secara eksplisit meminta enkripsi. Jika enkripsi EBS tingkat akun dikonfigurasi, kunci default yang dikonfigurasi akan digunakan untuk enkripsi. Jika tidak, kunci layanan akan digunakan untuk enkripsi. |
| 3 | Gambar tidak terenkripsi | True | Ditentukan | Apa pun | Gambar terenkripsi penuh | Pengguna secara eksplisit meminta enkripsi. KMSKeyId yang ditentukan pengguna akan digunakan untuk enkripsi. |
| 4 | Gambar tidak terenkripsi | Tidak ditentukan | Tidak ditentukan | Dikonfigurasi | Gambar terenkripsi penuh | Kunci yang dikonfigurasi untuk enkripsi EBS tingkat akun akan digunakan untuk enkripsi. |
| 5 | Gambar terenkripsi | Tidak ditentukan | Tidak ditentukan | Tidak dikonfigurasi | Gambar terenkripsi | Format asli dipertahankan. Snapshot tidak terenkripsi tetap tidak terenkripsi, dan Snapshot terenkripsi dienkripsi menggunakan kunci layanan. |
| 6 | Gambar terenkripsi | Tidak ditentukan atau True | Tidak ditentukan | Dikonfigurasi | Gambar terenkripsi penuh | Kunci yang dikonfigurasi untuk enkripsi EBS tingkat akun akan digunakan untuk enkripsi. |
| 7 | Gambar terenkripsi | True | Tidak ditentukan | Tidak dikonfigurasi | Gambar terenkripsi penuh | Kunci layanan akan digunakan untuk enkripsi. |
| 8 | Gambar terenkripsi | True | Tidak ditentukan | Dikonfigurasi | Gambar terenkripsi penuh | Kunci yang dikonfigurasi untuk enkripsi EBS tingkat akun akan digunakan untuk enkripsi. |
| 9 | Gambar terenkripsi | True | Ditentukan | Apa pun | Gambar terenkripsi penuh | Pengguna secara eksplisit meminta enkripsi. KMSKeyId yang ditentukan pengguna akan digunakan untuk enkripsi. |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| ImageId |
string |
ID gambar yang disalin. |
m-bp1h46wfpjsjastd**** |
| RequestId |
string |
ID permintaan. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Contoh
Respons sukses
JSONformat
{
"ImageId": "m-bp1h46wfpjsjastd****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Respons error
JSONformat
{
"RequestId": "C8B26B44-0189-443E-9816-D951F59623A9",
"ImageId": "Img-231234567"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidDescription.Malformed | The specified destination description is wrongly formed. | |
| 400 | SourceRegion.NotFound | The source region not found. | |
| 400 | DestinationRegion.NotFound | The destination region not found. | |
| 400 | IncorrectImageStatus | The image not available. | |
| 400 | InvalidSnapshotId.NotFound | The specified SnapshotId does not exist. | |
| 400 | InvalidImageName.Duplicated | The specified image name is already in use in the target region. Please try a different one. | |
| 400 | InvalidParameter.EncryptedIllegal | The specified parameter Encrypted must be true when kmsKeyId is not empty. | |
| 400 | InvalidEncrypted.NotMatchEncryptAlgorithm | The specified parameter Encrypted must be true when EncryptAlgorithm is not empty. | |
| 400 | InvalidEncryptAlgorithm | The specified parameter EncryptAlgorithm is not valid. | |
| 400 | InvalidEncrypted.NotMatchKmsKeyId | The specified parameter Encrypted must be true when KmsKeyId is not empty. | |
| 400 | OperationDenied.CommunityImage | Community image does not support copy. | |
| 400 | InvalidImageName.Malformed | The specified destination image name is wrongly formed. | |
| 400 | InvalidParameter.KmsNotEnabled | The specified operation need enable KMS. | |
| 400 | OperationDenied.ImageCopyConflict | The same image cannot be copied concurrently. Please wait until the last copy is completed before performing the next operation. | |
| 400 | Account.Arrearage | Your account has an outstanding payment. | |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | |
| 401 | InvalidAliUid.IsNull | The aliUid must not be null. | |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | |
| 403 | Forbbiden | User not authorized to operate on the specified resource. | |
| 403 | InvalidOperation.CopyingDataFromThisRegionUnsupported | Data transfer from the current region to other regions is not supported. | |
| 403 | InvalidOperation.CopyingDataToThisRegionUnsupported | Only Some Regions %s can copy data to this region. | |
| 403 | QuotaExceed.Image | The number of images exceeds the limit (%s). | |
| 403 | QuotaExceed.Snapshot | The snapshot quota exceeds. | |
| 403 | OperationDenied.ImageCopying | The image is currently being copied. Please try again later. | |
| 403 | RegionNotSupportCopy | The region not support copy. | |
| 403 | InvalidSnapshot.TooOld | This operation is denied because the specified snapshot is created before 2013-07-15. | |
| 403 | OperationDenied | The specified snapshot is not allowed to create image. | |
| 403 | IncorrectDestinationRegion | The destination region is not equal the target region. | |
| 403 | OperationDeined.EncryptedSnapshot | The image contains encrypted snapshots, which do not support copying. | |
| 403 | OperationDenied.SameRegionOnly | The image shared from others can not be copied to another region directly. | |
| 403 | OperationDenied.NotPublished | The operation is denied because corresponding marketplace image is not published in destination region. | |
| 403 | OperationDenied.NotAuthorized | The operation is denied because corresponding marketplace image is not authorized to current user. | |
| 403 | OperationDenied.EncryptSnapshotAcrossRegion | The image do not contain encrypted snapshots, which do not support copying to encrypted ones. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service have no right to access your KMS. | |
| 403 | InvalidRegion.NotSupport | The specified region does not support byok. | |
| 403 | UserNotInTheWhiteList | The user is not in byok white list. | |
| 403 | InvalidRegionId.NotSupportEncryptAlgorithm | The current region does not support creating encrypted disks with EncryptAlgorithm. | |
| 403 | OperationDenied.KmsServiceUnauthorized | The account is not authorized to kms service, please authorize it. | |
| 403 | OperationDenied.NonCompliantDestinationRegion | The copy operation to the destination region is not in compliance with regulations. | |
| 403 | InvalidEncrypted.NotMatchDiskDefaultEncryption | The specified parameter Encrypted not match for your account default encryption settings. | |
| 403 | InvalidParameter.DataEncryptedKeyCreateFailed | Create kms data encrypted key fail. If you need further assistance, you can contact the KMS Technical Support. | |
| 403 | SizeExceed.Image | The image exceeds the maximum size. You can use the CopySnapshot API to copy your snapshots of the image and then create a new image from them. | |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK (Customer Master Key) must be in an active state. | |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK(Customer Master Key) lacks authorization to add tags to the ECS service. | |
| 403 | InvalidOperation.VhdImageUnsupported | The specified vhd image is not supported for this operation. Please switch to a raw image and retry. | |
| 403 | InvalidOperation.CloudBoxImageCopyUnsupported | Copying CloudBox images is not supported. | |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | |
| 404 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. | |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | |
| 409 | InvalidOperation.Conflict | Request was denied due to conflict with a previous request, please try again later. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.