全部文档
当前文档

暂无内容

如果没有找到您期望的内容,请尝试其他搜索词

文档中心

创建实例

请求参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数
参数名称
类型
必填
描述
Action String
公共参数,本接口取值:RunInstances。
Version String
公共参数,本接口取值:2016-03-04。
ImageId String

镜像ID

示例值:标准UUID格式,形如`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`
DedicatedHostId String

专属宿主机ID

InstanceType String

实例套餐类型

示例值: DVM1.NONE,DVM2.NONE
DataDiskGb Int

数据卷容量,单位GB

MaxCount Int

最大实例数,如果指定的实例数大于金山云在本人Region所能创建的最大实例数,则会创建大于MinCount数量的最大允许实例数。

示例值: 最小值1,最大值为**当前用户实例剩余配额**
MinCount Int

最小实例数,如果指定的实例数大于金山云在本Region所能创建的最大实例数,则不会创建任何实例。

示例值: 最小值1,最大值为**当前用户实例剩余配额**
SubnetId String

VPC环境下的子网ID,绑定到主网卡

示例值:标准UUID格式,形如`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`
InstancePassword String

实例开机密码

示例值:最短8字符,最长32字符,必须包含大小写英文字符和数字,支持其他可见字符
ChargeType String

调用时需要明确指定,无默认值

示例值:Monthly(包年包月)、Daily(按量付费(按日月结))、 HourlyInstantSettlement(按量付费(按小时月结))
PurchaseTime Int

购买时长,单位月

示例值:当计费类型为Monthly(包年包月)时,有效值1-36;其他计费类型时,强制要求参数值为0
SecurityGroupId.N String

实例绑定的安全组,目前仅支持绑定一个安全组

示例值:标准UUID格式,形如`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`
PrivateIpAddress String

私有IP地址,指定子网IP地址范围内的任意有效值,代表实例的主IP地址,只能选择一个,绑定到主网卡;如果未指定该参数,系统自动从有效地址池中随机选取一个

示例值:标准IP地址格式
InstanceName String

实例名称,如果未指定,则自动生成,形如KSC-IN-[A-Z0-9]{10}

示例值:最短2字符,最长64字符,支持中英文
InstanceNameSuffix String

实例名称后缀,InstanceName参数如果缺省,此参数不生效;当大于1台的批量创建主机,后缀编号自动+1,例如后缀输入5,主机名输入"host",批量3台,则生成的三台主机名分别为:"host-5"、"host-6"、"host-7";

示例值:0到9999
默认值:空
ProjectId Long

实例所属项目ID

示例值:账户有权限的项目ID,0为默认项目
默认值:默认项目
DataDisk.N Object

数据盘是否随实例释放

示例值:
默认值:false
DeleteWithInstance Boolean

数据盘是否随实例释放

示例值:
Type String

数据盘类型

Size Int

数据盘大小

SnapshotId String

创建云盘所用的快照

示例值:479ede4b-8b15-49d6-8d10-bc64f2c78831
NetworkInterface.N Object

辅网卡

SubnetId String

辅网卡的子网id不创建辅网卡时非必填,创建辅网卡时必填

SecurityGroupId.N String

辅网卡的安全组id不创建辅网卡时非必填,创建辅网卡时必填

PrivateIpAddress String

辅网卡的内网ip,创建辅网卡传了按传的ip开机,不传自动分配

UserData String

用户自定义数据

SystemDisk Object

系统盘

DiskType String

系统盘类型

DiskSize Int

系统盘大小

ModelId String

实例启动模版ID,如填写了此项,则启动模板中已包含的RunInstances其他参数不生效,启动模板未指定的参数若调用RunInstances时额外传入则可生效,如果批量创建,实例名称后缀依然存在。【传modelId,使用默认版本。传modelId和modelVersion,使用传递的版本】
示例值:3f0d6229-ed2d-4c9c-8554-b9433517cf8b

示例值:3f0d6229-ed2d-4c9c-8554-b9433517cf8b
ModelVersion Long

实例启动模板版本号。如不指定,则采用默认版本号

示例值:3
AssembledImageDataDiskType String

整机镜像所开云盘数据盘的类型

示例值:SSD3.0
默认值:SSD3.0
AutoCreateEbs Boolean

整机镜像是否展开镜像中的数据盘

示例值:false
默认值:true
LineId String

