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

云服务器

复制全文
下载 pdf
镜像
ReplaceSystemVolume - 更换操作系统
复制全文
下载 pdf
ReplaceSystemVolume - 更换操作系统
调用 ReplaceSystemVolume 接口,为一台实例更换系统。​
注意事项​
使用本功能的前提条件及注意事项,可查看操作说明。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:ReplaceSystemVolume​
要执行的操作,取值:ReplaceSystemVolume。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
ClientToken string 可选 示例值:333456899ff****​
保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。取值:​
仅支持ASCII字符,且不能超过64个字符。​
​
DryRun boolean 可选 示例值:false​
是否只预检此次请求。取值:​
  • true:发送检查请求,不会更换系统。检查项包括是否填写了必需参数、请求格式、业务限制。如果检查不通过,则返回对应错误。如果检查通过,则返回错误码DryRunOperation。​
  • false(默认):发送正常请求,通过检查后直接更换系统。​
​
ImageId string 必选 示例值:image-38dfk6rfisf6kir6****​
更换操作系统时使用的镜像ID。您可以调用DescribeImages接口查询获取。​
​
ImageReleaseVersion string 可选 示例值:20241115​
使用的镜像具体版本号。​
说明​
  • 该参数仅选用公共镜像时生效。​
  • 若为空,将使用镜像的最新版本。​
​
InstanceId string 必选 示例值:i-a8j6n1i4hojfqpa0****​
实例ID。您可以调用DescribeInstances接口查询获取。​
​
KeepImageCredential boolean 可选 示例值:false​
使用镜像预设密码/密钥对登录实例。取值:​
  • true:使用镜像预设密码/密钥对登录。​
  • false(默认):不使用镜像预设密码/密钥对登录。​
说明​
  • 仅自定义镜像、共享镜像支持使用该功能。​
  • 该参数为true时,请勿传入PassWord和KeyPairName。​
​
KeyPairName string 可选 示例值:kp-test-123​
重置密钥对。您可以调用DescribeKeyPairs接口查询获取。​
说明​
  • 仅对Linux操作系统的实例生效。​
  • KeepImageCredential为false时,本参数与Password不能同时为空。​
  • 若同时设置了密钥对KeyPairName和密码Password,则仅生效密钥对KeyPairName。​
