All Products
Search
Document Center

Elastic Compute Service:ReplaceSystemDisk

Last Updated:Sep 15, 2026

Mengganti sistem operasi instans ECS dengan mengganti disk sistemnya. Setelah penggantian, ID disk sistem berubah dan disk asli dilepas.

Deskripsi operasi

Sebelum memanggil operasi ini, baca dengan saksama Mengganti disk sistem (mengganti sistem operasi).

Saat mengganti disk sistem, perhatikan hal-hal berikut:

  • Anda tidak dapat mengubah metode penagihan disk sistem.

  • Anda tidak dapat mengubah tipe disk sistem.

  • Instans ECS tempat disk sistem menyambungkan tidak boleh memiliki pesanan yang belum dibayar.

  • Instans harus berada dalam status Stopped (Stopped).

    Catatan

    Hal ini hanya berlaku untuk instans tipe VPC. Jika Instans ECS menggunakan metode penagihan pay-as-you-go dan mode hemat diaktifkan secara default, atur instans ke mode berhenti standar saat menghentikannya. Hal ini mencegah instans gagal dimulai ulang setelah disk sistem diganti karena inventaris Instans ECS yang tidak mencukupi di wilayah tersebut. Untuk informasi selengkapnya, lihat StopInstance.

  • Anda dapat menggunakan parameter SystemDisk.Size untuk menentukan kapasitas baru untuk disk sistem. Kapasitas baru tidak boleh lebih kecil dari kapasitas asli.

  • Jika Instans ECS terkunci karena alasan keamanan, yang berarti parameter OperationLocks instans berisi "LockReason": "security", penggantian disk sistem tidak didukung. Untuk informasi selengkapnya, lihat Perilaku API saat instans dikunci karena alasan keamanan.

Setelah mengganti disk sistem, panggil DescribeInstances untuk mengkueri status instans dan memverifikasi apakah penggantian berhasil. Jika nilai OperationLocks yang dikembalikan kosong, penggantian disk sistem telah selesai.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

ecs:ReplaceSystemDisk

update

Disk.

