文档

ResizeDisk - 扩容云盘

更新时间:

调用ResizeDisk扩容一块云盘,支持扩容系统盘和数据盘。

接口说明

说明 扩容前,请务必查询云盘采用的分区格式。如果是 MBR 格式,不支持扩容到 2TiB 以上,否则会造成数据丢失。对于 MBR 分区扩容,建议您重新创建并挂载一块数据盘,采用 GPT 分区格式后,再将已有数据拷贝至新的数据盘上。更多详情,请参见扩容云盘容量
  • 支持扩容的云盘类型包括普通云盘(cloud)、高效云盘(cloud_efficiency)、SSD 云盘(cloud_ssd)、ESSD 云盘(cloud_essd、ESSD Entry 云盘(cloud_essd_entry)和 ESSD AutoPL 云盘(cloud_auto)。

  • 当云盘正在创建快照时,不允许扩容。

  • 云盘挂载的实例的状态必须为运行中Running)或者已停止Stopped)。

  • 扩容时,不会修改云盘分区和文件系统,您需要在扩容后自行分配存储空间。

  • 开启多重挂载特性的云盘支持在线扩容和离线扩容。离线扩容前,您需要确保所挂载的全部实例均为已停止Stopped)状态。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
ecs:ResizeDiskWrite
  • Disk
    acs:ecs:{#regionId}:{#accountId}:disk/{#diskId}
  • ecs:tag

请求参数

名称类型必填描述示例值
DiskIdstring

云盘 ID。您可以调用 DescribeDisks 查询云盘 ID。

d-bp67acfmxazb4p****
Typestring

扩容云盘的方式。取值范围:

  • offline(默认):离线扩容。扩容后,您必须在控制台重启实例或者调用 API RebootInstance 使操作生效。

  • online:在线扩容,无需重启实例即可完成扩容。云盘类型支持高效云盘、SSD 云盘和 ESSD 云盘。

offline
NewSizeinteger

希望扩容到的云盘容量大小。单位为 GiB。取值范围如下:

  • 系统盘:
    • 普通云盘:20~500。
    • 其他类型云盘:20~2048。
  • 数据盘:
    • 高效云盘(cloud_efficiency):20~32768。

    • SSD 云盘(cloud_ssd):20~32768。

    • ESSD 云盘(cloud_essd):具体取值范围与PerformanceLevel的取值有关。可以调用 DescribeDisks 查询云盘信息,再根据查询结果中的PerformanceLevel参数查看取值。

      • PL0:40~32768。
      • PL1:20~32768。
      • PL2:461~32768。
      • PL3:1261~32768。
    • 普通云盘(cloud):5~2000。

    • ESSD AutoPL 云盘(cloud_auto):40~32768。

    • ESSD Entry 云盘(cloud_essd_entry):10~32768。

指定的新云盘容量必须比原云盘容量大。

1900
ClientTokenstring

保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符,且不能超过 64 个字符。更多信息,请参见如何保证幂等性

123e4567-e89b-12d3-a456-426655440000

返回参数

名称类型描述示例值
object
OrderIdstring

生成的订单 ID。

说明 仅在扩容包年包月云盘时会返回订单 ID。
20413515388****
RequestIdstring

请求 ID。

F3CD6886-D8D0-4FEE-B93E-1B732396****

示例

正常返回示例

JSON格式

{
  "OrderId": "20413515388****",
  "RequestId": "F3CD6886-D8D0-4FEE-B93E-1B732396****"
}

错误码

HTTP status code错误码错误信息描述
400InvalidDataDiskSize.ValueNotSupportedThe specified DataDisk.n.Size beyond the permitted range, or the capacity of snapshot exceeds the size limit of the specified disk category.指定的 DataDisk.n.Size 超出允许范围,或者快照的容量超过指定磁盘类别的大小限制。
400InvalidDataDiskCategory.ValueNotSupported%s指定的数据磁盘类型无效。%s为变量,将根据调用API的实际情况动态返回错误信息。
400InvalidParameter.Conflict%s您输入的参数无效,请检查参数之间是否冲突。%s为变量,将根据调用API的实际情况动态返回错误信息。
400InvalidDataDiskSize.ValueNotSupported%s指定的数据盘容量无效。%s为变量,将根据调用API的实际情况动态返回错误信息。
400InvalidSystemDiskSize.ValueNotSupported%s当前操作不支持设置的系统盘大小。
400IncompleteParamterSome fields can not be null in this request.请求中缺失参数。
400InvalidRegionId.MalFormedThe specified RegionId is not valid.指定的地域不存在,请检查该参数是否正确。
400InvalidParam.TypeThe specified type is not supported.指定的参数Type无效。
400LastOrderProcessingThe previous order is still processing, please try again later.订单正在处理中,稍后重试。
400InvalidStatus.UpgradingThe instance which the disk attachs is upgrading; please try again later.-
400InvalidSystemDiskSize.ImageNotSupportResizeThe image of the instance does not support resize.-
400InvalidSystemDiskSize.ImageNotSupportResizeThe specified image does not support resize.指定的镜像不支持扩容。
400InvalidDisk.DetachedSystemDiskThe specified disk is a detached system disk, does not support this operation.-
400OperationDenied.NotEnoughCapacityThe capacity of the current dedicated block storage cluster is not enough to expand.-
400IncorrectDiskStatus.ReplicationStatusNotFoundDisk replication status not found.-
400IncorrectDiskStatus.InReplicationDisk already in replication.-
400QuotaExceed.DiskCapacityThe used capacity of disk type has exceeded the quota in the zone, %s.指定磁盘类型的已用容量超出可用区配额限制,您可以前往配额中心查询和申请提升磁盘容量配额。
400NoPermission.PriceThe operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true.-
400NoPermission.RefundThe operation requires refund permission. Please apply for permission from your main account.-
400InvalidOperation.InstanceRenewWithDowngradeInPlanThe operation is denied due to the specified instance has renew with downgrade record in plan.存在未生效的续费降配订单。订单生效前不允许此操作。
403OperationDeniedThe type of the disk does not support the operation.此磁盘种类不支持指定的操作。
403OperationDeniedThe status of the disk or the instance that the disk is attaching with does not support the operation.此磁盘或实例状态无法执行指定的操作。
403InvalidDiskSize.TooSmallSpecified new disk size is less than the original disk size.指定的新磁盘小于原始磁盘。
403InvalidDiskSize.TooLargeSpecified new disk size is beyond the permitted range.指定的新磁盘大小超过限制。
403InstanceExpiredOrInArrearsThe specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).实例已过期或者欠费,请您续费或者结清后再进行操作。
403DiskErrorIncorrect disk status.-
403DiskInArrearsThe specified operation is denied as your disk owing fee.指定的磁盘已欠费。
403IncorrectInstanceStatusThe current status of the resource does not support this operation.该资源目前的状态不支持此操作。
403DiskCreatingSnapshotThe operation is denied due to a snapshot of the specified disk is not completed yet.指定的磁盘正在创建快照。
403InvalidDiskSizeSpecified new disk size is less than or equal the original disk size.指定的新磁盘大小必须大于原始磁盘大小。
403Operation.ConflictThe operation may conflicts with others.该操作与其他操作冲突。
403InstanceLockedForSecurityThe instance is locked due to security.您的资源被安全锁定,拒绝操作。
403IncorrectDiskStatusThe current disk status does not support this operation.当前的磁盘不支持此操作,请您确认磁盘处于正常使用状态,是否欠费。
403UserNotInTheWhiteListThe user is not in disk white list.您不在磁盘白名单中,请加入白名单后重试。
403InvalidDiskCategory.NotSupportedThe specified disk category is not supported.指定的云盘类型不支持当前操作。
403InvalidRegion.NotSupportThe specified region does not support resize online.该地域不支持在线扩容。
403InvalidDiskCategory.NotSupportedThe specified disk category does not support resize online.指定的磁盘类型不支持在线扩容。
403IncorrectInstanceStatusThe current status of the resource does not support resize online.当前资源的状态不支持此操作。
403InvalidInstanceStatus.NotRunningThe status of instance to which the disk attachs must be running when resizing online.在线调整磁盘大小时,磁盘连接到的实例的状态必须正在运行。
403IncorrectDiskStatusThe current status of the resource does not support resize online.-
403InvalidOperation.InstanceTypeNotSupportOnlineResizeThe instance type of the specified instance does not support resize online.-
403InvalidParameter.KMSKeyId.CMKUnauthorizedThe CMK needs to be added ECS tag.CMK 未授权
403InvalidParameter.KMSKeyId.CMKNotEnabledThe CMK needs to be enabled.加密云盘设置了 KMSKeyId 后,CMK必须处于启用状态。您可以调用密钥管理服务的 DescribeKey 接口查询指定CMK的相关信息。
403InvalidParameter.KMSKeyId.KMSUnauthorizedECS service have no right to access your KMS.ECS 服务无权访问您的 KMS。
403InstanceSpecModification.NotEffectiveThe instance which the disk attachs has been reserved for making a spec modification and not taken effective in the current contract period.-
403InvalidDiskSize.NotSupportResizeOnlineThe current size of the resource does not support resize online.-
403SecurityRisk.3DVerificationWe have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email.我们检测到您的默认信用卡或借记卡存在安全风险。请通过电子邮件中的链接进行验证。
403QuotaExceeded.PostpaidDataDiskCapacityThe quota of postpaid data disk capacity exceeds.按量付费数据盘使用容量超出配额。
403InvalidOperation.MultiAttachDiskNotSupportResizeOnlineMulti attach disk does not support resize online.开启多重挂载特性的云盘不支持在线扩容。
404InvalidDiskId.NotFoundThe specified disk does not exist.指定的磁盘不存在。请您检查磁盘 ID 是否正确。
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.指定的实例ID未找到。
500InternalErrorThe request processing has failed due to some unknown error.内部错误,请重试。
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.内部错误,请重试。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2023-10-18OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:500
2023-10-09OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
    删除错误码:403
    删除错误码:404
    删除错误码:500
2023-05-16OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:500
  • 本页导读 (1)
文档反馈