All Products
Search
Document Center

Elastic Compute Service:ReplaceSystemDisk

Last Updated:Jun 12, 2026

Mengganti sistem operasi dengan mengganti disk sistem dari instans ECS. Setelah penggantian, ID cloud disk dari disk sistem berubah dan cloud disk asli dilepaskan.

Deskripsi operasi

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

Saat mengganti disk sistem, perhatikan hal-hal berikut:

  • Metode penagihan disk sistem tidak dapat diubah.

  • Kategori cloud disk disk sistem tidak dapat diubah.

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

  • Instans harus berada dalam status Stopped.

    Catatan

    Hanya berlaku untuk instans tipe VPC. Jika Instance ECS menggunakan metode penagihan pay-as-you-go dan mode berhenti ekonomis diaktifkan secara default, untuk mencegah ketidakmampuan memulai ulang instans setelah mengganti disk sistem akibat inventaris Instance ECS yang tidak mencukupi di wilayah tersebut, Anda harus mengatur mode berhenti ke mode berhenti reguler saat menghentikan instans. Untuk informasi lebih lanjut, lihat StopInstance.

  • Anda dapat menggunakan parameter SystemDisk.Size untuk menentukan ulang kapasitas disk sistem (yang tidak boleh lebih kecil dari kapasitas disk sistem asli).

  • Jika Instance ECS terkunci karena alasan keamanan, yaitu parameter OperationLocks instans berisi "LockReason": "security", disk sistem instans tidak dapat diganti. Untuk informasi lebih lanjut, lihat Perilaku API saat instans terkunci karena alasan keamanan.

Setelah mengganti disk sistem, Anda dapat memanggil operasi DescribeInstances untuk mengkueri status instans yang disk sistemnya telah diganti guna memverifikasi apakah penggantian berhasil. Jika nilai OperationLocks yang dikembalikan kosong, operasi 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.

Catatan

Sebelum memulai permintaan, pastikan instans target berada dalam status Stopped.

i-bp67acfmxazb4ph****

ImageId

string

No

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

m-bp67acfmxazb4ph****

SystemDisk.Size

integer

No

The new system disk capacity, in GiB. Valid values:

  • Basic cloud disk: Max{20, size of the image specified by the ImageId parameter} to 500.

  • ESSD cloud disk:
    • PL0: Max{1, size of the image specified by the ImageId parameter} to 2048.

    • PL1: Max{20, size of the image specified by the ImageId parameter} to 2048.

    • PL2: Max{461, size of the image specified by the ImageId parameter} to 2048.

    • PL3: Max{1261, size of the image specified by the ImageId parameter} to 2048.

  • ESSD AutoPL cloud disk: Max{1, size of the image specified by the ImageId parameter} to 2048.

  • Other cloud disks: Max{20, size of the image specified by the ImageId parameter} to 2048.

Default value: Max{40, size of the image specified by the ImageId parameter}.

Catatan

Additional fees are charged for the disk capacity that exceeds Max{20, capacity of the system disk before the replacement}.

80

ClientToken

string

No

Token klien yang digunakan untuk memastikan idempotensi permintaan. Buat nilai dari klien Anda untuk memastikan nilainya 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

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 berlaku saat disk sistem disambungkan (nama perangkat adalah /dev/xvda).

true

Password

string

No

Apakah akan mereset kata sandi nama pengguna Instance 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 dapat berupa:

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

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

Nilai default: tidak berubah.

Catatan

Jika Anda meneruskan parameter Password, kami menyarankan Anda menggunakan HTTPS untuk mengirim permintaan guna mencegah kebocoran kata sandi.

EcsV587!

PasswordInherit

boolean

No

Apakah akan menggunakan kata sandi yang telah ditetapkan sebelumnya di image.

Nilai default: false.

Catatan

Saat menggunakan parameter ini, parameter Password harus kosong. Selain itu, Anda harus memastikan bahwa kata sandi telah ditetapkan untuk image yang digunakan.

false

KeyPairName

string

No

Nama pasangan kunci.

Catatan

Parameter ini hanya berlaku untuk Instance ECS Linux. Anda dapat menyambungkan pasangan kunci SSH ke Instance ECS sebagai kredensial logon. Setelah pasangan kunci SSH digunakan, metode kredensial logon berdasarkan nama pengguna dan kata sandi dinonaktifkan.

testKeyPairName

DiskId

string

No

Catatan

Parameter ini tidak digunakan lagi. Untuk meningkatkan kompatibilitas, kami menyarankan Anda menggunakan ImageId.

d-bp67acfmxazb4ph****

Platform

string

No

Catatan

Tidak digunakan lagi.

CentOS

Architecture

string

No

Catatan

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 cloud disk. Nilai valid:

  • true: Ya.

  • false: Tidak.

Nilai default: false.

Penting Saat menggunakan image terenkripsi bersama untuk membuat cloud disk berdasarkan snapshot terenkripsi, Anda harus mengatur parameter permintaan Encrypted menjadi true untuk cloud disk guna memastikan cloud disk yang dibuat menggunakan kunci dari pembagi.
.

false

KMSKeyId

string

No

ID kunci KMS yang sesuai dengan disk sistem.

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

EncryptAlgorithm

string

No

Catatan

Parameter ini tidak tersedia secara publik.

hide

Arn

array<object>

