ReplaceSystemDisk

Last Updated: Sep 13, 2017

Description

Replacing the system disk will replace the disk ID of the system disk for the ECS. When replacing the system disk, the disk category or charge type will not be replaced. The original system disk will be deleted. Original automatic snapshots of the disk will be deleted depending on DeleteAutoSnapshot. However, user snapshots will be retained.

To replace a system disk, the following prerequisites must be met:

  • The instance status must be Stopped.
  • In OperationLocks, LockReason: security cannot be indicated.
  • Payment cannot be overdue.

Request parameters

Name Type Required Description
Action String Yes Value: ReplaceSystemDisk.
InstanceId String Yes Indicates the specified instance ID.
ImageId String Yes Indicates the ID of the image used when resetting the system.
ClientToken String No Used to ensure the idempotence of the request. The value is generated by a client. The client token must be unique among all requests and contain up to 64 ASCII characters. For details, refer to the appendix How to Ensure Idempotence.

Return parameters

Name Type Description
DiskId String Indicates the disk ID of the new system disk.

Error code

Error Code Description Http status code Meaning
MissingParameter The input parameter InstanceId that is mandatory for processing this request is not supplied. 400 InstanceId parameter is not specified.
MissingParameter The input parameter ImageId that is mandatory for processing this request is not supplied. 400 ImageId parameter is not specified.
InvalidInstanceId.NotFound The specified InstanceId does not exist. 404 The specified instance does not exist.
InvalidImageId.NotFound The specified ImageId does not exist. 404 The specified image does not exist.
IncorrectInstanceStatus The current status of the resource does not support this operation. 403 The status of the specified instance is incorrect.
InstanceLockedForSecurity The instance is locked due to security. 403 The specified instance has a safety lock.
ImageNotSubscribed The specified image is not subscribed. 403 You have not subscribed to the specified image in the marketplace.
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 the marketplace, and that image in marketplace with the same product code has been removed. 403 The specified image has been removed from the marketplace.
OperationDenied Internal Error. 500 Internal error.
InvalidParameter.Conflict The specified image does not support the specified instance type. 400 The specified image cannot be used on the specified instance type.
InvalidInstanceId.NotFound The specified InstanceId does not exist. 404 The specified instance does not exist.
InstanceExpiredOrInArrears The specified operation is denied as your prepay instance is expired (prepay mode) or in overdue payment (afterpay mode). 403 Payment is overdue for the specified instance.
ChargeTypeViolation The operation is not permitted due to charge type of the instance. 403 The charge type of the specified instance does not support replacing the system disk.
DiskCreatingSnapshot The operation is denied due to a snapshot of the specified disk is not completed yet. 403 A snapshot of the specified disk is being created.
IoOptimized.NotSupported The specified image does not support IoOptimized Instance type. 403 The specified image must support the IoOptimized instance type.
InvalidParameter.Conflict The specified image does not support the specified instance type. 400 The specified image does not support the creation of an instance with this specification.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=ReplaceSystemDisk
  2. &InstanceId=i-23jggx34b
  3. &ImageId=m-myimage11
  4. &<Public Request Parameters>

Return example

XML format

  1. <ResetDiskResponse>
  2. <DiskId>d-23jbf2v5m</DiskId>
  3. <RequestId>F3CD6886-D8D0-4FEE-B93E-1B73239673DE</RequestId>
  4. </ResetDiskResponse>

JSON format

  1. {
  2. "DiskId": "d-23jbf2v5m",
  3. "RequestId": "F3CD6886-D8D0-4FEE-B93E-1B73239673DE"
  4. }
Thank you! We've received your feedback.