Domain name for API request: as.tencentcloudapi.com.
This API (CreateLaunchConfiguration) is used to create a launch configuration.
A few fields of a launch configuration can be modified through ModifyLaunchConfigurationAttributes
. To use a new launch configuration, it is recommended to create it from scratch.
You can create up to 20 launch configurations for each project. For more information, see Usage Limits.
A maximum of 20 requests can be initiated per second for this API.
Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: as.ap-shanghai-fsi.tencentcloudapi.com
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common parameter. The value used for this API: CreateLaunchConfiguration. |
Version | Yes | String | Common parameter. The value used for this API: 2018-04-19. |
Region | Yes | String | Common parameter. For more information, please see the list of regions supported by the product. |
LaunchConfigurationName | Yes | String | Display name of the launch configuration, which can contain Chinese characters, letters, numbers, underscores, separators ("-"), and decimal points with a maximum length of 60 bytes. |
ImageId | Yes | String | Valid image ID in the format of img-8toqc6s3 . There are four types of images: You can obtain the available image IDs in the following ways: public images , custom images , and shared images , log in to the console to query the image IDs; for marketplace images , query the image IDs through Cloud Marketplace. ImageId field in the return value of the DescribeImages API. |
ProjectId | No | Integer | ID of the project to which the instance belongs. This parameter can be obtained from the projectId field in the returned values of DescribeProject. If this is left empty, default project is used. |
InstanceType | No | String | Instance model. Different instance models specify different resource specifications. The specific value can be obtained by calling the DescribeInstanceTypeConfigs API to get the latest specification table or referring to the descriptions in Instance Types.InstanceType and InstanceTypes are mutually exclusive, and one and only one of them must be entered. |
SystemDisk | No | SystemDisk | System disk configuration of the instance. If this parameter is not specified, the default value will be assigned to it. |
DataDisks.N | No | Array of DataDisk | Information of the instance's data disk configuration. If this parameter is not specified, no data disk is purchased by default. Up to 11 data disks can be supported. |
InternetAccessible | No | InternetAccessible | Configuration information of public network bandwidth. If this parameter is not specified, the default public network bandwidth is 0 Mbps. |
LoginSettings | No | LoginSettings | Login settings of the instance. This parameter is used to set the login password and key for the instance, or to keep the original login settings for the image. By default, a random password is generated and sent to the user via the internal message. |
SecurityGroupIds.N | No | Array of String | The security group to which the instance belongs. This parameter can be obtained by calling the SecurityGroupId field in the returned value of DescribeSecurityGroups. If this parameter is not specified, no security group will be bound by default. |
EnhancedService | No | EnhancedService | Enhanced service. This parameter is used to specify whether to enable Cloud Security, Cloud Monitoring and other services. If this parameter is not specified, Cloud Monitoring and Cloud Security will be enabled by default. |
UserData | No | String | Base64-encoded custom data of up to 16 KB. |
InstanceChargeType | No | String | Instance billing mode. CVM instances take POSTPAID_BY_HOUR by default. Valid values: |
InstanceMarketOptions | No | InstanceMarketOptionsRequest | Market-related options of the instance, such as the parameters related to stop instances. If the billing method of instance is specified as bidding, this parameter must be passed in. |
InstanceTypes.N | No | Array of String | List of instance models. Different instance models specify different resource specifications. Up to 10 instance models can be supported.InstanceType and InstanceTypes are mutually exclusive, and one and only one of them must be entered. |
InstanceTypesCheckPolicy | No | String | Instance type verification policy. Value range: ALL, ANY. Default value: ANY. Common reasons why an instance type is unavailable include stock-out of the instance type or the corresponding cloud disk. If a model in InstanceTypes does not exist or has been discontinued, a verification error will be reported regardless of the value of InstanceTypesCheckPolicy. |
InstanceTags.N | No | Array of InstanceTag | List of tags. This parameter is used to bind up to 10 tags to newly added instances. |
CamRoleName | No | String | CAM role name, which can be obtained from the roleName field in the return value of the DescribeRoleList API. |
HostNameSettings | No | HostNameSettings | CVM HostName settings. |
InstanceNameSettings | No | InstanceNameSettings | Settings of CVM instance names. |
InstanceChargePrepaid | No | InstanceChargePrepaid | Sets prepaid billing mode, also known as monthly subscription. This parameter can specify the purchase period and other attributes such as auto-renewal. This parameter is mandatory for prepaid instances. |
Parameter Name | Type | Description |
---|---|---|
LaunchConfigurationId | String | This parameter is returned when a launch configuration is created through this API, indicating the launch configuration ID. |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
This example shows you how to create a launch configuration by only assigning values for the required parameters (launch configuration name, instance model, and image ID) and using system default values for other parameters. The specific configuration is as follows: launch configuration name: as_test; instance model: Standard II 1C1G (S2.SMALL1); image ID: img-8toqc6s3.
https://as.tencentcloudapi.com/?Action=CreateLaunchConfiguration
&LaunchConfigurationName=as_test
&InstanceType=S2.SMALL1
&ImageId=img-8toqc6s3
&<Common request parameters>
{
"Response": {
"LaunchConfigurationId": "asc-23h37kyn",
"RequestId": "d639dd64-9e46-4246-b13c-80954f81c11b"
}
}
This example shows you how to create a launch configuration with the following configurations. Launch configuration name: as_test; image ID: img-8toqc6s3; model: Standard II 1C1G (S2.SMALL1); system disk: 50 GB local disk; data disk: 100 GB HDD cloud disk; public network billing: pay-as-you-go by traffic on an hourly basis; public network bandwidth cap: 5 Mbps; public IP: assigned; login method: key; Cloud Monitor service: enabled; Anti-DDoS: enabled.
https://as.tencentcloudapi.com/?Action=CreateLaunchConfiguration
&LaunchConfigurationName=as_test
&ImageId=img-8toqc6s3
&InstanceType=S2.SMALL1
&SystemDisk.DiskType=LOCAL_BASIC
&SystemDisk.DiskSize=50
&DataDisks.0.DiskType=CLOUD_BASIC
&DataDisks.0.DiskSize=100
&InternetAccessible.InternetChargeType=TRAFFIC_POSTPAID_BY_HOUR
&InternetAccessible.InternetMaxBandwidthOut=5
&InternetAccessible.PublicIpAssigned=TRUE
&LoginSettings.KeyIds.0=skey-k8eypc1l
&EnhancedService.SecurityService.Enabled=TRUE
&EnhancedService.MonitorService.Enabled=TRUE
&<Common request parameters>
{
"Response": {
"LaunchConfigurationId": "asc-fdz8j7dh",
"RequestId": "9a7209d3-2260-49d7-952a-dfa2001f8822"
}
}
This example shows you how to create a launch configuration with the following configurations. Launch configuration name: spot-test; model: Standard II 2C4G (S2.MEDIUM4); billing mode: spot instance (SPOTPAID); maximum bid: 0.99 USD/hr.
https://as.tencentcloudapi.com/?Action=CreateLaunchConfiguration
&LaunchConfigurationName=spot-test
&InstanceType=S2.MEDIUM4
&ImageId=img-8toqc6s3
&SystemDisk.DiskType=CLOUD_PREMIUM
&SystemDisk.DiskSize=50
&InternetAccessible.InternetChargeType=TRAFFIC_POSTPAID_BY_HOUR
&InternetAccessible.InternetMaxBandwidthOut=20
&InternetAccessible.PublicIpAssigned=true
&InstanceChargeType=SPOTPAID
&InstanceMarketOptions.MarketType=spot
&InstanceMarketOptions.SpotOptions.MaxPrice=0.99
&InstanceMarketOptions.SpotOptions.SpotInstanceType=one-time
&<Common request parameters>
{
"Response": {
"LaunchConfigurationId": "asc-hpzwe3o2",
"RequestId": "ccfe3052-e9c9-47ee-bf3d-5bc2dfd972c0"
}
}
This example shows you how to create a launch instance that supports two instance models: S2.SMALL2 and S2.SMALL4.
https://as.tencentcloudapi.com/?Action=CreateLaunchConfiguration
&LaunchConfigurationName=multi_instance_types
&InstanceTypes.0=S2.SMALL2
&InstanceTypes.1=S2.SMALL4
&ImageId=img-8toqc6s3
&<Common request parameters>
{
"Response": {
"LaunchConfigurationId": "asc-77mh1cho",
"RequestId": "2864c860-27a0-439e-a1e1-0003b76734e7"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
AccountQualificationRestrictions | The requesting account failed to pass the qualification review. |
CallCvmError | CVM API call failed. |
InvalidImageId.NotFound | The image was not found. |
InvalidParameter.Conflict | Multiple parameters specified conflict and cannot co-exist. |
InvalidParameter.InvalidCombination | Invalid parameter combination. |
InvalidParameter.MustOneParameter | A parameter is missing. One of the two parameters must be specified. |
InvalidParameter.ParameterMustBeDeleted | Some parameters cannot coexist and should be deleted. |
InvalidParameterValue.CvmConfigurationError | Exception with CVM parameter validation. |
InvalidParameterValue.InstanceTypeNotSupported | The instance type is not supported. |
InvalidParameterValue.InvalidImageId | Invalid image ID. |
InvalidParameterValue.InvalidInstanceType | Invalid instance type. |
InvalidParameterValue.LaunchConfigurationNameDuplicated | The launch configuration name already exists. |
InvalidParameterValue.LimitExceeded | The value exceeds the limit. |
InvalidParameterValue.ProjectIdNotFound | The project ID does not exist. |
InvalidParameterValue.TooLong | Too many values. |
InvalidParameterValue.UserDataFormatError | Incorrect UserData format. |
InvalidParameterValue.UserDataSizeExceeded | The UserData is too long. |
InvalidPermission | The account does not support this operation. |
LaunchConfigurationQuotaLimitExceeded | The launch configuration quota is exceeded. |
MissingParameter | Parameter missing. |
Was this page helpful?