Membuat kebijakan snapshot otomatis di wilayah yang ditentukan. Anda dapat menentukan siklus pengulangan, periode retensi, dan pengaturan pencadangan lintas wilayah untuk snapshot otomatis guna mencadangkan data pada disk sistem atau disk data.
Deskripsi operasi
Sebelum memanggil operasi ini, baca Buat kebijakan snapshot otomatis.
Saat memanggil operasi ini, perhatikan hal-hal berikut:
-
Anda dapat membuat hingga 100 kebijakan snapshot otomatis per wilayah untuk satu Akun Alibaba Cloud. Jika jumlah snapshot otomatis untuk suatu disk mencapai kuota maksimum, sistem akan menghapus snapshot otomatis tertua yang dibuat oleh kebijakan tersebut saat tugas snapshot baru dimulai.
-
Sistem tidak menjalankan kebijakan snapshot otomatis ketika Instance ECS memiliki tugas stop atau restart yang tertunda.
-
Jika replikasi snapshot lintas wilayah diaktifkan dan parameter enkripsi tidak dikonfigurasi, snapshot terenkripsi akan dienkripsi menggunakan kunci layanan dari Wilayah tujuan secara default. Untuk informasi selengkapnya tentang replikasi snapshot lintas wilayah, lihat Salin snapshot.
Setelah membuat kebijakan snapshot otomatis, panggil ApplyAutoSnapshotPolicy untuk menerapkannya ke disk target. Untuk mengubah kebijakan snapshot otomatis, panggil ModifyAutoSnapshotPolicyEx.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:CreateAutoSnapshotPolicy |
create |
*AutoSnapshotPolicy.
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| regionId |
string |
Yes |
ID wilayah untuk kebijakan snapshot otomatis. Anda dapat memanggil DescribeRegions untuk mengambil daftar wilayah terbaru. |
cn-hangzhou |
| autoSnapshotPolicyName |
string |
No |
Nama kebijakan snapshot otomatis. Nama harus terdiri dari 2 hingga 128 karakter, dimulai dengan huruf, dan tidak boleh dimulai dengan http:// atau https://. Nama dapat berisi angka, titik dua (:), garis bawah (_), dan tanda hubung (-). Nilai default: null. |
TestName |
| timePoints |
string |
Yes |
Titik waktu pembuatan snapshot otomatis. Waktu ditampilkan dalam UTC+8. Satuan: jam. Nilai valid: 0 hingga 23, yang merepresentasikan pukul 00:00 hingga 23:00 (total 24 titik waktu). Misalnya, 1 berarti pukul 01:00. Deskripsi format:
Catatan
Jika disk berisi data dalam jumlah besar dan waktu yang diperlukan untuk membuat satu snapshot otomatis melebihi interval antara dua titik waktu, maka titik waktu berikutnya akan dilewati. Misalnya, Anda menetapkan pukul 09:00, 10:00, 11:00, dan 12:00 sebagai titik waktu snapshot otomatis. Karena disk berisi data dalam jumlah besar, pembuatan snapshot dimulai pukul 09:00 dan selesai pukul 10:20 (memerlukan 80 menit). Sistem akan melewati titik waktu pukul 10:00 dan membuat snapshot otomatis berikutnya pukul 11:00. |
["0", "1", … "23"] |
| repeatWeekdays |
string |
Yes |
Hari dalam seminggu saat snapshot otomatis dibuat. Satuan: hari. Siklusnya mingguan. Nilai valid: 1 hingga 7. Misalnya, 1 berarti Senin. Deskripsi format:
|
["1","2"] |
| retentionDays |
integer |
Yes |
Periode retensi snapshot otomatis. Satuan: hari. Nilai valid:
Nilai default: -1. |
30 |
| EnableCrossRegionCopy |
boolean |
No |
Menentukan apakah replikasi lintas wilayah otomatis diizinkan.
|
false |
| TargetCopyRegions |
string |
No |
Wilayah tujuan tempat snapshot direplikasi. Anda dapat menentukan satu wilayah tujuan. |
["cn-hangzhou"] |
| StorageLocationArn |
string |
No |
Catatan
Parameter ini tidak tersedia untuk umum. |
null |
| CopiedSnapshotsRetentionDays |
integer |
No |
Periode retensi replika snapshot lintas wilayah. Satuan: hari. Nilai valid:
Nilai default: -1. |
30 |
| CopyEncryptionConfiguration |
object |
No |
Parameter enkripsi backup untuk geo-redundansi snapshot. |
|
| Encrypted |
boolean |
No |
Menentukan apakah enkripsi diaktifkan untuk backup snapshot lintas wilayah. Nilai valid:
Nilai default: false. |
false |
| KMSKeyId |
string |
No |
ID kunci KMS yang digunakan untuk backup snapshot terenkripsi lintas wilayah. |
0e478b7a-4262-4802-b8cb-00d3fb40826X |
| Arn |
array<object> |
No |
Catatan
Parameter ini tidak tersedia untuk umum. |
|
|
object |
No |
|||
| RoleType |
string |
No |
Catatan
Parameter ini tidak tersedia untuk umum. |
hide |
| Rolearn |
string |
No |
Catatan
Parameter ini tidak tersedia untuk umum. |
hide |
| AssumeRoleFor |
integer |
No |
Catatan
Parameter ini tidak tersedia untuk umum. |
1000000000 |
| ResourceGroupId |
string |
No |
ID kelompok sumber daya. |
rg-aek2kkmhmhs**** |
| Tag |
array<object> |
No |
Tag untuk kebijakan snapshot otomatis. |
|
|
object |
No |
|||
| Key |
string |
No |
Kunci tag untuk kebijakan snapshot otomatis. Nilai valid N: 1 hingga 20. Kunci tag tidak boleh berupa string kosong, panjang maksimal 128 karakter, dan tidak boleh dimulai dengan aliyun atau acs:. Kunci tag tidak boleh mengandung http:// atau https://. |
TestKey |
| Value |
string |
No |
Nilai tag untuk kebijakan snapshot otomatis. Nilai valid N: 1 hingga 20. Nilai tag boleh berupa string kosong, panjang maksimal 128 karakter, dan tidak boleh dimulai dengan acs:. Nilai tag tidak boleh mengandung http:// atau https://. |
TestValue |
| AssociationType |
string |
No |
Tipe asosiasi antara kebijakan snapshot otomatis dan sumber daya target. Nilai valid: ● AssociatedWithDisk: diasosiasikan dengan disk. ● AssociatedWithInstanceTag: diasosiasikan dengan tag instans. Nilai default: AssociatedWithDisk. |
AssociatedWithDisk |
| TargetTags |
array<object> |
No |
Daftar tag sumber daya target. Kebijakan snapshot otomatis mencocokkan sumber daya target berdasarkan tag. Ketika AssociationType diatur ke AssociatedWithInstanceTag, parameter ini wajib diisi. |
|
|
object |
No |
Tag sumber daya target. |
||
| Key |
string |
No |
Kunci tag. Nilai valid N: 1 hingga 10. Kunci tag tidak boleh berupa string kosong, panjang maksimal 128 karakter, dan tidak boleh dimulai dengan aliyun atau acs:. Kunci tag tidak boleh mengandung http:// atau https://. |
|
| Value |
string |
No |
Nilai tag. Nilai valid N: 1 hingga 10. Nilai tag panjang maksimal 128 karakter dan tidak boleh mengandung http:// atau https://. Catatan: Jika Anda memberikan nilai kosong atau string kosong, artinya nilai apa pun diterima. |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| AutoSnapshotPolicyId |
string |
ID kebijakan snapshot otomatis. |
sp-bp12m37ccmxvbmi5**** |
| RequestId |
string |
ID permintaan. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Contoh
Respons sukses
JSONformat
{
"AutoSnapshotPolicyId": "sp-bp12m37ccmxvbmi5****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | DiskCategory.OperationNotSupported | The type of the specified disk does not support creating a snapshot. | Disk yang ditentukan tidak mendukung operasi ini karena pembatasan tipe disk. |
| 400 | InvalidSnapshotPolicyName.Malformed | The specified autoSnapshotPolicyName is malformed. | |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | Terdapat kunci duplikat dalam tag. Pastikan kunci unik. |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | Kunci tag yang ditentukan tidak valid. Kunci tag tidak boleh kosong atau null, dapat berisi hingga 128 karakter, dan tidak boleh dimulai dengan "aliyun" atau "acs:" atau mengandung "http://" atau "https://". |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | Nilai tag yang ditentukan tidak valid. Nilai tag dapat berisi hingga 128 karakter dan tidak boleh mengandung "http://" atau "https://". |
| 400 | InvalidParameter.EncryptedIllegal | The specified parameter Encrypted must be true when kmsKeyId is not empty. | Parameter yang ditentukan tidak valid. Pastikan pengaturan enkripsi Anda valid. %s adalah variabel. Paket error aktual dikembalikan secara dinamis berdasarkan panggilan API. |
| 400 | InvalidParameter.KmsNotEnabled | Failed to perform this operation because KMS is not activated. | Anda harus mengaktifkan Key Management Service (KMS). |
| 400 | InvalidParameter.Encrypted.KmsNotEnable | Failed to perform this operation because KMS is not activated. | Anda harus mengaktifkan layanan hosting kunci KMS. |
| 400 | InvalidParam.EncryptedMismatch | Creating encrypted disks with shared encrypted image requires replacing encryption keys. | Saat membuat disk dari gambar terenkripsi bersama, Anda harus menggunakan kunci enkripsi yang berbeda. |
| 400 | InvalidAssociationType.Malformed | The specified parameter AssociationType is invalid. Please check the valid range for this parameter. | |
| 400 | MissingParameter.TargetTags | When the parameter AssociationType is set to AssociatedWithInstanceTag, the TargetTags parameter is required. | |
| 400 | InvalidTargetTags.NotSupported | When the parameter AssociationType is set to AssociatedWithDisk, the TargetTags parameter is not supported. | |
| 400 | InvalidTargetTagKey.Malformed | The specified TargetTag.n.Key [%s] is not valid. | |
| 400 | InvalidTargetTagValue.Malformed | The specified TargetTag.n.Value [%s] is not valid. | |
| 400 | Duplicate.TargetTagKey | Duplicate keys exist in the specified parameter TargetTags. Please ensure key uniqueness. | |
| 400 | InvalidTargetTag.LimitExceed | The number [%s] of the specified parameter TargetTag exceeds the limit [%s]. | |
| 403 | ParameterInvalid | The specified RegionId parameter is invalid. | Aturan snapshot tidak ada. |
| 403 | AutoSnapshotPolicy.QuotaExceed | The maximum number of automatic snapshot policy has been reached. | |
| 403 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | |
| 403 | InvalidAccountStatus.SnapshotServiceUnavailable | Snapshot service has not been opened yet. | Layanan snapshot tidak diaktifkan. Operasi tidak dapat dilakukan. |
| 403 | InvalidParameter.TargetCopyRegions | The specified TargetCopyRegions is invalid. | |
| 403 | InvalidParameter.CopiedSnapshotsRetentionDays | The specified CopiedSnapshotsRetentionDays is invalid. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service does not have permission to access your KMS key. Please verify that the specified KMS key has authorized the ECS service. | |
| 403 | InvalidOperation.KMSKeyIdNotFound | The specified KMSKeyId not found, %s. | Kunci enkripsi KMS yang terkait tidak dapat ditemukan. Verifikasi bahwa kunci enkripsi KMS valid. |
| 403 | Abs.InvalidAction.RegionNotSupport | This region does not support this action. | Wilayah ini tidak mendukung operasi tersebut. |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK (Customer Master Key) must be in an active state. | Customer master key (CMK) harus dalam status aktif. |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK(Customer Master Key) lacks authorization to add tags to the ECS service. | ECS tidak memiliki izin untuk mengenkripsi atau mendekripsi CMK Anda. |
| 403 | InvalidStorageLocationArn.Malformed | The specified parameter StorageLocationArn is malformed. | |
| 403 | InvalidOperation.UserNotInWhiteList | The current user is temporarily unable to use this feature. Please submit a ticket for assistance. | |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | Kelompok sumber daya yang sesuai tidak ditemukan. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.