弹性IP的链路类型的ID

AddressBandWidth Int

弹性IP的带宽,1,如果购买EIP,AddressBandWidth、LineId、AddressChargeType三个接口参数必须同时存在,如有其中任意一个接口参数,判断是否存在其他两个参数;2,如果选择预付费计费方式,必须有购买时长参数; |

AddressChargeType String

PrePaidByMonth :包年包月,有到期时间,只能升带宽;PostPaidByPeak:按峰值月结,无到期时间,可升降带宽;PostPaidByDay:按日月结,无到期时间,可升降带宽;PostPaidByTransfer:按流量月结,无到期时间,可升降带宽;PostPaidByHour:按小时月结,无到期时间,可升降带宽

AddressProjectId String

弹性IP项目的ID,默认值为0

BandWidthShareId String

共享带宽ID

AddressPurchaseTime Int

购买时长

KeyId.N String

秘钥ID

KeepImageLogin Boolean

是否保留镜像设置

HostName String

操作系统内部的计算机名

HostNameSuffix Int

创建多台实例时为HostName增加有序后缀,有序后缀从1增加,例如host-1

FailureAutoDelete Boolean

开机失败是否对外删除 ,默认值是false

Tag.N Object

标签信息

Key String

标签键值

Id Long

标签Id

Value String

标签值

DataGuardId String

容灾组id

InstanceConfigure Object
VCPU String

cpu

MemoryGb String

内存

DataDiskGb String

数据卷容量,单位GB

SriovNetSupport Boolean

是否支持联网增强

DistributeIpv6 Boolean

是否分配ipv6

LocalVolumeSnapshotId String

本地盘快照id

SyncTag Boolean

是否同步ebs标签

IamRoleName String

iam角色名称

AutoDeleteTime String

定时删除时间

AutoDeleteEip Boolean

是否自动删除eip

IsProtect Boolean

是否开启资源保护

返回参数

参数名称
类型
描述
RequestId String
示例值:a831f245-2694-47de-a417-a5e7d8b250f1012
InstancesSet Object[]
InstanceId String
示例值:2d6234da-d9b7-4d54-bd1a-63fe343a5879
InstanceName String
示例值:xytest2

请求示例

curl -X GET|POST
'http://kec.api.ksyun.com/?Action=RunInstances&Version=2016-03-04'
-H 'authorization: xxx, SignedHeaders=content-type;host;x-amz-date, Signature=xxx'
-H 'cache-control: no-cache'
-H 'content-type: application/x-www-form-urlencoded'
-H 'host: kec.api.ksyun.com'
-H 'x-amz-date: 20170720T022802Z'
-d 'ImageId=xxx&DedicatedHostId=xxx&InstanceType=xxx&DataDiskGb=xxx&MaxCount=xxx&MinCount=xxx&SubnetId=xxx&InstancePassword=xxx&ChargeType=xxx&PurchaseTime=xxx&SecurityGroupId.N=xxx&PrivateIpAddress=xxx&InstanceName=xxx&InstanceNameSuffix=空&ProjectId=默认项目&DataDisk.N.DeleteWithInstance=xxx&DataDisk.N.Type=xxx&DataDisk.N.Size=xxx&DataDisk.N.SnapshotId=xxx&NetworkInterface.N.SubnetId=xxx&NetworkInterface.N.SecurityGroupId.N=xxx&NetworkInterface.N.PrivateIpAddress=xxx&UserData=xxx&SystemDisk.DiskType=xxx&SystemDisk.DiskSize=xxx&ModelId=xxx&ModelVersion=xxx&AssembledImageDataDiskType=SSD3.0&AutoCreateEbs=true&LineId=xxx&AddressBandWidth=xxx&AddressChargeType=xxx&AddressProjectId=xxx&BandWidthShareId=xxx&AddressPurchaseTime=xxx&KeyId.N=xxx&KeepImageLogin=xxx&HostName=xxx&HostNameSuffix=xxx&FailureAutoDelete=xxx&Tag.N.Key=xxx&Tag.N.Id=xxx&Tag.N.Value=xxx&DataGuardId=xxx&InstanceConfigure.VCPU=xxx&InstanceConfigure.MemoryGb=xxx&InstanceConfigure.DataDiskGb=xxx&SriovNetSupport=xxx&DistributeIpv6=xxx&LocalVolumeSnapshotId=xxx&SyncTag=xxx&IamRoleName=xxx&AutoDeleteTime=xxx&AutoDeleteEip=xxx&IsProtect=xxx'

