阿里云如何使用重新初始化磁盤接口
來源:技術員聯盟┆發布時間:2017-12-09 00:33┆點擊:
重新初始化磁盤
描述
重新初始化磁盤到初始狀態,磁盤狀態必須為使用中(In_use)的狀態,且實例狀態必須為 Stopped 時,才能執行此操作。但是如果實例創建后在第一次啟動前,掛載在其上的磁盤也不能重新初始化。
調用此接口,磁盤恢復到創建時的初始狀態,即:
如果為數據盤且是直接創建的空盤,則初始化到空盤狀態
如果為數據盤且是通過快照創建的,則初始化到快照狀態
如果為系統盤,則初始化到鏡像的初始狀態
請求參數
名稱
類型
是否必須
描述
Action
String
是
系統規定參數,取值:ReInitDisk
DiskId
String
是
指定的磁盤設備 ID
返回參數
全是公共返回參數,詳見公共返回參數
錯誤碼
錯誤代碼
描述
Http 狀態碼
語義
MissingParameter
The input parameter "DiskId" that is mandatory for processing this request is not supplied.
400
DiskId 未指定
InvalidDiskId.NotFound
The specified disk does not exist.
404
指定的磁盤不存在
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
指定的實例被安全鎖定
InvalidSnapshot.TooOld
The disk is created from a snapshotId made before 2013-07-15, it cannot be re-initiated the specified disk any more since the detached first time.
403
指定磁盤的源快照創建于 2013 年 7 月 15 日(含)之前,不能重新初始化
InvalidSourceSnapshot
The snapshot which is used to create the specified disk has been deleted.
403
指定磁盤的源快照已被刪除,不能重新初始化
InstanceExpiredOrInArrears
The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).
403
指定的實例已欠費
DiskCreatingSnapshot
The operation is denied due to a snapshot of the specified disk is not completed yet.
403
指定的磁盤正在創建快照
IncorrectDiskStatus.NeverUsed
The specified disk has never been used after creating.
403
磁盤創建后未被使用,內容沒有變化
示例
請求示例
https://ecs.aliyuncs.com/?Action=ReInitDisk
&DiskId=d-23jbf2v5m
&<公共請求參數>
返回示例
XML格式
F3CD6886-D8D0-4FEE-B93E-1B73239673DE
JSON格式
{
"RequestId":"F3CD6886-D8D0-4FEE-B93E-1B73239673DE"