對指定的磁盤存儲設(shè)備創(chuàng)建快照。
云服務(wù)器僅在 Stopped 或 Running 狀態(tài)下才能創(chuàng)建快照。(但剛創(chuàng)建完成從未啟動過的實例不能創(chuàng)建快照)
剛創(chuàng)建完成的云服務(wù)器系統(tǒng)盤,或剛增加從快照創(chuàng)建的數(shù)據(jù)盤,由于尚未完成數(shù)據(jù)的加載,此時創(chuàng)建快照會返回錯誤。一般來說,系統(tǒng)盤創(chuàng)建完成 1 個小時后即可創(chuàng)建快照,數(shù)據(jù)盤的可創(chuàng)建快照的時間取決于磁盤數(shù)據(jù)的大小。
新增加一塊磁盤后,如果實例尚未啟動過,新增的這塊磁盤不能用于創(chuàng)建快照。
如果快照創(chuàng)建沒有完成(即進度沒有達到 100%),那么這個快照無法用于創(chuàng)建自定義鏡像。
如果快照創(chuàng)建沒有完成(即進度沒有達到 100%),那么不能對同一磁盤再次創(chuàng)建快照。
快照數(shù)量的配額取決于該帳號下?lián)碛械拇疟P總數(shù)量。最多可創(chuàng)建的快照數(shù)量為磁盤數(shù)量乘以 6 + 6。
如果磁盤在 In_use 狀態(tài)下,掛載的實例的 OperationLocks 中標記了 "LockReason" : "security" 的鎖定狀態(tài)時,不能創(chuàng)建快照。
磁盤掛載的實例創(chuàng)建后第一次啟動前,不能創(chuàng)建快照
獨立普通云盤創(chuàng)建后,如果沒有掛載過,創(chuàng)建快照會出現(xiàn)錯誤提示。
請求參數(shù)
名稱
類型
是否必須
描述
Action
String
是
系統(tǒng)規(guī)定參數(shù),取值:CreateSnapshot
DiskId
String
是
指定的磁盤 ID
SnapshotName
String
否
快照的顯示名稱,[2, 128] 英文或中文字符,必須以大小字母或中文開頭,可包含數(shù)字,”_”或”-”,且不能以 auto 開頭(auto 開頭的快照名是預(yù)留給自動快照的)??煺盏娘@示名稱會顯示在控制臺中。不能以 和 https:// 開頭。
Description
String
否
快照的描述,[2, 256] 個字符。快照的描述會顯示在控制臺中。不填則為空,默認為空。不能以 和 https:// 開頭。
ClientToken
String
否
用于保證請求的冪等性。由客戶端生成該參數(shù)值,要保證在不同請求間唯一,最大不值過 64 個 ASCII 字符。
具體參見附錄:如何保證冪等性。
返回參數(shù)
名稱
類型
描述
SnapshotId
String
快照 ID
錯誤碼
錯誤代碼
描述
Http 狀態(tài)碼
語義
MissingParameter
The input parameter "DiskId" that is mandatory for processing this request is not supplied.
400
DiskId 參數(shù)未指定
InvalidDiskId.NotFound
The specified DiskId does not exist.
404
指定的磁盤不存在
InvalidSnapshotName.Malformed
The specified SnapshotName is wrongly formed.
400
SnapshotName 格式不合法
InvalidDescription.Malformed
The specified description is wrongly formed.
404
Description 格式不合法
IncorrectInstanceStatus
The current status of the resource does not support this operation.
400
指定的實例狀態(tài)不正確
IncorrectDiskStatus.CreatingSnapshot
The snapshot of the disk is still creating.
403
指定的磁盤正在創(chuàng)建快照
InstanceLockedForSecurity
The disk attached instance is locked due to security.
403
指定的實例被安全鎖定
IncorrectDiskStatus.NeverAttached
The specified disk has never been attached to any instance.
403
可卸載的普通云盤創(chuàng)建后未被掛載,內(nèi)容沒有變化
QuotaExceed.Snapshot
The snapshot quota exceeds.
403
快照額度超過限制
IncorrectDiskStatus.NeverUsed
The specified disk has never been used after creating.
403
磁盤創(chuàng)建后未被使用,內(nèi)容沒有變化
CreateSnapshot.Failed
The process of creating snapshot is failed
403
創(chuàng)建快照失敗
示例
請求示例
https://ecs.aliyuncs.com/?Action=CreateSnapshot
&DiskId=1033-60053321
&<公共請求參數(shù)>
返回示例
XML格式
C8B26B44-0189-443E-9816-D951F59623A9
s-923FE2BF0
JSON格式
{
"RequestId": "C8B26B44-0189-443E-9816-D951F59623A9",
"SnapshotId": "s-923FE2BF0"