返回示例

JSON格式

{
"RequestId":"a831f245-2694-47de-a417-a5e7d8b250f1012",
"InstancesSet":[
{
"InstanceId":"2d6234da-d9b7-4d54-bd1a-63fe343a5879",
"InstanceName":"xytest2"
}
]
}

错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码

错误码
错误信息
Http状态码
描述
InvalidParameter.ModelIdNotExistInvalidParameter.ModelIdNotExist400模版ID不正确
ModelVersionLimitExceedThe time of modified templates has reached the limit.400修改模板次数已达上限
SecurityGroupIdRequiredSecurityGroupId is required400SecurityGroupId必传
ImageIdInvalidParameterValueAn invalid or out-of-range value was supplied for the "ImageId" parameter.400“镜像ID”参数的取值无效或者超出有效范围
SubnetInvalidParameterValueAn invalid or out-of-range value was supplied for the "Subnet"([{0}]) parameter.400“子网”([{0}])参数的取值无效或者超出有效范围
CheckVMCountWhen the specified MAC address is turned on, the values of maxcount and mincount can only be 1.400指定mac地址开机时,MaxCount 与 MinCount 的值均只能为1
CheckMacAddressThe Mac address format of the input is incorrect.400输入的主网卡mac地址内容格式不正确
InstanceTypeNoneInvalidCreate or upgrade does not support non-standard instancetype.400创建、升配不支持非标套餐.
InstanceOrderMustInUseThe "InstanceOrder" parameter must be used when calling directly from console.400使用控制台调用必须传递“实例订单”参数
InstanceOrderNotInUseThe "InstanceOrder" parameter should not be used when calling directly from SDK or OpCenter.400使用SDK或者运营平台调用不应该传递“实例订单”参数
MaxCountGreatSubOrdersMax_count must equal vmSubOrders.400创建最大数量必须等于虚机的子订单数
VMCountNotConsistentWithDataGuardCount暂无解释400暂无解释
InstanceTypeInvalidParameterValueAn invalid or out-of-range value was supplied for the "InstanceType" parameter.400“实例套餐类型”参数的取值无效或者超出有效范围
ProductTypeNotSupportSnapshotThe specified instance type does not support using snapshot to create disk.400该实例类型不支持快照开盘
ChargeTypeInvalidParameterValueAn invalid or out-of-range value was supplied for the "ChargeType" parameter400“计费类型”参数的取值无效或者超出有效范围
PurchaseTimeInvalidParameterValueAn invalid or out-of-range value was supplied for the "PurchaseTime" parameter.400“购买时长”参数的取值无效或者超出有效范围
MinCountNotMoreThanMaxCountThe value of "MinCount" parameter should be no more than that of "MaxCount" parameter400“最小实例数”参数的取值不应超出“最大实例数”参数的取值
BindingEBSTypeInvalidParameterValuebinding EBS type is required.400EBS盘类型不允许为空
DiskDataPerformanceModeThe specified types of ESSD disks can not be attached to one instance in the meantime.400暂不支持单实例同时挂载选中的多类型的极速云盘
DataGuardIdInvalidDataGuardId is invalid400容灾分组ID无效
VMNotSupportAddDamainDataGuard暂无解释400暂无解释
ProductTypeNotSupportDataGuard暂无解释400暂无解释
ProductPermissionDeniedThis package can not be used400用户不能使用该套餐
DamainDataGuardNotSupportSpot暂无解释400暂无解释
SnapshotServiceArrearsYour snapshot charge is overdue, please renew it.400您的账号已欠费,请先充值.
SnapshotServiceStoppedYour snapshot service has been stopped. Please contact customer service.400您的快照服务已关停,如需开通请联系金山云客服
SnapshotServiceRecyclingYour snapshot resources are recycled. Please contact customer service.400您的快照资源已被回收,如有疑问请提工单或联系金山云客服
SnapshotServiceNotOpenedSnapshot service is not ordered. Please go to the console to enable the snapshot service.400快照服务未开通, 请登录控制台界面快照列表开通快照服务.
SnapshotTypeInvalidParameterValueThe specified snapshot does not support creating images.400该快照不支持制作镜像
SnapshotSizeInvalidDataDiskSizeThe snapshot size does not match the data disk size400快照大小和数据盘大小不匹配
SnapshotStateInvalidParameterValue暂无解释400暂无解释
SubnetNotInTheSameAvailabilityZoneThe Subnets are not in the same availability Zone.400网卡信息不在同一个可用区下,请重新填写
SecurityGroupInvalidParameterValueAn invalid or out-of-range value was supplied for the "SecurityGroupId"([{0}]) parameter.400“安全组”([{0}]) 参数的取值无效或者超出有效范围
PrivateIpAddressDuplicateThe specified IP of the ENIs is duplicated. Please modify.400网卡指定IP重复,请修改
SubnetIsNotNormalSubnet type must be Normal400选择的子网的类型必须是普通子网
PrivateIPEqualsGatewayIPPrivateIpAddress is not allowed to equal Subnet's gateway ip400PrivateIpAddress不允许等于子网的网关IP
PrivateIPNotMatchDhcpPrivateIpAddress exceeds Subnet's DHCP Range400PrivateIpAddress超过子网设置的DHCP范围
SubnetInvalidParameterValueAn invalid or out-of-range value was supplied for the "Subnet"([{0}]) parameter.400“子网”([{0}])参数的取值无效或者超出有效范围
SubnetAndSecurityGroupNotInTheSameVPCThe SubnetId and SecurityGroupId are not in the same VPC.400所选 SubnetId 与 SecurityGroupId 不在同一个VPC下,请重新填写。
VolumeSnapshotIdInvalidParameterValueVolume snapshot id is invalid400磁盘快照ID参数不正确
VolumeSnapshotESSDTypeErrorParameterValueThe specified snapshot can not be used to create the disk of this type.400暂不支持此类型快照创建此类型数据盘
SnapshotDiskTypeNotSupportParamDiskTypeThe disk type of the local snapshot does not match the disk type of the parameter400本地快照的盘类型和参数的盘类型不匹配
SnapshotZoneNotSupportParamZoneThe availability of the local snapshot does not match the parameters or subnet availability400本地快照的可用区和参数或者子网可用区不匹配
VolumeSnapshotESSDTypeErrorParameterValueThe specified snapshot can not be used to create the disk of this type.400暂不支持此类型快照创建此类型数据盘
InsufficientInventoryInsufficient inventory or user's spot instances exceed the maximum number.400库存不足或超过竞价实例可开最大数量
IamRoleNotSupportKecInstanceThe IAM role was not support for the Kec Insrance.400指定的 IAM 角色没有授权。
IamRoleNotFoundThe IAM role was not found.400指定的IAM角色不存在
NoPermissionCreationOptimizationYour account does not support RunOptimized creation.400您的账号不支持批量开机优化功能
DiskTypeNotSupportOptimisedProductPermissionDeniedDisk type does not support optimised.400磁盘类型不支持optimised
MoreThanNetworkInterfaceQuotaThe current package only supports {0} ENIs. Please reduce the number of ENIs400当前套餐只支持挂载{0}块网卡,请减少网卡数量
ProductSellOutInvalidproduct is already sold out.400此商品在该机房已售罄.
SpotPriceLimitCanNotNullThe parameter "SpotPriceLimit" can not null when the SpotStrategy is SpotWithPriceLimit.400当竞价实例的抢占策略为SpotWithPriceLimit时,参数“SpotPriceLimit”不允许为空
SpotPriceLimitInvalidAn invalid or out-of-range value was supplied for the "SpotPriceLimit" parameter.400“SpotPriceLimit”参数的取值无效或者超出有效值范围
SpotStrategyInvalidAn invalid or out-of-range value was supplied for the "SpotStrategy" parameter.400“SpotStrategy” 参数的取值无效或者超出有效值范围
SpotStrategyAndSpotPriceLimitNotAllowIt does not support the parameters "SpotPriceLimit" and "SpotStrategy" when the billType is not spot.400非竞价实例计费类型不支持参数 “SpotPriceLimit” 和 “SpotStrategy”
EbsSystemDiskProductSellOutInvalidebs system disk [{0}] product already sold out.400此ebs系统盘[{0}]商品在该机房已售罄.
BindingEBSSizeInvalidParameterValuebinding EBS size is required.400EBS盘大小不允许为空
EbsProductPermissionDeniedThe EBS package can not be used400用户不能使用该EBS套餐
InstanceTypeNotSupportBindingEBSinstance type does not support binding EBS.400实例类型不支持绑定ebs数据盘
BindingEBSNumberInvalidbinding EBS number is invalid.400超过实例绑定ebs数据盘数量限制
BindingEBSSizeParamInvalidThe size of the EBS disk out-of-range, should be [{0} - {1}], and the multiple of [{2}].400EBS数据盘大小超出有效范围:[{0} - {1}],且为[{2}]的倍数。
CreateEBSProductErrorCreate EBS product fail [{0}].400创建ebs商品失败[{0}]
AddressBandWidthRequiredAddressBandWidth is not set.400没有设置弹性IP带宽
EipNotAllowAttachThe current user is not allowed to bind EIP. Please contact customer service.400当前用户不允许绑定eip请联系客服
EipDailyQuotaExceedThe number of daily EIPs is insufficient.400弹性ip 的数量超过您账号的额度限制,若需调整限额请提工单
EipAccountQuotaExceedElastic IP address quota exceeded.400弹性ip 的数量超过您今日可购买限额,若需调整限额请提工单
AddressPurchaseTimeRequiredThe current billing method is prepaid. Please set the purchase time.400计费方式为包年包月,没有设置购买时长
AddressPurchaseTimeInvalidParameterValueAn invalid or out-of-range value was supplied for the "AddressPurchaseTime" parameter.400“购买时长”参数的取值无效或者超出有效范围
ProjectMemberNotExistUser is not a member of Project [{0}]400当前用户并不在项目[{0}]中
AddressBandWidthInvalidParameterValueAn invalid or out-of-range value was supplied for the "AddressBandWidth" parameter.400“弹性IP的带宽”参数的取值无效或者超出有效范围
PaymentCreateProductFailedcreate product failed400创建商品失败
SystemDiskTypeInvalidAn invalid or out-of-range value was supplied for the "SystemDisk.DiskType" parameter.400“系统盘类型”参数的取值无效或者超出有效范围.
InstanceIdInvalidThe instance Resource id is invalid400实例资源ID无效
RootDiskSizeLessThanImageSizeRootDiskSizeLessThanImageSize400系统盘容量不能小于镜像最小需求容量或者缺省容量
VMCountGreaterThanDataGuardCountCreate instance fail, because Data Guard Groups ({0}) has insufficient room400创建失败,容灾组({0})的可用容量不足,请选择其他容灾组
NotSufficientFundsNotSufficientFunds400余额不足,支付失败
RockyLinuxOnlySupport2048ForRsaKeyThe specified image only support RSA 2048 bit key pair.400该镜像类型仅支持RSA 2048位的密钥
InternalErrorThe request processing has failed due to some unknown error.400内部错误,请重试。
LocalImageOnlySupportSSD3ForCreateInstanceTo create an instance by local image, you must use SSD EBS 3.0 volumes as system and data disks which associated with the image.400使用本地镜像创建实例,镜像关联的系统盘和数据盘仅支持ssd3.0
SecurityGroupIdLimitExceededThe number of security groups has reached the limit 5400安全组数量已达到上限{0}
SubnetAndPrivateIpAddressNotMatchPrivate ip address is not in the sub network IP range or has been used400私网IP不在子网的IP范围内或者已经被占用
403001价格体系-无使用该计费方式的权限400价格体系-无使用该计费方式的权限
400001价格体系-产品类型不支持该计费方式400价格体系-产品类型不支持该计费方式
AvailableIpNumberNotEnough系统盘容量不能小于镜像最小需求容量或者缺省容量400系统盘容量不能小于镜像最小需求容量或者缺省容量
TrustCanNotAttachEipInstance under Trust VPC are not allowed to attach EIP.400互信vpc下的云主机不允许绑定eip
ImageTypeNotSupportedCloudInitThe ImageType for this not supported CloudInit400该镜像类型不支持CloudInit
ImageSizeNotSupportInstanceTypeImageSizeNotSupportInstanceType400镜像需求容量大于当前机型支持的系统盘容量
ImageTypeOnlySupportedKeepImageLoginThe ImageType for this only supported keepImageLogin400该镜像类型仅支持保留镜像设置
ImageModeAdaptThe speficied instance type does not support the specified image's boot mode400当前机型不支持所选镜像的启动模式
纯净模式常规模式

纯净模式

点击可全屏预览文档内容