You need to enable JavaScript to run this app.
文档中心
云服务器

云服务器

复制全文
下载 pdf
云盘
CreateVolume - 创建云盘
复制全文
下载 pdf
CreateVolume - 创建云盘
调用CreateVolume接口创建云盘。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:CreateVolume​
要执行的操作,取值:CreateVolume。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
VolumeName string 必选 示例值:test-volume​
云盘显示名称。命名规则如下:​
  • 首字符仅支持中文、字母或下划线(_)。​
  • 可包含中文、字母、数字、下划线(_)或中划线(-)。​
  • 长度限制在1~128字符之间。​
​
VolumeType string 必选 示例值:PTSSD​
云盘类型,取值说明如下:​
  • ESSD_PL0:极速型SSD云盘,PL0规格。​
  • ESSD_FlexPL:极速型SSD云盘,FlexPL规格。​
  • TSSD_TL0:吞吐型SSD云盘。​
说明​
关于云盘规格的详细说明,请参见云盘规格。​
​
Size integer 必选 示例值:40​
数据盘容量大小,单位为GiB。不同类型的数据盘容量范围如下:​
  • ESSD_PL0:10~65536 GiB​
  • ESSD_FlexPL:10~65536 GiB​
  • TSSD_TL0:40~65536 GiB​
​
Kind string 可选 示例值:data​
云盘属性,data表示数据盘。默认值为data。​
说明​
仅支持创建数据盘。​
​
VolumeChargeType string 可选 示例值:PostPaid​
付费方式,默认按量计费,取值说明如下:​
  • PostPaid:按量计费​
  • PrePaid:包年包月​
​
ZoneId string 可选 示例值:cn-beijing-a​
可用区ID。​
注意​
如果您没有设置InstanceId,则ZoneId为必填参数。当您同时设置了InstanceId和ZoneId参数后,如果实例所在的地域与ZoneId指定的地域不一致,则请求会失败。​
​
Description string 可选 示例值:用于测试的云盘​
云盘的描述信息,默认为空,长度限制在1 ~ 255字符之间。​
​
ClientToken string 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
用以保证请求幂等性。该字符串由您的客户端生成,用以保证不同请求之间的唯一性。ClientToken是一个大小写敏感、不超过64个ASCII字符的字符串。​
​
ExtraPerformanceTypeId string 可选 示例值:IOPS​
额外性能的类型,不同的云盘,取值不同,说明如下:​
  • ESSD FlexPL数据盘的额外性能取值如下:​
  • Balance:均衡型额外性能。​
  • IOPS:IOPS型额外性能。​
  • Throughput:吞吐量型额外性能。​
说明​
关于ESSD FlexPL数据盘额外性能的详细介绍,请参见云盘额外性能。​
说明​
  • 仅500 GiB及以上的ESSD FlexPL数据盘,才支持配置额外性能。​
  • 仅100 GiB及以上的TSSD_TL0数据盘,才支持配置额外性能。​
​
ExtraPerformanceIOPS integer 可选 示例值:100​
额外IOPS性能大小,单位为次/秒,各个类型的额外性能取值范围如下:​
  • IOPS型额外性能: 0~50000​
  • Balance型额外性能: 0~50000​
说明​
仅当ExtraPerformanceTypeId参数值为Balance或IOPS时,才可以配置ExtraPerformanceIOPS参数。​
​
ExtraPerformanceThroughputMB integer 可选 示例值:100​
额外吞吐性能大小,单位为MB/s。​
说明​
  • 不同容量的吞吐型SSD云盘,可购买的额外吞吐量不同。​
  • 仅ExtraPerformanceTypeId参数值为Throughput时,才可以配置ExtraPerformanceThroughputMB参数。​
​
PlacementGroupId string 可选 示例值:pg-d5ard493uxd44up7****​
存储放置组ID。​
​
SubgroupNumber integer 可选 示例值:2​
存储子放置组编号。​
​
Tags.N.Key string[] 可选 示例值:Tags.1.Key=tag​
标签的标签键。​
  • Tags.N.Key:N表示标签键的序号。取值范围:1~20。​
  • 多个标签键之间用&分隔。​