acs:ecs:{#regionId}:{#accountId}:disk/{#diskId}

Image.

acs:ecs:{#regionId}:{#accountId}:image/{#imageId}

*Instance.

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

  • ecs:IsDiskEncrypted
  • ecs:IsSystemDiskEncrypted
  • ecs:PasswordInherit
  • ecs:PasswordCustomized
  • ecs:IsDiskByokEncrypted
  • ecs:IsSystemDiskByokEncrypted
  • ecs:LoginAsNonRoot
  • ecs:ImagePlatform
None

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

ID instans target.

Catatan

Pastikan instans target berada dalam status Stopped sebelum Anda mengirim permintaan.

i-bp67acfmxazb4ph****

ImageId

string

No

ID image yang digunakan saat mereset disk sistem. Parameter ini wajib diisi.

m-bp67acfmxazb4ph****

SystemDisk.Size

integer

No

Kapasitas baru disk sistem. Unit: GiB. Nilai valid:

  • Disk dasar: Max{20, ukuran image yang ditentukan oleh parameter ImageId} hingga 500.

  • SSD Perusahaan (ESSD):
    • PL0: Max{1, ukuran image yang ditentukan oleh parameter ImageId} hingga 2048.

    • PL1: Max{20, ukuran image yang ditentukan oleh parameter ImageId} hingga 2048.

    • PL2: Max{461, ukuran image yang ditentukan oleh parameter ImageId} hingga 2048.

    • PL3: Max{1261, ukuran image yang ditentukan oleh parameter ImageId} hingga 2048.

  • Disk ESSD AutoPL: Max{1, ukuran image yang ditentukan oleh parameter ImageId} hingga 2048.

  • Tipe disk lainnya: Max{20, ukuran image yang ditentukan oleh parameter ImageId} hingga 2048.

Nilai default: Max{40, ukuran image yang ditentukan oleh parameter ImageId}.

Catatan

Kapasitas disk yang melebihi Max{20, kapasitas disk sistem asli} akan dikenakan biaya tambahan.

80

ClientToken

string

No

Token klien yang digunakan untuk memastikan idempotensi permintaan. Anda dapat menggunakan klien untuk menghasilkan token, tetapi Anda harus memastikan token tersebut unik di antara permintaan yang berbeda. ClientToken hanya dapat berisi karakter ASCII dan panjangnya tidak boleh melebihi 64 karakter. Untuk informasi selengkapnya, lihat Cara memastikan idempotensi.

123e4567-e89b-12d3-a456-426655440000

UseAdditionalService

boolean

No

Apakah akan menggunakan konfigurasi sistem mesin virtual yang disediakan oleh Alibaba Cloud (Windows: NTP dan KMS. Linux: NTP dan YUM).

Catatan

Parameter ini hanya berlaku saat disk sistem tersambung (yaitu, nama perangkat adalah /dev/xvda).

true

Password

string

No

Apakah akan mereset kata sandi instans ECS. Kata sandi harus memiliki panjang 8 hingga 30 karakter dan harus mengandung setidaknya tiga dari jenis karakter berikut: huruf besar, huruf kecil, angka, dan karakter khusus. Karakter khusus berikut didukung:

()`~!@#$%^&*-_+=|{}[]:;'<>,.?/

Untuk instans Windows, kata sandi tidak boleh diawali dengan garis miring (/).

Nilai default: Kata sandi tetap tidak berubah.

Catatan

Jika Anda menentukan parameter Password, gunakan HTTPS untuk mengirim permintaan guna mencegah kebocoran kata sandi.

EcsV587!

PasswordInherit

boolean

No

Apakah akan menggunakan kata sandi bawaan image.

Nilai default: false.

Catatan

Jika Anda menggunakan parameter ini, parameter Password harus kosong. Pastikan image yang Anda gunakan memiliki kata sandi bawaan.

false

KeyPairName

string

No

Nama key pair.

Catatan

Parameter ini hanya berlaku untuk instans ECS Linux. Anda dapat menyambungkan key pair SSH ke instans ECS sebagai kredensial logon. Setelah key pair SSH disambungkan, logon berbasis nama pengguna dan kata sandi dinonaktifkan.

testKeyPairName

DiskId

string

No

Catatan

[Tidak digunakan lagi] Parameter ini tidak digunakan lagi. Untuk meningkatkan kompatibilitas, gunakan ImageId sebagai gantinya.

d-bp67acfmxazb4ph****

Platform

string

No

Catatan

[Tidak digunakan lagi] Parameter ini tidak digunakan lagi.

CentOS

Architecture

string

No

Catatan

[Tidak digunakan lagi] Parameter ini tidak digunakan lagi.

i386

SecurityEnhancementStrategy

string

No

Apakah akan menggunakan Pusat Keamanan secara gratis setelah disk sistem diganti. Nilai valid:

  • Active: Menggunakan Pusat Keamanan. Nilai ini hanya didukung untuk image publik.

  • Deactive: Tidak menggunakan Pusat Keamanan. Nilai ini didukung untuk semua image.

Nilai default: Deactive.

Active

Encrypted

boolean

No

Apakah akan mengenkripsi disk. Nilai valid:

  • true: Mengenkripsi disk.

  • false: Tidak mengenkripsi disk.

Nilai default: false.

Penting Saat Anda menggunakan gambar bersama terenkripsi untuk membuat disk berdasarkan Snapshot terenkripsi, Anda harus mengatur parameter permintaan Encrypted=true untuk disk guna memastikan disk menggunakan kunci dari akun yang menerima gambar bersama.

false

KMSKeyId

string

No

ID kunci KMS disk sistem.

e522b26d-abf6-4e0d-b5da-04b7******3c

EncryptAlgorithm

string

No

Catatan

Parameter ini tidak tersedia untuk digunakan.

hide

Arn

array<object>

No

Parameter ini tidak tersedia untuk digunakan.

object

No

AssumeRoleFor

integer

No

Catatan

Parameter ini tidak tersedia untuk digunakan.

0

RoleType

string

No

Catatan

Parameter ini tidak tersedia untuk digunakan.

null

Rolearn

string

No

Catatan

Parameter ini tidak tersedia untuk digunakan.

null

Elemen respons

Element

Type

Description

Example

object

DiskId

string

ID disk sistem baru.

d-bp67acfmxazb4ph****

RequestId

string

ID permintaan.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Contoh

Respons sukses

JSONformat

{
  "DiskId": "d-bp67acfmxazb4ph****",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 LoginAsNonRoot.ImageNotSupport The specified image does not support login as non-root. Image ini tidak mendukung login non-root.
400 InvalidSystemDiskSize.ValueNotSupported The specified parameter SystemDisk.Size is invalid.
400 InvalidParameter.Conflict The specified image does not support the specified instance type. Parameter saling bertentangan.
400 InvalidSystemDiskSize.ImageNotSupportResize The specified image does not support resize. Image yang ditentukan tidak mendukung pengubahan ukuran.
400 InvalidSystemDiskSize The specified parameter SystemDisk.Size is invalid.
400 InvalidPassword.Malformed The specified parameter "Password" is not valid. Parameter Password yang ditentukan tidak valid.
400 InvalidPasswordParam.Mismatch The input password should be null when passwdInherit is true. Ketika PasswdInherit diaktifkan, nama pengguna dan kata sandi harus kosong.
400 OperationDenied The specified image contains the snapshot of the data disk. This operation is not supported.
400 InvalidDiskCategory.ValueNotSupported The specified parameter "DiskCategory" is not valid. Tipe disk sistem dan tipe disk data yang ditentukan tidak didukung.
400 InvalidKeyPairName.NotFound The specified KeyPairName does not exist. KeyPairName yang ditentukan tidak ada.
400 DependencyViolation.IoOptimize The specified parameter InstanceId is not valid. ID instans yang ditentukan tidak valid, atau konfigurasi optimasi I/O instans yang ditentukan tidak valid.
400 MissingParameter.Architecture Architecture should not be null. Parameter Architecture tidak boleh kosong.
400 InvalidArchitecture.Malformed Architecture is not valid. Format parameter Architecture tidak valid.
400 MissingParameter.Platform Platform should not be null. Parameter Platform tidak boleh kosong.
400 InvalidPlatform.Malformed Platform is not valid. Distribusi sistem operasi image yang ditentukan tidak valid.
400 InvalidDiskId.NotFound The specified disk do not exist. Disk yang ditentukan tidak ada. Periksa apakah ID disk sudah benar.
400 InvalidDatadisk.DiskStatusViolation The operation is not permitted due to status of the Datadisk. Status cloud disk data saat ini tidak mendukung operasi ini.
400 InvalidDatadisk.DiskCategoryViolation The operation is not permitted due to category of the Datadisk. Tipe cloud disk data tidak mendukung operasi ini.
400 InvalidDatadisk.ChargeTypeViolation The operation is not permitted due to charge type of the Datadisk.
400 MissingParameter The input parameter "ImageId" that is mandatory for processing this request is not supplied.
400 InvalidInstance.NotFoundSystemDisk The specified instance has no system disk. Instans tertentu tidak memiliki disk sistem yang terpasang. Pastikan instans tertentu memiliki disk sistem yang terpasang. Anda dapat memanggil DescribeInstances untuk mengkueri informasi instans tertentu.
400 InvalidParameter.DiskType The specified disk type which has kms key can't convert to system disk.
400 DISK_IN_DEDICATED_BLOCK_STORAGE_CLUSTER The disk in dedicated block storage cluster is not allowed to do this operation.
400 IncorrectDiskStatus.ReplicationStatusNotFound Disk replication status not found.
400 IncorrectDiskStatus.InReplication Disk already in replication.
400 InvalidInstanceType.NotSupported The specified instanceType is not supported by the image architecture. InstanceType yang ditentukan tidak didukung.
400 InvalidRegionId.NotSupportReplaceEncryptedSystemDisk The specified region not support replace encrypted system disk.
400 InvalidStorageClusterId.CapacityNotEnough The remaining capacity of the current dedicated storage cluster is less than the size of disk. Kapasitas tersedia pada kluster penyimpanan khusus tempat disk berada tidak mencukupi.
400 QuotaExceed.DiskCapacity The used capacity of disk type has exceeded the quota in the zone, %s. Kapasitas terpakai dari tipe disk tertentu melebihi batas kuota zona aktif. Buka Pusat Kuota untuk mengkueri dan meminta peningkatan kuota kapasitas disk.
400 AccountForbidden.ProductCreationLimited The commodity must be officially operated by Aliyun and in pay-as-you-go billing method. Pelanggan migrasi cloud enterprise hanya dapat membeli Instans ECS pay-as-you-go dan tidak dapat membeli produk pihak ketiga seperti image yang disediakan oleh Alibaba Cloud Marketplace. Periksa parameter dan coba lagi dengan parameter yang valid.
400 InternalError The requested services is not available now. Please try again later. Terjadi error internal. Coba lagi.
400 InvalidDiskName.Malformed The specified parameter "SyatemDisk.DiskName or DataDisk.n.DiskName" is not valid. Format nama disk tidak valid. Panjang nama harus 2 hingga 128 karakter dan harus dimulai dengan huruf atau karakter Tionghoa. Nama dapat berisi angka, titik (.), garis bawah (_), atau tanda hubung (-). Nama tidak boleh dimulai dengan http:// atau https://.
400 InvalidParameter.Encrypted Creating non-encrypted disks from encrypted snapshots is not allowed. Please set Encrypted to true or use an unencrypted snapshot.
400 InvalidParam.EncryptedMismatch Creating a disk from a shared encrypted image requires encryption with your own KMS key. Please set the Encrypted parameter to true.
500 OperationDenied Internal Error.
500 InternalError The request processing has failed due to an internal error and you may retry later or contact support with the request ID.
403 LoginAsNonRoot.RegionNotSupport The specified region does not support login as non-root.
403 InvalidSystemDiskStatus.IsTransfering The current status of the resource does not support this operation. The system disk is transferring.
403 IncorrectDiskStatus The current disk status does not support this operation.
403 IncorrectInstanceStatus The instance must be in the Stopped state when you replace the system disk. Please stop the instance and try again.
403 InstanceLockedForSecurity The instance is locked due to security. Instans tempat disk tersambung terkunci karena alasan keamanan.
403 ImageNotSubscribed The specified image has not be subscribed.
403 ImageRemovedInMarket The specified marketplace image is not available. Or the specified user-defined image includes a product code because it is based on an image subscribed from the marketplace; and that marketplace image including the exact same product code has been removed.
403 InstanceExpiredOrInArrears The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).
403 ChargeTypeViolation The operation is not permitted due to charge type of the instance.
403 DiskCreatingSnapshot The operation is denied due to a snapshot of the specified disk is not completed yet.
403 IoOptimized.NotSupported The specified image does not support IoOptimized instances.
403 OperationDenied.ImageNotValid The specified marketplace image is not authorized. Please verify the marketplace image authorization and try again.
403 ImageNotSupportInstanceType The specified image don not support the InstanceType instance.
403 QuotaExceed.BuyImage The specified image is from the image market. You have not bought it or your quota has been exceeded.
403 INST_HAS_UNPAID_ORDER The instance has unpaid order.
403 OperationDenied.InstanceCreating The specified instance is creating.
403 DependencyViolation.WindowsInstance The instance runs Windows and does not support SSH key pair login.
403 InvalidParameter.NotMatch %s Parameter yang ditentukan tidak valid. Periksa apakah parameter saling bertentangan.
403 ResourcesNotInSameZone The specified instance and disk are not in the same zone.
403 OperationDenied.UnpaidOrder The specified instance has unpaid order. Pesanan yang belum dibayar sudah ada untuk ID instans tertentu. Anda dapat masuk ke Konsol ECS untuk menyelesaikan pembayaran.
403 InvalidHostname.MismatchImage The hostname of the current instance can not be applied to the image you choose.
403 HibernationConfigured.InstanceOperationForbidden The operation is not permitted due to limit of the hibernation configured instance. Operasi tidak diizinkan karena instans tidak memenuhi persyaratan untuk mengaktifkan opsi hibernasi.
403 InvalidOperation.MultiAttachDisk Multi attach disk does not support this operation. Disk dengan fitur multi-attach diaktifkan tidak mendukung operasi ini.
403 InvalidRegionId.NotSupportEncryptAlgorithm The current region does not support creating encrypted disks with EncryptAlgorithm.
403 InvalidRegionId.NotExists The region not exists.
403 InvalidEncryptAlgorithm The specified EncryptAlgorithm is not valid. Ensure the value is a supported encryption algorithm such as AES-256.
403 InvalidEncrypted.NotMatchKmsKeyId The Encrypted parameter must be set to true when KMSKeyId is specified. Please adjust the parameters and try again.
403 InvalidEncrypted.NotMatchEncryptAlgorithm The Encrypted parameter must be set to true when EncryptAlgorithm is specified. Please adjust the parameters and try again.
403 InvalidParameter.KmsNotEnabled The specified operation need enable KMS.
403 InvalidParameter.DataEncryptedKeyCreateFailed The ECS service is not authorized to access your KMS key. Please grant the ECS service permission to use the key and try again.
403 InvalidParameter.KMSKeyId.NotFound The specified KMSKeyId does not exist. Please verify that the key ID is correct and that the key resides in the current region.
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 InvalidKMSKeyId.NotSymmetric The specified KMSKeyId must be a symmetric key. Please use a symmetric KMS key such as an AES-256 key.
403 InvalidDiskId.NotSupportReplaceEncryptedSystemDisk The specified diskId not support replace encrypted system disk.
403 NotSupportSnapshotEncrypted.DiskCategory The specified disk category does not support re-encrypting a disk with a new KMSKeyId from a snapshot. Please use a disk category that supports encryption such as cloud_essd.
403 InvalidParameter.AllEmpty The current operation does not allow both diskId and imageId to be empty. Make sure that either diskId or imageId is not empty. Tidak ada parameter yang ditentukan. Tentukan parameter yang diperlukan.
403 InvalidParameter.Conflict The current operation does not allow both diskId and imageId to be set. Make sure that either diskId or imageId is not empty. Parameter saling bertentangan.
403 OperationDenied The current region does not support changing the image type. Snapshot yang ditentukan tidak mengizinkan pembuatan volume data.
403 OperationDenied.DiskNoStock The requested disk category is sold out in the specified zone. Please try a different disk category or another zone. Tipe disk yang ditentukan telah habis terjual di zona yang ditentukan. Gunakan tipe disk atau zona lain dan coba lagi.
403 InvalidParameter.KMSKeyId.CMKNotEnabled The specified KMS key must be in an enabled state. Please enable the key in the KMS console and try again.
403 InvalidParameter.KMSKeyId.CMKUnauthorized The specified KMS key is not authorized for the ECS service. Please grant the ECS service permission to use the key in the KMS console and try again.
403 InvalidEncrypted.NotMatchSnapshot The Encrypted parameter must be set to true when creating disks from encrypted snapshots. Please set Encrypted to true or use an unencrypted snapshot.
403 InvalidEncrypted.NotMatchDiskDefaultEncryption The operation failed because default disk encryption is enforced on your account. Please set the Encrypted parameter to true.
403 InvalidPayMethod.SyncPaymentNotSupport Synchronous payment is not supported. Use another payment method. Pembayaran otomatis tidak didukung dalam status saat ini. Atur parameter AutoPay ke metode pembayaran lain.
403 InvalidOperation.ImageSecureBootUnsupported The image does not support secure boot. Image tidak mendukung Secure Boot.
403 InvalidDiskCategory.NotSupported The disk category is not supported in the current zone. Please call DescribeAvailableResource to check supported categories.
403 OperationDenied.KMSKeyUnauthorized The operation is denied due to missing KMS key authorization. Please check the KMS key permissions and ensure the key is properly authorized for this operation.
403 InvalidOperation.TargetImageIncompatible The source image cannot be replaced by the target image.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. Instans yang ditentukan tidak ada. Periksa apakah ID instans sudah benar.
404 InvalidImageId.NotFound The specified ImageId does not exist. Image yang ditentukan tidak ada di akun ini. Verifikasi bahwa ID image benar.
404 InvalidSystemDiskSize.MoreThanMaxSize The specified SystemDisk.Size parameter exceeds the maximum size.
404 InvalidSystemDiskSize.LessThanImageSize The specified parameter SystemDisk.Size is less than the image size.
404 InvalidSystemDiskSize.LessThanMinSize The specified parameter SystemDisk.Size is less than the min size.
404 NoSuchResource The specified resource is not found. Sumber daya yang ditentukan tidak ada.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.