No

Parameter ini tidak tersedia secara publik.

object

No

RoleType

string

No

Catatan

Parameter ini tidak tersedia secara publik.

null

Rolearn

string

No

Catatan

Parameter ini tidak tersedia secara publik.

null

AssumeRoleFor

integer

No

Catatan

Parameter ini tidak tersedia secara publik.

0

Elemen respons

Element

Type

Description

Example

object

DiskId

string

ID cloud disk dari 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.
400 InvalidSystemDiskSize.ValueNotSupported The specified parameter SystemDisk.Size is invalid.
400 InvalidParameter.Conflict The specified image does not support the specified instance type.
400 InvalidSystemDiskSize.ImageNotSupportResize The specified image does not support resize.
400 InvalidSystemDiskSize The specified parameter SystemDisk.Size is invalid.
400 InvalidPassword.Malformed The specified parameter "Password" is not valid.
400 InvalidPasswordParam.Mismatch The input password should be null when passwdInherit is true.
400 OperationDenied The specified image contains the snapshot of the data disk,does not support this operation.
400 InvalidDiskCategory.ValueNotSupported The specified parameter "DiskCategory" is not valid.
400 InvalidKeyPairName.NotFound The specified KeyPairName does not exist.
400 DependencyViolation.IoOptimize The specified parameter InstanceId is not valid.
400 MissingParameter.Architecture Architecture should not be null.
400 InvalidArchitecture.Malformed Architecture is not valid.
400 MissingParameter.Platform Platform should not be null.
400 InvalidPlatform.Malformed Platform is not valid.
400 InvalidDiskId.NotFound The specified disk do not exist.
400 InvalidDatadisk.DiskStatusViolation The operation is not permitted due to status of the Datadisk.
400 InvalidDatadisk.DiskCategoryViolation The operation is not permitted due to category of the Datadisk.
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.
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.
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.
400 QuotaExceed.DiskCapacity The used capacity of disk type has exceeded the quota in the zone, %s.
400 AccountForbidden.ProductCreationLimited The commodity must be officially operated by Aliyun and in pay-as-you-go billing method.
400 InternalError The requested services is not available now. Please try again later.
400 InvalidDiskName.Malformed The specified parameter "SyatemDisk.DiskName or DataDisk.n.DiskName" is not valid.
400 InvalidParameter.Encrypted Creating non-encrypted disks with encrypted snapshots is not supported.
500 OperationDenied Internal Error.
500 InternalError The request processing has failed due to some unknown error.
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, system disk is transfering.
403 IncorrectDiskStatus The current disk status does not support this operation.
403 IncorrectInstanceStatus The current status of the resource does not support this operation.
403 InstanceLockedForSecurity The instance is locked due to security.
403 ImageNotSubscribed The specified image has not be subscribed.
403 ImageRemovedInMarket The specified market image is not available, Or the specified user defined image includes product code because it is based on an image subscribed from marketplace, and that image in marketplace includeing exact the 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 is not support IoOptimized Instance.
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 creating is windows, cannot use ssh key pair to login.
403 InvalidParameter.NotMatch %s
403 ResourcesNotInSameZone The specified instance and disk are not in the same zone.
403 OperationDenied.UnpaidOrder The specified instance has unpaid order.
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.
403 InvalidOperation.MultiAttachDisk Multi attach disk does not support this operation.
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 parameter EncryptAlgorithm is not valid.
403 InvalidEncrypted.NotMatchKmsKeyId The specified parameter Encrypted must be true when KmsKeyId is not empty.
403 InvalidEncrypted.NotMatchEncryptAlgorithm The specified parameter Encrypted must be true when EncryptAlgorithm is not empty.
403 InvalidParameter.KmsNotEnabled The specified operation need enable KMS.
403 InvalidParameter.DataEncryptedKeyCreateFailed Create kms data encrypted key fail. If you need further assistance, you can contact the KMS Technical Support.
403 InvalidParameter.KMSKeyId.NotFound The specified KMSKeyId does not exist.
403 InvalidParameter.KMSKeyId.KMSUnauthorized ECS service have no right to access your KMS.
403 InvalidKMSKeyId.NotSymmetric The specified parameter KmsKeyId must be symmetric.
403 InvalidDiskId.NotSupportReplaceEncryptedSystemDisk The specified diskId not support replace encrypted system disk.
403 NotSupportSnapshotEncrypted.DiskCategory The specified disk category does not support creating encrypted system disks or creating encrypted data disks from snapshots. Check the DiskCategory or Encrypted parameter, or check your account for default encryption settings.
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.
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.
403 OperationDenied The current region does not support changing the image type.
403 OperationDenied.ImageNotValid The specified Image is disabled or deleted, please check the status of the image.
403 OperationDenied.DiskNoStock The requested disk category is sold out in the specified zone. Please try a different disk category or another zone.
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 InvalidEncrypted.NotMatchSnapshot The specified parameter Encrypted must be set to true when creating disks with encrypted snapshots.
403 InvalidEncrypted.NotMatchDiskDefaultEncryption Enabling disk default encryption prevents the creation of non-encrypted disks.
403 InvalidPayMethod.SyncPaymentNotSupport Synchronous payment is not supported. Use another payment method.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist.
404 InvalidImageId.NotFound The specified ImageId does not exist.
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.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.