​
Password string 可选 示例值:Password@123​
重置密码,密码规则如下:​
  • 长度限制在8 ~ 30之间​
  • 密码只能由大写字母、小写字母、数字和特殊字符组成,且必须包含至少三项​
  • 特殊字符可以使用:`~!@#$%^&*()_-+=|{}[]:;'<>,.?/​
  • 不能以“/”和“$6$”开头​
说明​
  • 登录凭证支持“密码”、“密钥对”、“保留镜像设置”三种方式,使用“密码”方式登录实例时,建议增加密码复杂度以提高安全性。​
  • KeepImageCredential为false时,本参数与KeyPairName不能同时为空。​
​
​
​
返回参数​
本接口无特有的返回参数。更多信息请见返回结构。​
请求示例​
​
GET /?Action=ReplaceSystemVolume&Version=2020-04-01&InstanceId=i-a8j6n1i4hojfqpa0****&ImageId=image-38dfk6rfisf6kir6****&Password=Password@123 HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
Service: ecs​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "2021062415303301022514515207C4****",​
"Action": "ReplaceSystemVolume",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
IdempotentParameterMismatch​
The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.​
幂等参数不一致。​
400​
Insufficient.Balance​
The request is denied due to the lack of balance.​
账户余额不足。​
400​
InvalidArgument​
The specified argument is invalid.​
指定的参数不合法。​
400​
InvalidClientToken.Malformed​
The specified ClientToken is malformed.​
指定的ClientToken不合法。​
400​
InvalidDedicatedHostStatus.Unsupported​
The status of the specified dedicated host does not support this request.​
当前专有宿主机的状态不支持此操作。​
400​
InvalidImageForReplaceSystemVolume.UnSupported​
The specified image cannot be used for ReplaceSystemVolume.​
指定的镜像不支持更换操作系统。​
400​
InvalidImageSize.Malformed​
The specified ImageSize is malformed.​
指定的镜像大小不合法。​
400​
InvalidInstanceForReplaceSystemVolume.Unsupported​
The specified instance cannot be used for ReplaceSystemVolume.​
指定的实例不支持更换操作系统。​
400​
InvalidInstanceStatus​
The status of the specified instance does not support this request.​
当前实例的状态不支持此操作。​
400​
InvalidKeyPairForWindows.Unsupported​
The OSType of this specified instance is Windows, which does not support key pairs.​
指定的实例是Windows操作系统,不支持密钥对。​
400​
InvalidPassword.Malformed​
The specified password is malformed.​
指定的密码格式不合法。​
400​
InvalidSnapshotStatus​
The status of the specified snapshot does not support this request.​
指定的快照状态不支持此操作。​
400​
InvalidVolumeAffinity.Malformed​
The specified VolumeAffinity is malformed.​
指定的云盘亲和性不合法。​
400​
InvalidVolumeDescriptionFormat.Malformed​
The specified VolumeDescriptionFormat is malformed.​
指定的云盘描述格式不合法。​
400​
InvalidVolumeDescriptionLen.Malformed​
The specified VolumeDescriptionLen is malformed.​
指定的云盘描述长度不合法。​
400​
InvalidVolumeKind.Malformed​
The specified VolumeKind is malformed.​
指定的云盘属性不合法。​
400​
InvalidVolumeNameFormat.Malformed​
The specified VolumeNameFormat is malformed.​
指定的云盘名称格式不合法。​
400​
InvalidVolumeNameLen.Malformed​
The specified VolumeNameLen is malformed.​
指定的云盘名称长度不合法。​
400​
InvalidVolumeStatus​
The status of the specified volume does not support this request.​
当前云盘状态不支持此操作。​
400​
InvalidVolumeTypeForSnapshot.UnSupported​
The specified VolumeType cannot be used for create snapshot.​
指定的云盘类型不支持快照。​
400​
LimitExceeded.MaximumVolumes​
You've reached the limit on the number of volumes that can be attached to the instance.​
指定的实例挂载云盘数量超过最大限制。​
400​
LimitExceeded.SystemVolumeSize​
The specified system volume size exceeds the limit.​
指定的系统盘大小(GiB)超出限制。​
400​
MissingParameter.ImageId​
The required parameter ImageId is not supplied.​
镜像ID不能为空。​
400​
MissingParameter.InstanceId​
The required parameter InstanceId is not supplied.​
参数实例ID不能为空。​
400​
MissingParameter.PasswordAndKeyPair​
The required parameter PasswordAndKeyPair is not supplied.​
密码与密钥对不允许同时为空。​
400​
MissingParameter.VolumeName​
The required parameter VolumeName is not supplied.​
云盘名称不能为空。​
400​
MissingParameter.VolumeType​
The required parameter VolumeType is not supplied.​
云盘类型不能为空。​
403​
InvalidInstance.RequestForbidden​
Request is forbidden by the server.​
由于您的账户违反了相关规定,指定的资源已不再可以使用,如需恢复服务请提交工单联系服务人员处理。​
404​
InvalidImage.NotFound​
The specified image does not exist.​
指定的镜像不存在。​
404​
InvalidInstance.NotFound​
The specified instance does not exist.​
指定的实例不存在。​
404​
InvalidKeyPair.NotFound​
The specified KeyPair does not exist.​
指定的密钥对不存在。​
404​
InvalidVolume.NotFound​
The specified volume does not exist.​
指定的云盘不存在。​
412​
DryRunOperation​
Your request has been validated by the DryRunOperation.​
通过“DryRun”校验,您的请求已通过验证。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
先前的幂等请求仍在处理中,请稍后重试。​
412​
InvalidDedicatedHost.Expired​
The specified dedicated host has expired.​
专有宿主机已过期。​
412​
InvalidImage.HostnameMismatch​
The hostname of the current instance can not be applied to the image you choose.​
实例的主机名不适用于您选择的镜像。​
412​
InvalidImage.InstanceTypeMismatch​
The specified image and instance type do not match.​
指定的镜像不支持指定的实例规格。​
412​
InvalidImageId.KeepImageCredentialMismatch​
The specified ImageId and KeepImageCredential do not match.​
指定的ImageId和KeepImageCredential不匹配。​
412​
InvalidInstance.Expired​
The specified instance has expired.​
实例已过期。​
412​
InvalidKeyPairName.KeepImageCredentialMismatch​
The specified KeyPairName and KeepImageCredential do not match.​
指定的KeyPairName和KeepImageCredential不匹配。​
412​
InvalidPassword.KeepImageCredentialMismatch​
The specified Password and KeepImageCredential do not match.​
指定的Password和KeepImageCredential不匹配。​
412​
InvalidSnapshotZoneId.Mismatch​
The specified ZoneId does not match the snapshot ZoneId.​
指定的ZoneId与快照ZoneId不匹配。​
412​
InvalidVolumeSize.ImageSizeMismatch​
The specified system disk size is smaller than the image file size.​
指定系统盘容量小于镜像文件大小。​
412​
InvalidVolumeType.ImageMismatch​
The specified VolumeType and Image do not match.​
指定的云盘类型和镜像不匹配。​
412​
OperationDenied.InstanceIsCreatingImage​
The specified operation is denied as your instance is creating image.​
指定的操作被拒绝,因为该实例正在创建自定义镜像。​
412​
OperationDenied.ResourceCreatedByOtherService​
The specified operation is denied as your resource is created by other service. You can check system tags to find the service.​
指定的操作被拒绝,因为您的资源被其他服务创建。您可以通过资源的系统标签查询对应服务。​
412​
OperationDenied.ResourceLocked​
The specified operation is denied as your resource is locked for another operation.​
指定的操作被拒绝,因为您的资源已被其他操作锁定。​
500​
InternalError​
An internal error has occurred.​
内部错误,请重试。如果多次尝试失败,请提交工单。​
​
​
最近更新时间:2025.12.30 10:06:52
这个页面对您有帮助吗?
有用
有用
无用
无用