最近更新时间:2023.09.08 18:00:17
首次发布时间:2021.10.31 07:37:16
调用 RunInstances 接口创建一台或多台云服务器实例。
说明
ImageId
参数传入目标整机镜像ID,操作详情可查看使用整机镜像购买实例。名称 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | RunInstances | 要执行的操作,取值: RunInstances。 |
Version | String | 是 | 2020-04-01 | API的版本,取值:2020-04-01。 |
ZoneId | String | 是 | cn-beijing-a | 实例所在可用区ID,您可以调用DescribeZones查询一个地域下的可用区信息。 |
ImageId | String | 是 | image-3tefr6wgx63vj0****** | 启动实例时使用的镜像ID,您可以通过DescribeImages查询可以使用的镜像资源。 |
InstanceTypeId | String | 是 | ecs.g1ie.xlarge | 实例的规格。
|
InstanceName | String | 是 | instance-test | 实例的名称。
说明
|
Description | String | 否 | 用于测试的云服务器实例 | 实例的描述,默认为空字符串。
|
Hostname | String | 否 | instance-host-name | 实例主机名,即实例操作系统内部的计算机名。
如不填,则遵循以下规则自动生成:
说明 批量创建实例时,支持使用 |
UniqueSuffix | Boolean | 否 | false | 表示当创建多台实例时,是否为
说明
|
SuffixIndex | Integer | 否 | 1 | 有序后缀的起始序号,取值范围:1~999,默认为1。 |
Count | Integer | 否 | 1 | 创建数量,取值范围:1~100;传入0时,会默认为1。 |
MinCount | Integer | 否 | 2 | 指定ECS实例最小创建数量,取值范围:1~100。
|
DryRun | Boolean | 否 | false | 是否只预检此次请求,取值:
|
Password | String | 否 | password@123 | 使用“密码”方式登录实例时,请设置root登录密码:
说明 登录凭证支持“密码”、“密钥对”、“保留镜像设置”三种方式,使用“密码”方式登录实例时,建议增加密码复杂度以提高安全性。 |
KeyPairName | String | 否 | kp-test-123 | 使用“SSH密钥对”登录实例时,请输入密钥对的名称。 说明 如果同时设置了密钥对 |
KeepImageCredential | Boolean | 否 | true | 是否保留镜像设置,取值:
说明
|
InstallRunCommandAgent | Boolean | 否 | false | 创建实例时是否安装批量作业Agent,取值:
|
Volumes.N.VolumeType | String | 否 | Volumes.1.VolumeType=ESSD_PL0&Volumes.2.VolumeType=ESSD_PL0 | 云盘的类型,取值:
说明
|
Volumes.N.Size | Integer | 是 | Volumes.1.Size=100&Volumes.2.Size=100 | 云盘的容量,单位为GiB,取值:
说明
|
Volumes.N.DeleteWithInstance | Boolean | 否 | Volumes.1. | 云盘是否随实例释放,取值:
说明
|
NetworkInterfaces.N.SubnetId | String | 是 | NetworkInterfaces.1.SubnetId=subnet-3tispp1nai4e8i******& NetworkInterfaces.2.SubnetId=subnet-2ff1nczrx2lts5oxru****** | 实例的私有网络子网ID,创建实例时,支持同时绑定辅助网卡。
|
NetworkInterfaces.N.SecurityGroupIds.N | String | 是 | NetworkInterfaces.1.SecurityGroupIds.1=sg-3ti78x9h8t4bw*****& NetworkInterfaces.2.SecurityGroupIds.1=sg-3cj59ih2v9hj46c6rr****** | 网卡关联的安全组ID。
|
InstanceChargeType | String | 否 | PostPaid | 实例和云盘的计费类型,取值:
|
SpotStrategy | String | 否 | NoSpot | 按量计费实例的抢占式策略,取值:
说明
|
SpotPriceLimit | Float32 | 否 | 0.78 | 抢占式实例的每小时最高价格,支持最大3位小数。 说明 仅当 |
CreditSpecification | String | 否 | Standard | 突发性能实例的运行模式,取值: 说明
|
SecurityEnhancementStrategy | String | 否 | Active | 是否开启安全加固,取值: |
HpcClusterId | String | 否 | hpcCluster-1 | 当创建高性能计算GPU型实例时,请指定高性能计算集群ID。 |
UserData | String | 否 | ZWNobyBoZWxsbyBlY3Mh | 实例自定义数据。设置的自定义数据必须经过Base64编码,且Base64编码前的自定义数据大小不能超过16KB。 说明 不填则默认为空。 |
Period | Integer | 否 | 12 | 购买资源的时长(月),取值: 说明 仅当参数 |
PeriodUnit | String | 否 | Month | 购买资源的时长单位,取值:Month。 说明 仅当 |
AutoRenew | Boolean | 否 | true | 实例到期后是否自动续费。
说明 仅当参数 |
AutoRenewPeriod | Integer | 否 | 1 | 每次自动续费的时长。 说明
|
ClientToken | String | 否 | 333456899ff**** | 保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。 取值:仅支持ASCII字符,且不能超过64个字符。 |
ProjectName | String | 否 | project_a | 资源所属项目,一个资源只能归属于一个项目。
|
Tags.N.Key | String | 否 | Tags.1.Key=k1&Tags.2.Key=k2 | 用户标签的标签键。
说明 同一资源的标签键不允许重复。 |
Tags.N.Value | String | 否 | Tags.1.Value=v1&Tags.2.Value=v2 | 用户标签的标签值。
说明 如果传入该参数,则必须先传入 |
DeploymentSetId | String | 否 | dps-yc1o9aahks5m57nk**** | 实例需要加入的部署集ID。 |
DeploymentSetGroupNumber | Integer | 否 | 1 | 部署集组的序号,取值范围:1~3。
|
Placement.Tenancy | Boolean | 否 | Default | 是否在专有宿主机上创建实例,取值:
|
Placement.DedicatedHostId | String | 否 | dh-bp67acfmxazb4p**** | 实例所在的专有宿主机ID。您可以调用DescribeDedicatedHosts接口查询专有宿主机列表。 |
Placement.Affinity | String | 否 | Default | 专有宿主机实例是否与专有宿主机关联,取值:
|
Placement.DedicatedHostClusterId | String | 否 | dc-ycle6b76kgv2wrsm**** | 实例所在的专有宿主机集群ID。您可以调用DescribeDedicatedHostClusters接口查询宿主机集群ID。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
InstanceIds | List | [ "i-3tigy72q3u3vj0x2****","i-3tigy72q3u3vj0x2****" ] | 实例的ID。 |
GET /?Action=RunInstances&Version=2020-04-01&ZoneId=cn-beijing-a&ImageId=image-3tefr6wgx63vj0******&InstanceTypeId=ecs.g1ie.xlarge&InstanceName=instance-test&Count=1&Password=password@123&NetworkInterfaces.1.SubnetId=subnet-3tispp1nai4e8i****&NetworkInterfaces.1.SecurityGroupIds.1=sg-3ti78x9h8t4bw*****&Volumes.1.VolumeType=ESSD_PL0&Volumes.1.Size=40 HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing Service: ecs
{ "ResponseMetadata": { "RequestId": "2021062415303301022514515207C4****", "Action": "RunInstances", "Version": "2020-04-01", "Service": "ecs", "Region": "cn-beijing" }, "Result": { "InstanceIds": [ "i-3tigy72q3u3vj0******", "i-3tigy72q3u3vj0******" ] } }
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidVolumeType.Malformed | The specified VolumeType is malformed. | 指定的云盘类型不合法。 |
400 | InvalidProjectName | The specified ProjectName is invalid. | 指定的项目名不合法。 |
400 | InvalidArgument | The specified argument is invalid. | 指定的参数不合法。 |
400 | InvalidCount.Malformed | The specified count is malformed. | 指定的实例数目不合法。 |
400 | MissingParameter.InstanceName | The required parameter InstanceName is not supplied. | 实例名称不能为空。 |
400 | MissingParameter.ZoneId | The required parameter ZoneId is not supplied. | 可用区ID不能为空。 |
400 | MissingParameter.InstanceTypeId | The required parameter InstanceTypeId is not supplied. | 实例规格ID不能为空。 |
400 | LimitExceeded.MaximumVolumes | You've reached the limit on the number of volumes that can be attached to the instance. | 指定的实例挂载云盘数量超过最大限制。 |
400 | InvalidVolumeReleaseType.Malformed | The specified VolumeReleaseType is malformed. | 指定的云盘释放类型不合法。 |
400 | MissingParameter.NetworkInterfaces | The required parameter NetworkInterfaces is not supplied. | 网卡信息不能为空。 |
400 | LimitExceeded.MaximumSubnetIps | The number of specified subnet IP addresses exceeds the maximum limit. | 指定子网的IP地址数量已经达到最大限制。 |
400 | LimitExceeded.SystemVolumeSize | The specified system volume size exceeds the limit. | 指定的系统盘大小(GiB)超出限制。 |
400 | LimitExceeded.DataVolumeSize | The specified data volume size exceeds the limit. | 指定的数据盘大小(GiB)超出限制。 |
400 | MissingParameter.PasswordAndKeyPair | The required parameter PasswordAndKeyPair is not supplied. | 密码与密钥对不允许同时为空。 |
400 | InvalidPassword.Malformed | The specified password is malformed. | 指定的密码格式不合法。 |
400 | InvalidPeriod | The specified period is not valid. | 指定的计费周期个数不合法。 |
400 | MissingParameter.ImageId | The required parameter ImageId is not supplied. | 镜像ID不能为空。 |
400 | InvalidParameterCombination | Indicates an incorrect combination of parameters. | 参数组合错误或缺失参数。 |
400 | InvalidInstanceName.Malformed | The specified InstanceName is malformed. | 指定的实例名称不合法。 |
400 | InvalidHostname.Malformed | The specified Hostname is malformed. | 指定的主机名不合法。 |
400 | InvalidInstanceDescription.Malformed | The specified InstanceDescription is malformed. | 指定的实例描述不合法。 |
400 | InvalidInstanceChargeType | The specified InstanceChargeType is invalid. | 指定的实例计费类型不合法。 |
400 | InvalidSuffixIndex.Malformed | The specified SuffixIndex is malformed. | 指定的有序后缀不合法。 |
400 | InvalidSecurityEnhancementStrategy.Malformed | The specified SecurityEnhancementStrategy is malformed. | 指定的安全增强策略不合法。 |
400 | InvalidSecurityGroupType.Malformed | The specified SecurityGroupType is malformed. | 指定的安全组类型不合法。 |
400 | MissingParameter.SecurityGroupIds | The required parameter SecurityGroupIds is not supplied. | 安全组不能为空。 |
400 | QuotaExceeded.MaximumSecurityGroups | You've reached the limit on the number of SecurityGroups that you can create, please submit ticket to request an increase in quota. | 安全组配额不足,请提工单申请提高配额。 |
400 | InvalidUserData.Malformed | The specified UserData is malformed. | 指定的UserData不合法。 |
400 | LimitExceeded.MaximumNetworkInterfaces | You've reached the limit on the number of NetworkInterfaces that can be attached to the instance. | 指定的实例挂载网卡数量超过最大限制。 |
400 | MissingParameter.SubnetId | The required parameter SubnetId is not supplied. | 子网ID不能为空。 |
400 | Insufficient.Balance | The request is denied due to the lack of balance. | 账户余额不足。 |
400 | InvalidPeriodUnit | The specified PeriodUnit is not valid, is unsupported, or cannot be used. | 指定的计费周期不合法。 |
400 | InvalidClientToken.Malformed | The specified ClientToken is malformed. | 指定的ClientToken不合法。 |
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 | InvalidKeyPairForWindows.Unsupported | The specified windows do not support key pairs. | 指定的实例是Windows操作系统,不支持密钥对。 |
400 | QuotaExceeded.MaximumNetworkInterfaces | You've reached the limit on the number of elastic network interface that you can create, please submit ticket to request an increase in quota. | 网卡配额不足,请提工单申请提高配额。 |
400 | QuotaExceeded.MaximumSecurityGroupNetworkInterfaces | You've reached the limit on the number of SecurityGroupEnis that you can create, please submit ticket to request an increase in quota. | 安全组关联的网卡数配额不足,请提工单申请提高配额。 |
400 | QuotaExceeded.MaximumVolumes | You've reached the limit on the capacity of Volumes that you can create, please submit ticket to request an increase in quota. | 云盘配额不足,请提工单申请提高配额。 |
400 | QuotaExceeded.MaximumInstances | You've reached the limit on the number of instances that you can create, please submit ticket to request an increase in quota. | 实例数量配额不足,请提工单申请提高配额。 |
400 | QuotaExceeded.MaximumInstanceCpus | You've reached the limit on the number of instance CPU that you can create, please submit ticket to request an increase in quota. | 实例CPU数量配额不足,请提工单申请提高配额。 |
400 | InvalidMinCount.Malformed | The specified parameter MinCount is not valid. | 指定的MinCount无效,请您检查该参数是否正确。 |
400 | InvalidCreditSpecification.Malformed | The specified credit specification is malformed. | 指定的突发性能实例模式不合法。 |
400 | Insufficient.AclCapacity | You've reached the limit on the number of ACLs on the switch. | 交换机的ACL数量超过限制。 |
400 | LimitExceeded.MaximumTags | You've reached the limit on the number of tags that you can create. | 指定的标签数量超过最大限制。 |
400 | InvalidTagKey.Malformed | The specified TagKey is malformed. | 指定的标签键不合法。 |
400 | InvalidTagValue.Malformed | The specified TagValue is malformed. | 指定的标签值不合法。 |
400 | QuotaExceeded.MaximumInstanceTypeInstances | You've reached the limit on the number of instance type instances that you can create, please submit ticket to request an increase in quota. | 规格实例数量配额不足,请提工单申请提高配额。 |
400 | InvalidInstanceTypeForCreateSpotInstance.Unsupported | The specified InstanceType does not support creation of spot instances. | 指定的实例规格不支持创建抢占式实例。 |
400 | InvalidSpotStrategy.Malformed | The specified SpotStrategy is malformed. | 指定的实例抢占策略不合法。 |
400 | InvalidSpotPriceLimit.Malformed | The specified SpotPriceLimit is malformed. | 指定的实例抢占价格不合法。 |
400 | QuotaExceeded.MaximumSecurityGroupIps | You've reached the limit on the number of SecurityGroupIps that you can create, please submit ticket to request an increase in quota. | 安全组关联的IP数配额不足,请提工单申请提高配额。 |
400 | InvalidDeploymentSetGroupNumber | The specified DeploymentSetGroupNumber is invalid. | 指定的部署集组不合法。 |
400 | LimitExceeded.MaximumDeploymentSetInstances | You've reached the limit on the number of instances that can be added to the deployment set. | 指定的部署集内的实例数量超过最大限制。 |
400 | InvalidPlacementAffinity.Malformed | The specified placement affinity is malformed. | 指定的Placement.Affinity不合法。 |
400 | InvalidPlacementTenancy.Malformed | The specified placement tenancy is malformed. | 指定的Placement.Tenancy不合法。 |
404 | InvalidDedicatedHost.NotFound | The specified dedicated host does not exist. | 指定的专有宿主机不存在。 |
404 | InvalidDedicatedHostCluster.NotFound | The specified dedicated host cluster does not exist. | 指定的专有宿主机集群不存在。 |
404 | InvalidDeploymentSet.NotFound | The specified DeploymentSet does not exist. | 指定的部署集不存在。 |
404 | InvalidZone.NotFound | The specified zone does not exist. | 指定的可用区不存在。 |
404 | InvalidInstanceType.NotFound | The specified InstanceType does not exist. | 指定的实例规格不存在。 |
404 | InvalidImage.NotFound | The specified image does not exist. | 指定的镜像不存在。 |
404 | InvalidSecurityGroup.NotFound | The specified SecurityGroup does not exist. | 指定的安全组不存在。 |
404 | InvalidSubnet.NotFound | The specified subnet does not exist. | 指定的子网不存在。 |
404 | InvalidKeyPair.NotFound | The specified KeyPair does not exist. | 指定的密钥对不存在。 |
404 | InvalidProject.NotFound | The specified Project does not exist. | 指定的项目不存在。 |
409 | InvalidNetworkInterfacesVpc.Conflict | Multiple vpcs are not supported for instances in the same HpcCluster. | 同一高性能集群下的RDMA实例不支持设置多个VPC。 |
409 | InvalidTagKey.Conflict | The specified TagKey already exists. | 指定的标签键已存在。 |
412 | InvalidVolumeSize.ImageSizeMismatch | The specified system disk size is smaller than the image file size. | 指定系统盘容量小于镜像文件大小。 |
412 | InvalidSubnet.ZoneMismatch | The specified subnet and instance are in different Availability Zones. | 子网与实例不属于同一个可用区。 |
412 | InvalidVolumeType.InstanceTypeMismatch | The specified VolumeType and InstanceType do not match. | 云盘类型和实例规格不匹配。 |
412 | InvalidSecurityGroup.SubnetMismatch | The specified SecurityGroup and Subnet do not match. | 安全组与子网的私有网络不匹配。 |
412 | IdempotentProcessing | The request uses the same client token as a previous one that is still in process. | 先前的幂等请求仍在处理中,请稍后重试。 |
412 | InvalidVolumeType.ImageMismatch | The specified VolumeType and Image do not match. | 指定的云盘类型和镜像不匹配。 |
412 | InvalidHpcCluster.ZoneMismatch | The specified HpcCluster and Instance's ZoneId do not match. | 高性能集群不在实例可用区的范围。 |
412 | DryRunOperation | Your request has been validated by the DryRunOperation. | 通过“DryRun”校验,您的请求已通过验证。 |
412 | InvalidCreditSpecification.InstanceTypeIdMismatch | The specified credit specification and instance type id do not match. | 指定的突发性能实例模式与实例规格不匹配。 |
412 | InvalidImageId.KeepImageCredentialMismatch | The specified ImageId and KeepImageCredential do not match. | 指定的ImageId和KeepImageCredential不匹配。 |
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 | InvalidVolumeTypes.Mismatch | Mismatch between attached Volume types. | 挂载的云盘类型相互不匹配。 |
412 | InvalidInstanceTypeId.DeploymentSetIdMismatch | The specified instance type id and deployment set id do not match. | 实例规格不支持加入部署集。 |
412 | InvalidImage.InstanceTypeMismatch | The specified image and instance type do not match. | 指定的镜像不支持指定的实例规格。 |
412 | InvalidInstanceType.ImageMismatch | The specified InstanceType and Image do not match. | 指定的实例规格和镜像不匹配。 |
412 | InvalidDedicatedHost.InstanceTypeIdMismatch | The specified DedicatedHostId does not match InstanceTypeId. | 指定的专有宿主机ID与实例规格不匹配。 |
412 | InvalidTenancy.DedicatedHostIdMismatch | The specified Tenancy does not match DedicatedHostId. | 指定的Tenancy与专有宿主机ID不匹配。 |
412 | InvalidDedicatedHostClusterId.DedicatedHostIdMismatch | The specified DedicatedHostClusterId does not match DedicatedHostId. | 指定的专有宿主机集群与专有宿主机不匹配。 |
429 | FlowLimitExceeded | You've reach the limit on request rate of resources. | 您已超过资源请求限速,请稍后重试。 |
500 | Insufficient.InstanceCapacity | There is not enough capacity to fulfill your request. | 当前资源不足,请稍后重试或选择其它实例规格。 |
500 | Insufficient.VolumePoolCapacity | There is not enough capacity to fulfill your request. | 当前存储池容量不足。 |
500 | InternalError | An internal error has occurred. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |