CreateInstance

Last Updated: Sep 19, 2017

Description

When creating an elastic compute instance according to input parameters, consider the following.

Instance types

  • When you create an instance, you can choose an I/O optimized instance or not.
  • Once an instance is created with ephemeral SSDs, the instance type cannot be changed after the instance is created.

Images

  • When creating an instance, you must select an image to determine the system disk configuration. An image contains operating system and application software configuration. After an instance is created based on an image, the instance system disk is a clone of that image.
  • If the instance memory is 512 MB, Windows OS is not supported.
  • If the instance memory is 4 GB or larger, a 32-bit OS is not supported.

Network service

  • To create an instance for a VPC network, you must specify the VPC network and a vSwitch when creating the instance. One instance can only belong to one vSwitch.

  • If a VSwitchId is specified for creating an instance, SecurityGroupId and VSwitchId must belong to one VPC.

  • If both VSwitchId and PrivateIpAddress are specified, PrivateIpAddress must be within CidrBlock of the vSwitch.

  • PrivateIpAddress depends on VSwitchId and cannot be specified separately.

Security groups

  • When you create an instance, you must specify the security group of the instance.

  • The security group must be created in advance by using the CreateSecurityGroup interface.

  • You can specify the security group when creating the instance and change the instance security group by using the ModifyInstanceAttribute interface.

  • Mutual access is allowed between instances in the same security group in the intranet. By default, firewalls are deployed between security groups, and mutual access between security groups is disabled. However, security group firewall permissions can be set through security group authorization (by using the interface for granting security group permissions).

  • The maximum number of instances in one security group is 1,000. If the security group exceeds this limit, an error message is displayed.

Storage

  • During instance creation, the system allocates an appropriate sized system disk for the instance based on the image specified by the user. The system disk category can also be specified: Basic cloud disk (cloud), ultra cloud disk (cloud_efficiency), SSD cloud disk (cloud_ssd), and ephemeral SSD (ephemeral_ssd). You must be authorized to create ephemeral SSDs. By default, new users are not authorized.

  • When an I/O optimized instance is selected, the system disk can select only ultra cloud disk (cloud_efficiency) or SSD cloud disk (cloud_ssd).

  • ECS does not allow users to separately create or add an ephemeral SSD. Therefore, the ephemeral SSD must be specified during instance creation. For disk category and size restrictions for different instance type, see Instance generations and type families.

  • The maximum capacity of cloud disks varies according to disk categories:

    • A single basic cloud disk (cloud) cannot exceed 2,000 GB.
    • A single ultra cloud disk (cloud_efficiency) cannot exceed 32 TB (32,768 GB).
    • A single SSD cloud disk (cloud_ssd) cannot exceed 32 TB (32,768 GB).
    • A single ephemeral SSD (ephemeral_ssd) cannot exceed 800 GB.
  • For a system disk created with an instance, the Portable attribute is false, meaning that it cannot be attached or detached. The system disk is released with the release of the instance. Therefore, the DeleteWithInstance attribute of the system disk is True.

  • By default, the data disk created with an instance could be a basic cloud disk (cloud), an ultra cloud disk (cloud_efficiency), or an SSD cloud disk (cloud_ssd). The Portable attribute is true, meaning that it cannot be attached or detached. If the data disk is released with the release of the instance, the default value of the DeleteWithInstance attribute is True. Otherwise, the default value of the DeleteWithInstance attribute is False.

  • The Portable attribute of an ephemeral SSD (ephemeral_ssd) that is created with an instance is false, meaning that it cannot be attached or detached. The ephemeral SSD is released with release of the instance. Therefore, the DeleteWithInstance attribute is True.

  • A maximum of 16 data disks can be added to one instance. By default, device names of data disks are allocated in order, starting from /dev/xvdb to /dev/xvdz. The total ephemeral disk size for an instance (excluding the system disk) cannot exceed 2 TB (2,048 GB). The total ephemeral SSD capacity of an instance (excluding the system disk) cannot exceed 1 TB (1,024 GB).

  • If the system disk is a basic cloud disk (cloud), an ultra cloud disk (cloud_efficiency), or an SSD cloud disk (cloud_ssd), the data disk cannot be an ephemeral SSD (ephemeral_ssd).

User Data

An instance must meet all the requirements to be able to input UserData (for details, see UserData in User Guide of ECS). UserData is encoded in Base64 format. UserData transmission is un-encrypted, so it is not advisable to input confidential information, such as passwords or private keys, in plaintext. If you must input confidential information, it is advised to encrypt it, encode it in Base64 format, and then input it. When inputted to the instance, the confidential information is decrypted in the same way.

Others

  • When the creation is complete, the status of the instance is Stopped.

  • When using the interface in the Alibaba Cloud CLI and SDK, remove the dot (.) from the request parameters that contain dots (.), including SystemDisk.Category, SystemDisk.Size, SystemDisk.Description, DataDisk.n.Size, DataDisk.n.Category, DataDisk.n.SnapshotId, DataDisk.n.DiskName, DataDisk.n.Description, and DataDisk.n.DeleteWithInstance. For example, in the Alibaba cloud CLI and SDK, SystemDisk.Category is used instead of SystemDiskCategory.

Request parameters

Name Type Required Description
Action String Yes Operation interface name, value: CreateInstance.
RegionId String Yes Region ID of the instance. See Regions and zones or call the DescribeRegions interface for region IDs.
ZoneId String No ID of a zone where an instance belongs. If it is null, a zone is selected by the system. Default value: null.
ImageId String Yes ID of an image file, indicating an image selected when an instance is started.
InstanceType String Yes Instance type. For values, see Instance generations and type families or call the DescribeInstanceTypes interface.
SecurityGroupId String Yes ID of the security group where a newly created instance belongs. Mutual access is allowed between instances in one security group.
InstanceName String No Display name of the instance. It can be 2 to 128 characters in length and:
  • Must begin with an English letter or Chinese character
  • Can contain digits, dots (.), underscores (_), and hyphens (-)
  • Cannot begin with http:// or https://
The instance name is displayed on the Alibaba Cloud console. If this parameter is not specified, the default value is the InstanceId of the instance.
Description String No Description of the instance. It can be 2 to 256 characters in length and cannot begin with http:// or https://. The description will display on the Alibaba Cloud console. If this parameter is not specified, it is null. The default value is null.
InternetChargeType String No Internet billing method. It must be set to PayByTraffic.
InternetMaxBandwidthIn String No Maximum inbound bandwidth from the Internet, measured in Megabit per second (Mbps). Value range: [1, 200].
If this parameter is not specified, it is automatically set to 200 Mbps.
InternetMaxBandwidthOut String No Maximum outbound bandwidth to the Internet, measured in Mbps.
Value range: [0, 100]. If this parameter is not specified, an error is returned. If necessary, you can open a ticket to request to change the bandwidth range to [1, 200] Mbps.
HostName String No Host name of the ECS instance, which is a string of at least two characters. It cannot start or end with a dot(.) or a hyphen (-) and it cannot have two or more consecutive dots (.) or hyphens (-).
On Windows, the host name can contains [2, 15] characters in length and:
  • Can contain uppercase or lowercase letters
  • Can contain digits, dots (.), and hyphens (-)
  • Cannot contain only digits
On other OSs, such as Linux, the host name can contains [2, 128] characters in length and:
  • Can be segments separated by dots (.)
  • Segments can contain uppercase or lowercase letters, digits, and hyphens (-).
Password String No Password to the instance. It can be 8 to 30 characters in length and must contain any three of the following types of characters:
  • Uppercase and lowercase letters
  • Digits
  • Special symbols, including ( ) ' ~ ! @ # $ % ^ & * − + = | { } [ ] : ; ‘ < > , . ? /
    If the Password parameter passes, use HTTPS to run the API to avoid password leakage.
IoOptimized String No Optional values:
  • none: No I/O Optimized
  • optimized: I/O Optimized
The default value is none for Generation I instances and optimized for other instances.
SystemDisk.Category String No Optional values:
  • cloud: Basic cloud disk
  • cloud_efficiency: Ultra cloud disk
  • cloud_ssd:>cloud_ssd: Cloud SSD
  • ephemeral_ssd: Ephemeral SSD
The default value is cloud for Generation I and none I/O Optimized instances; cloud_efficiency for other instances.
Note: For I/O optimized instances, SSD and ultra cloud disks are supported. For non I/O Optimized instances, ephemeral SSDs and basic cloud disks are supported.
SystemDisk.Size integer No Size of the system disk measured in GB, value range:
  • Cloud: 40−500
  • cloud_efficiency: 40−500
  • cloud_ssd: 40−500
  • ephemeral_ssd: 40−500
Default value: size=max{40,ImageID}. The value should be equal to or greater than max{40,ImageID}.
SystemDisk.DiskName String No Name of the system disk. It can be 2 to 128 characters in length and:
  • Must begin with an English letter or Chinese character
  • Can contain digits, underscores (_), or hyphens (-)
  • Cannot begin with http:// or https://
If this parameter is not specified, it is null by default. The disk name is displayed the on Alibaba Cloud console.
SystemDisk.Description String No Description of a system disk. It can be 2 to 256 characters in length and cannot begin with http:// or https://. It will display on the Alibaba Cloud console. If this parameter is not specified, it is null by default.
DataDisk.n.Size Integer No Size of the n data disk in GBs, n starts from 1. Value range:
  • Cloud: 5−2000
  • cloud_efficiency: 20−2048
  • cloud_ssd: 20−2048
  • ephemeral_ssd: 5−800
The value should be equal to or greater than the specific snapshot.
DataDisk.n.Category String No Category of the data disk n. Optional values:
  • cloud: Basic cloud disk
  • cloud_efficiency: Ultra cloud disk
  • cloud_ssd: Cloud SSD
  • ephemeral_ssd: Ephemeral SSD
Default value: cloud.
DataDisk.n.Encrypted Boolean No Whether the n data disk is encrypted or not. Value range:
  • true: encrypted
  • false: not encrypted
Default value: false.
DataDisk.n.SnapshotId String No Snapshot is used to create the data disk. After this parameter is specified, DataDisk.n.Size is ignored, and the size of the newly created disk is the size of the specified snapshot. If the snapshot was created on or before July 15, 2013, this invocation is denied, and InvalidSnapshot.TooOld will be returned in the response.
DataDisk.n.DiskName String No Name of a data disk. It can be 2 to 128 characters in length and:
  • Must begin with an English letter or Chinese character
  • Can contain digits, underscores (_), or hyphens (-)
  • Cannot begin with http:// or https://
If this parameter is not specified, it is null by default. The data disk name is displayed on the Alibaba Cloud console.
DataDisk.n.Description String No Description of a data disk. It can be 2 to 256 characters in length and cannot begin with http:// or https://. If this parameter is not specified, it is null by default. The disk description is displayed on the Alibaba Cloud console.
DataDisk.n.DeleteWithInstance String No Whether a data disk is released with the instance. Optional values:
  • true: Indicates the disk is released with the instance.
  • false: Indicates the disk is not released with the instance.
Default value: true. This parameter is only valid for an independent cloud disk, which means DataDisk.n.Category is set to cloud, cloud_efficiency, or cloud_ssd. Otherwise, an error is returned.
VSwitchId String No The virtual switch (vSwitch) ID must be specified when creating an instance in VPC.
PrivateIpAddress No Private IP address of the instance, which cannot be specified separately.
InstanceChargeType String No Billing methods. Value range:
  • PrePaid: weekly/monthly/yearly Subscription
  • PostPaid: PayAs-You-Go.
SpotStrategy String No The spot strategy of a Pay-As-You-Go instance, and it takes effect only when the InstanceChargeType is PostPaid. Value range:
  • NoSpot: A normal Pay-As-You-Go instance
  • SpotWithPriceLimit: A price threshold for a spot instance
  • SpotAsPriceGo: A price based on the highest Pay-As-You-Go instance will be automatically generated.
Default value: NoSpot
SpotPriceLimit Float No The hourly price threshold of a instance, and it takes effect only when the InstanceChargeType is PostPaid. Three decimals is allowed at most.
UserData String No The UserData of an instance must be encoded in Base64 format. The maximum size of the raw data is 16 KB.
ClientToken String No Used to ensure the idempotence of the request. The value is generated by a client. It must be unique among all requests and can contain a maximum of 64 ASCII characters. For details, see the appendix How to Ensure Idempotence.
KeyPairName String No Key pair name. If a Windows ECS instance is being created, ignore this parameter. By default, no value is set. If a value is set for the KeyPairName parameter, the password content is still bound to the instance, but the user password authentication method will be disabled during the initialization of a Linux instance.
RamRoleName String No Instance RAM role name. The name is provided and maintained by RAM and can be queried using ListRoles. For details, see RAM-related API Create Role and List Role.
Tag.n.Key String No The key of a tag, of which n is from 1 to 5. It can be up to 64 characters in length and:
  • Cannot begin with aliyun
  • Cannot begin with http:// or https://
  • Cannot be an empty string
Tag.n.Value String No The value of a tag, of which n is from 1 to 5. It can be up to 128 characters in length and:
  • Cannot begin with aliyun
  • Cannot begin with http:// or https://
  • Can be an empty string

Return parameters

Name Type Description
InstanceId String ID of the instance, which is generated by the system and is globally unique. It is a unique identifier of the instance.

Error codes

Error code Description HTTP status code Meaning
Account.Arrearage Your account has an outstanding payment. 400 The account is overdue.
IncorrectVSwitchStatus The current status of virtual switch does not support this operation. 400 The status of the specified vSwitch does not support the operation.
InstanceDiskCategoryLimitExceed The specified DataDisk.n.Size beyond the permitted range, or the capacity of the snapshot exceeds the size limit of the specified disk category. 400 The specified DataDisk.n.Size is beyond the upper limit of the size of the specified disk category.
InstanceDiskNumber.LimitExceed The total number of specified disk in an instance exceeds. 400 The number of data disks attached to one ECS is more than 16.
InvalidDataDiskCategory.ValueNotSupported The specified parameter DataDisk.n.Category is not valid. 400 The specified DataDisk.n.Category is invalid.
InvalidDataDiskSize.ValueNotSupported The specified DataDisk.n.Size beyond the permitted range, or the capacity of the snapshot exceeds the size limit of the specified disk category. 400 The specified DataDisk.n.Size is invalid (beyond the permitted range).
InvalidDescription.Malformed The specified parameter Description is not valid. 400 The specified Description format is invalid.
InvalidDiskCategory.Mismatch The specified disk categories combination is not supported. 400 The combination of specified disk categories is not supported.
InvalidDiskCategory.ValueNotSupported The specified parameter DiskCategory is not valid. 400 The specified DiskCategory is invalid.
InvalidDiskDescription.Malformed The specified parameter SystemDisk.DiskDescription or DataDisk.n.Description is not valid. 400 The specified SystemDisk.DiskDescription or DataDisk.n.Description is invalid.
InvalidDiskName.Malformed The specified parameter SystemDisk.DiskName or DataDisk.n.DiskName is not valid. 400 The specified SyatemDisk.DiskName or DataDisk.n.DiskName is invalid.
InvalidHostName.Malformed The specified parameter HostName is not valid. 400 The specified HostName format is invalid.
InvalidInstanceName.Malformed The specified parameter InstanceName is not valid. 400 The specified InstanceName is invalid.
InvalidInstanceType.ValueNotSupported The specified InstanceType beyond the permitted range. 400 The specified InstanceType is invalid (beyond the permitted range).
InvalidInstanceType.ValueUnauthorized The specified InstanceType is not authorized. 400 The specified InstanceType is not authorized.
InvalidInternetChargeType.ValueNotSupported The specified InternetChargeType is not valid. 400 The specified InternetChargeType does not exist.
InvalidIoOptimizedValue.ValueNotSupported IoOptimized value not supported. 400 The specified IoOptimized is not supported.
InvalidIPAddress.AlreadyUsed The specified IPAddress is already used by other resource. 400 The specified IP address is in use.
InvalidNetworkType.Mismatch Specified parameter InternetMaxBandwidthIn or InternetMaxBandwidthOut conflict with instance network type. 400 The specified InternetMaxBandwidthIn or InternetMaxBandwidthOut does not match the network type of the instance.
InvalidNetworkType.Mismatch Specified parameter InternetChargeType conflict with instance network type. 400 The specified InternetChargeType cannot be applied to the network type of the instance.
InvalidParameter The specified instance bandwidth is not valid. 400 The specified bandwidth is invalid.
InvalidParameter The specified parameter InternetMaxBandwidthOut is not valid. 400 The specified InternetMaxBandwidthOut is invalid (not a number or beyond the permitted range).
InvalidParameter.Bandwidth The specified parameter Bandwidth is not valid. 400 The specified bandwidth is invalid.
InvalidParameter.Conflict The specified image does not support the specified instance type. 400 The specified image is not allowed to be used with the specified instance type.
EncryptedOption.Conflict Encryption value of disk and snapshot conflict. 400 The encryption attribute of the disk and snapshot should be the same.
InvalidParameter.Encrypted.KmsNotEnabled The encrypted disk need enable KMS 400 No KMS service is available in your account, please enable the service by yourself.
InvalidParameter.EncryptedIllegal The value of parameter encrypted is illegal. 400 The specified Encrypted is invalid.
InvalidParameter.EncryptedNotSupported Encrypted disk is not support in this region. 400 The specified RegionId does not support encryption.
InvalidParameter.EncryptedNotSupported Corresponding data disk category does not support encryption. 400 The corresponding data disk category does not support encryption.
InvalidParameter.Mismatch Specified virtual switch is not in the specified zone. 400 The specified vSwitch is not in the specified Zone.
InvalidParameter.Mismatch Specified security group and virtual switch are not in the same VPC. 400 The specified security group and vSwitch do not belong to the same VPC.
InvalidPassword. Malformed The specified parameter Password is not valid. 400 The specified Password format is invalid.
InvalidPrivateIpAddress Specified private IP address is not in the CIDR block of virtual switch. 400 The specified private IP address does not belong to the vSwitch.
InvalidPrivateIpAddress.Duplicated Specified private IP address is duplicated. 400 The specified PrivateIpAddress already exists.
InvalidPrivateIpAddress.Malformed Specified private IP address is malformed. 400 The specified private IP address is invalid.
InvalidSnapshotId.BasedSnapshotTooOld The specified snapshot is created before 2013-07-15. 400 The specified snapshot was created before July 15, 2013.
InvalidSpotStrategy The specified SpotStrategy is not valid. 400 The parameter SpotStrategy is invalid.
InvalidSpotPriceLimit The specified SpotPriceLimit is not valid. 400 The parameter SpotPriceLimit is invalid.
InvalidSpotAuthorized The specified Spot param is unauthorized. 400 The user is not allowed to create a spot instance.
InvalidSpotPrepaid The specified Spot type is not support PrePay Instance. 400 The spot instance does not support Prepaid billing method.
InvalidSpotPriceLimit.LowerThanPublicPrice The specified parameter SpotPriceLimit can’t be lower than current public price. 400 The specified SpotPriceLimit cannot be lower than the current official price of the specified instance.
InvalidSystemDiskCategory.ValueNotSupported The specified parameter SystemDisk.Category is not valid. 400 The specified SystemDisk.Category is invalid.
InvalidUserData.NotSupported The specified parameter UserData only support the Vpc and IoOptimized Instance. 400 Only I/O optimized instances in VPC supports UserData.
InvalidUserData.SizeExceeded The specified parameter UserData exceeds the size. 400 The size of the raw UserData exceeds the maximum size.
MissingParameter The input parameter VSwitchId that is mandatory for processing this request is not supplied. 400 The VSwitchId value is missing.
QuotaExceed.AfterpayInstance The maximum number of Pay-As-You-Go instances is exceeded. 400 The number of Pay-As-You-Go instances has reached the upper limit.
QuotaExceeded Living instances quota exceeded in this VPC. 400 The number of instances in the specified VPC has reached the upper limit.
QuotaExceeded.PrivateIpAddress Do not have enough private IPs in this switch. 400 Not enough private IP addresses.
ResourceNotAvailable Resource you requested is not available in this region or zone. 400 The resource you requested is unavailable in the specified region or zone.
CategoryNotSupported The specified zone does not offer the specified disk category. 403 A disk of a specified category is not allowed to be created in the specified zone.
DeleteWithInstance.Conflict The specified disk is not a portable disk and cannot be set to DeleteWithInstance attribute. 403 The specified disk does not support attach and detach operations.
DependencyViolation.WindowsInstance The instance creating is window, cannot use ssh key pair to login. 403 Windows ECS instances do not support SSH key pairs.
Forbbiden User not authorized to operate on the specified resource. 403 The user is not authorized to operate the specified resource.
ImageNotSubscribed The specified image is not subscribed. 403 The specified image on the marketplace is not subscribed.
ImageNotSupportInstanceType The specified image do not support the InstanceType instance. 403 The specified image does not support the instance type.
ImageRemovedInMarket The specified market image is not available, Or the specified user defined image includes product code because it is based on an image subscribed from marketplace, and that image in marketplace including exact the same product code has been removed. 403 The specified image on the marketplace is unavailable, or the image on the marketplace corresponding to the product code is unavailable.
InstanceDiskCategoryLimitExceed The total size of specified disk category in an instance exceeds. 403 The specified disk category exceeds the maximum capacity of a single instance.
InstanceDiskNumLimitExceed The number of specified disk in an instance exceeds. 403 The number of data disks attached to one ECS is more than 16.
InvalidDiskCategory.Mismatch The specified disk categories combination is not supported. 403 The combination of specified disk categories is not supported.
InvalidDiskCategory.NotSupported The specified disk category is not support the specified instance type. 403 The specified disk category is not supported by the specified instance type.
InvalidDiskSize.TooSmall Specified disk size is less than the size of snapshot. 403 The specified disk size is smaller than the size of the specified snapshot.
InvalidInstanceType.ZoneNotSupported The specified zone does not support this InstanceType. 403 The specified instance type cannot be created in the zone.
InvalidNetworkType.MismatchRamRole Ram role cannot be attached to instances of Classic network type. 403 RAM roles cannot be attached to instances of Classic network type.
InvalidParameter.ResourceOwnerAccount ResourceOwnerAccount is Invalid. 403 The specified ResourceOwnerAccount is invalid.
InvalidPayMethod The specified pay method is not valid. 403 The specified billing method does not exist.
InvalidResourceType.NotSupported This resource type is not supported; please try other resource types. 403 The instance type you are to create is unavailable in any zone. Please try other instance types.
InvalidSnapshotId.NotDataDiskSnapshot The specified snapshot is a system disk snapshot. 403 A data disk cannot be created from the system disk snapshot.
InvalidSnapshotId.NotReady The specified snapshot has not completed yet. 403 The snapshot has not been completed yet.
InvalidSystemDiskCategory.ValueUnauthorized The disk category is not authorized. 403 The user is not authorized to use the specified disk category.
InvalidUser.PassRoleForbidden The RAM user does not have the privilege to pass a role. 403 The RAM user does not have the privilege to pass a role.
InvalidUserData.Forbidden User not authorized to input the parameter UserData, please apply for permission UserData. 403 The user is not authorized to use UserData.
InvalidVSwitchId.NotFound The VSwitchId provided does not exist. 403 The specified vSwitch does not exist.
IoOptimized.NotSupported Vpc is not support IoOptimized instance. 403 I/O optimized instances are not supported in VPC.
IoOptimized.NotSupported The specified image does not support IoOptimized Instance. 403 The specified image does not support the I/O optimized instances.
OperationDenied The type of the disk does not support the operation. 403 The specified category does not support the operation.
OperationDenied The specified Image is disabled or is deleted. 403 The specified image is unavailable or does not exist.
OperationDenied The specified snapshot is not allowed to create a disk. 403 The snapshot of the specified disk is not allowed to create a disk, or the snapshot is not allowed to create a disk.
OperationDenied The creation of Instance to the specified Zone is not allowed. 403 An instance cannot be created for the specified zone, or the specified zone and region mismatch.
OperationDenied The specified region is in resource control, please try later. 403 Selling of Pay-As-You-Go instances are stopped for now in the specified region.
OperationDenied The capacity of snapshot exceeds the size limit of the specified disk category or the specified category is not authorized. 403 The specified DataDisk.n.Size is invalid (beyond the permitted range), or the specified disk category is not authorized.
OperationDenied The specified Image is disabled or is deleted. 403 The specified image cannot be found.
OperationDenied.NoStock The requested resource is sold out in the specified zone; try other types of resources or other regions and zones. 403 The specified instance type is sold out. Please try other instance types in the region or try other region and zone.
QuotaExceed.BuyImage The specified image is from the image market,You have not bought it or your quota has been exceeded. 403 The specified image is from the marketplace. You did not purchase it or the image is sold out in the selected region.
QuotaExceed.PortableCloudDisk The quota of portable cloud disk exceeds. 403 The number of cloud disks that can be attached to an instance has reached the upper limit (4).
RegionUnauthorized There is no permission to create instances in the specified region. 403 The user is not authorized to use the region.
SecurityGroupInstanceLimitExceed Exceeding the allowed number of instances in a security group. 403 The number of instances in the specified security group has reached the upper limit.
Zone.NotOnSale The specified zone is not available for purchase. 403 The specified zone is unavailable for purchase, because creation instances in VPC is not allowed in all zones. Please select other regions and zones.
Zone.NotOpen The specified zone is not granted to you to buy resources yet. 403 You are not authorized to create instances in the specified zone.
ZoneId.NotFound The specified zone does not exists. 403 The specified zone does not exist.
DependencyViolation.IoOptimized The specified InstanceType must be IoOptimized instance. 404 Only I/O optimized instances are allowed for the specified instance type.
HOSTNAME_ILLEGAL hostname is not valid. 404 The specified HostName format is invalid.
InvalidDataDiskSnapshotId.NotFound The specified parameter DataDisk.n.SnapshotId is not valid. 404 The specified DataDisk.n.SnapshotId is not found.
InvalidImageId.NotFound The specified ImageId does not exist. 404 The specified image does not exist.
InvalidInstanceChargeType.NotFound The InstanceChargeType does not exist. 404 The specified InstanceChargeType does not exist.
InvalidKeyPairName.NotFound The specified KeyPairName does not exist. 404 The specified KeyPairName parameter does not exist.
InvalidRamRole.NotFound The specified RamRoleName does not exist. 404 The specified RamRoleName does not exist.
InvalidRegionId.NotFound The specified RegionId does not exist. 404 The specified RegionId does not exist. See Regions and Zones for region IDs.
InvalidSecurityGroupId.NotFound The specified SecurityGroupId does not exist. 404 The specified SecurityGroupId does not exist or the user may not be authorized to use the security group.
InvalidSystemDisk.Size.LessThanImageSize The specified parameter SystemDisk.Sizeis less than the image size. 404 The specified value of SystemDisk.Size is smaller than the image size.
InvalidSystemDisk.Size.LessThanMinSize The specified parameter SystemDisk.Size is less than the min size. 404 The specified value of SystemDisk.Size is smaller than the minimum capacity of the system disk.
InvalidSystemDisk.Size.MoreThanMaxSize The specified parameter SystemDisk.Size is more than the max size. 404 The specified value of SystemDisk.Size is larger than the upper limit of the capacity of the system disk.
InvalidSystemDiskSize The specified parameter SystemDisk.Size is invalid. 404 The specified SystemDisk.Size is invalid.
InvalidVSwitchId.NotFound Specified virtual switch does not exist. 404 The specified vSwitch does not exist.
InvalidZoneId.NotFound The ZoneId provided does not exist. 404 The specified zone does not exist.
IoOptimized.NotSupported The specified instance type does not support IoOptimized instance. 404 The instances of the specified instance type are not the I/O optimized.
OperationDenied Another Instance has been creating. 404 Another Instance is creating.
PaymentMethodNotFound No payment method has been registered on the account. 404 There is not billing method for this account.
InternalError The request processing has failed due to some unknown error. 500 No zone is available for the user due to incorrect resource pool configuration or no resources.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=CreateInstance
  2. &RegionId=cn-hangzhou
  3. &ImageId=_32_23c472_20120822172155_aliguest.vhd
  4. &SecurityGroupId=sg-c0003e8b9
  5. &HostName=Bctest01
  6. &InstanceType=ecs.t1.small
  7. &<Public Request Parameters>

Return example

XML format

  1. <CreateInstanceResponse>
  2. <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
  3. <InstanceId>i-instance1</InstanceId>
  4. </CreateInstanceResponse>

JSON format

  1. {
  2. "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
  3. "InstanceId": "i-instance1"
  4. }
Thank you! We've received your feedback.