​
Tags.N.Value string[] 可选 示例值:Tags.1.Value=test​
标签的标签值。​
  • Tags.N.Value:N表示标签值的序号。取值范围:1~20。​
  • 多个标签值之间用&分隔。​
​
BurstEnabled boolean 可选 示例值:true​
是否开启云盘性能突发。​
说明​
性能突发功能当前处于邀测状态,如需使用,请联系客户经理。​
​
DeleteProtection boolean 可选 示例值:true​
云盘是否开启删除保护。​
​
DeleteProtectionRetentionDays integer 可选 示例值:3​
删除保护涉及的快照数据默认永久保留,您也可以选择特定的保留时间,范围为 1~65536 天(默认30天),超过设置时间后快照将自动删除。​
​
SnapshotId string 可选 示例值:snap-ass6qd6tmm8gjme1****​
快照 ID。​
说明​
使用快照创建云盘时,需要设置该参数。​
​
InstanceId string 可选 示例值:i-ybliv8vfkzlbzah6****​
创建云盘的同时挂载的ECS实例ID。​
注意​
创建包年包月云盘时,该参数为必选参数,且挂载的ECS实例必须为包年包月实例。​
包年包月云盘的地域和可用区需要与所挂载实例相同。当您同时设置了InstanceId和ZoneId参数后,如果实例所在的地域与ZoneId指定的地域不一致,则请求会失败。​
​
ProjectName string 可选 示例值:default​
云盘所要加入的Project(项目)名称。​
说明​
如果您在创建云盘时未设置ProjectName,则云盘默认会加入default项目。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
VolumeId string 示例值:vol-3tigy72q3u3vj0x2****​
创建的云盘的ID。​
​
​
​
请求示例​
​
GET /?Action=CreateVolume&Version=2020-04-01&ZoneId=cn-beijing-a&VolumeName=test&VolumeType=ESSD_PL0&Kind=data&Size=40&Description=test HTTP/1.1​
Host: open.volcengineapi.com​
Region: cn-beijing​
ServiceName: storage_ebs​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20210702183508010225243153072A****",​
"Action": "CreateVolume",​
"Version": "2020-04-01",​
"Service": "storage_ebs",​
"Region": "cn-beijing"​
},​
"Result": {​
"VolumeId": "vol-3tj23cr2y23vj0wt****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidRequest​
The operation is not permitted due to the request is invalid.​
无效的请求。​
400​
MissingVolumeType​
Missing volume type.​
未指定云盘类型。​
400​
InvalidVolumeSizeForExtraPerformance​
The capacity of this volume does not support creating additional performance packages.​
该云盘容量不支持创建额外性能包。​
400​
InvalidVolumeType​
The specified parameter VolumeType is invalid.​
不支持该类型云盘。​
400​
InvalidVolumeSize​
Invalid volume size.​
云盘大小不合法。​
400​
InvalidProjectName​
invalid project name​
项目名称不合法。​
400​
InvalidVolumeNameFormat​
Invalid volume name format.​
云盘名称格式不合法。​
400​
InvalidDescriptionLen​
Invalid description length.​
描述长度不合法。​
400​
InvalidDescriptionFormat​
Invalid description format.​
描述格式不合法。​
400​
InvalidVolumeKind​
Invalid volume kind.​
云盘属性不合法。​
400​
InvalidExtraPerformanceType​
Incorrect additional performance package type.​
错误的额外性能包类型。​
400​
InvalidVolumeNameLen​
Invalid volume name length.​
云盘名称长度不合法。​
400​
InvalidVolumeTypeForExtraPerformance​
This volume type does not support creating additional performance packages.​
该云盘类型不支持创建额外性能包。​
400​
MissingVolumeName​
Missing volume name.​
缺少云盘名称。​
400​
MissingZoneID​
Missing availability zone ID.​
缺少可用区ID。​
400​
OperationNotSupported.ResourceEncryption​
Resource encryption is not supported.​
不支持资源加密功能。​
400​
InvalidParameter.KMSKeyId.KeyFormat​
The format of the KMSKeyId is invalid.​
KMSKeyId的格式无效。​
400​
InvalidParameter.KMSKeyId.KeyStatus​
The KMSKeyId status must be Enable.​
KMSKeyId的状态必须为Enable。​
400​
InvalidParameter.KMSKeyId.KeyUsage​
The KMSKeyId usage must be ENCRYPT_DECRYPT.​
KMSKeyId的用途必须为ENCRYPT_DECRYPT。​
400​
InvalidParameter.KMSKeyId.KeySpec​
The KMSKeyId spec is invalid.​
KMSKeyId的加密算法无效。​
400​
InvalidParameter.Encrypted.NotMatchKMSKeyId​
The specified parameter Encrypted must be true when KMSKeyId is not empty.​
当KMSKeyId不为空时,Encrypted参数必须为true。​
400​
InvalidParameter.Encrypted.NotMatchSnapshot​
The specified parameter Encrypted is different from the encrypted of the snapshot.​
指定的Encrypted参数与快照的加密属性不一致。​
400​
OperationNotSupported.ReplaceDEKNotSupported​
Resource replace dek is not supported.​
不支持更换数据加密密钥。​
400​
InvalidParameter.VolumeType​
Volume encryption is not supported for this volume type.​
该云盘类型不支持加密。​
403​
VolumeCannotAttachAcrossAccount​
Volumes cannot be attached across different master accounts.​
云盘和实例无法跨主账户挂载。​
403​
OperationDenied.KMSServiceNotOpen​
KMS service not open yet, please open the service and try again later.​
KMS服务尚未开通,请开通服务后重试。​
403​
OperationDenied.KMSUnauthorized​
EBS service has no right to access your KMS.​
EBS服务无权访问您的KMS。​
404​
VolumeNotFound​
The specified volume does not exist.​
云盘不存在。​
404​
NotFound.KMSKeyId​
The specified KMSKeyId does not exist.​
指定的KMSKeyId不存在。​
412​
QuotaCheckNotPass​
The user has exceeded the quota for creating volumes of this type and cannot create more: {{param}}.​
用户该类型云盘quota超额,不能继续创建: {{param}}。​
412​
ErrorAttachedVolumeOverLimit​
The maximum number of attached volumes has been reached for the instance.​
该实例已挂载云盘数已达上限。​
412​
ChargeTypeNotSupport​
Billing type not supported.​
计费方式暂不支持。​
412​
ErrorCreateIdempotencyFailed​
Failed to create an idempotent record.​
创建幂等记录失败。​
412​
ErrorInvalidIdempotencyAccount​
Conflicting account in the idempotent request.​
幂等请求账号冲突。​
412​
ErrorInvalidIdempotencyParam​
Conflicting parameters in the idempotent request.​
幂等请求参数冲突。​
412​
ErrorIdempotencyStatusTimeout​
The idempotent request retry timeout.​
幂等请求重试超时。​
412​
ErrorIdempotencyStatusFailed​
The idempotent request has already failed.​
幂等请求已经失败。​
412​
ErrorLoadIdempotencyFailed​
Failed to load playback for the idempotent request.​
幂等请求回放加载失败。​
412​
ErrorInvalidIdempotencyAction​
Conflicting action in the idempotent request.​
幂等请求Action冲突。​
412​
ErrorInvalidIdempotencyBusy​
Too many concurrent idempotent requests, please retry later.​
幂等请求并发过多,稍后重试。​
412​
NoAvailableVolumePool​
No storage pool supports the specified type in the availability zone.​
可用区中无支持该类型的存储池。​
​
​
最近更新时间:2026.06.16 18:41:23
这个页面对您有帮助吗?
有用
有用
无用
无用