Creates a new version under a specified ECS launch template for subsequent creation of ECS instances, elastic scaling groups, or auto provisioning groups.
Operation description
Operation description
When you want to modify the parameters of a version, you can create a new template version. You can create up to 30 versions for each instance launch template.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:CreateLaunchTemplateVersion |
create |
*LaunchTemplate
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| LaunchTemplateId |
string |
No |
The launch template ID. For more information, call the DescribeLaunchTemplates operation. You must specify |
lt-m5eiaupmvm2op9d**** |
| LaunchTemplateName |
string |
No |
The name of the launch template. The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character and cannot start with |
testLaunchTemplateName |
| VersionDescription |
string |
No |
The description of the launch template version. The description must be 2 to 256 characters in length and cannot start with |
testVersionDescription |
| ImageId |
string |
No |
The image ID. This is the image resource selected when the instance is started. You can call the DescribeImages operation to query the available image resources. |
win2008r2_64_ent_sp1_en-us_40G_alibase_20170915.vhd |
| ImageOwnerAlias |
string |
No |
The image source. Note
This parameter will be deprecated soon. To improve compatibility, use other parameters instead. |
system |
| PasswordInherit |
boolean |
No |
Specifies whether to use the preset password of the image. Valid values:
Default value: false. Note
When you specify this parameter, leave the Password parameter empty. Make sure that the specified image has a preset password. |
false |
| InstanceType |
string |
No |
The instance type. For more information, see instance family. You can also invoke the DescribeInstanceTypes operation to query the most recent instance type list. |
ecs.g5.large |
| SecurityGroupId |
string |
No |
The ID of the security group to which the instance created by using this version belongs. Instances in the same security group can access each other. Note
You cannot specify both |
sg-bp15ed6xe1yxeycg**** |
| VpcId |
string |
No |
The ID of the virtual private cloud (VPC) to which the instance belongs. |
vpc-bp12433upq1y5scen**** |
| VSwitchId |
string |
No |
The ID of the vSwitch. This parameter is required when you create a VPC-type instance. |
vsw-bp1s5fnvk4gn2tws0**** |
| InstanceName |
string |
No |
The instance name. The name must be 2 to 128 characters in length and can contain letters and digits in the Unicode letter category. It can contain colons (:), underscores (_), periods (.), and hyphens (-). The default value is the When you create multiple ECS instances, you can specify sequential instance names in batches. The names can contain brackets ([]) and commas (,). For more information, see Specify sequential instance names or hostnames. |
k8s-node-[1,4]-alibabacloud |
| Description |
string |
No |
The instance description. The description must be 2 to 256 characters in length and cannot start with |
testDescription |
| InternetMaxBandwidthIn |
integer |
No |
The maximum inbound public bandwidth. Unit: Mbit/s. Valid values:
|
50 |
| InternetMaxBandwidthOut |
integer |
No |
The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100. |
5 |
| HostName |
string |
No |
The hostname of the cloud server.
|
testHostName |
| ZoneId |
string |
No |
The zone ID of the instance. |
cn-hangzhou-g |
| SystemDisk.Category |
string |
No |
The category of the system disk. Valid values:
Default value: cloud for retired instance types that are not I/O optimization instances, and cloud_efficiency for other instance types. |
cloud_ssd |
| SystemDisk.Size |
integer |
No |
The size of the system disk. Unit: GiB. Valid values:
The value of this parameter must be greater than or equal to max{20, ImageSize}. |
40 |
| SystemDisk.DiskName |
string |
No |
The name of the system disk. The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character and cannot start with |
cloud_ssdSystem |
| SystemDisk.Description |
string |
No |
The description of the system disk. The description must be 2 to 256 characters in length and cannot start with |
testSystemDiskDescription |
| SystemDisk.Iops |
integer |
No |
Note
This parameter is not available. |
30000 |
| SystemDisk.PerformanceLevel |
string |
No |
The performance level settings of the ESSD used as the system disk. Valid values:
For more details about how to select the performance level of an ESSD, see ESSD. |
PL0 |
| SystemDisk.DeleteWithInstance |
boolean |
No |
Specifies whether to release the system disk when the instance is released. Valid values:
Default value: true. |
true |
| SystemDisk.AutoSnapshotPolicyId |
string |
No |
The ID of the automatic snapshot policy applied to the system disk. |
sp-bp1dgzpaxwc4load**** |
| SystemDisk.ProvisionedIops |
integer |
No |
The number of provisioned read/write IOPS for the ESSD AutoPL disk. Valid values: 0 to min{50000, 1000 × Capacity - Baseline performance}. Baseline performance = min{1800 + 50 × Capacity, 50000}. Note
This parameter is supported only when DiskCategory is set to cloud_auto. For more information, see ESSD AutoPL disks and Modify the provisioned performance of an ESSD AutoPL disk. |
50000 |
| SystemDisk.BurstingEnabled |
boolean |
No |
Specifies whether to enable performance burst. Valid values:
|
true |
| IoOptimized |
string |
No |
Specifies whether the instance is an I/O optimized instance. Valid values:
|
optimized |
| InstanceChargeType |
string |
No |
The billing method of the instance. Valid values:
|
PrePaid |
| Period |
integer |
No |
The subscription period of the instance. Unit: months. This parameter is required and takes effect only when |
1 |
| InternetChargeType |
string |
No |
The billing method for outbound Internet bandwidth. Valid values:
Note
In the pay-by-traffic pattern, the peak inbound and outbound bandwidths are used as upper limits of bandwidths instead of guaranteed performance specifications. In the event of resource contention, the peak bandwidths cannot be guaranteed. If your business requires guaranteed bandwidths, use the pay-by-bandwidth pattern. |
PayByTraffic |
| EnableVmOsConfig |
boolean |
No |
Specifies whether to enable the operating system configuration of the instance. |
false |
| NetworkType |
string |
No |
The network type of the instance. Valid values:
|
vpc |
| UserData |
string |
No |
Instance user data of the instance. Instance user data must be encoded in Base64. The maximum size of the raw data is 32 KB. |
ZWNobyBoZWxsbyBl**** |
| KeyPairName |
string |
No |
The name of the key pair.
|
testKeyPairName |
| RamRoleName |
string |
No |
The name of the instance RAM role. You can call the RAM API operation ListRoles to query the instance RAM roles that you have created. |
testRamRoleName |
| AutoReleaseTime |
string |
No |
The automatic release time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For more information, see ISO 8601.
|
2018-01-01T12:05:00Z |
| SpotStrategy |
string |
No |
The preemption policy for the pay-as-you-go instance. This parameter takes effect when
|
NoSpot |
| SpotPriceLimit |
number |
No |
The maximum hourly price of the instance. The value can be accurate to three decimal places. |
0.97 |
| SpotDuration |
integer |
No |
The protection period of the spot instance. Unit: hours. Default value: 1. Valid values:
Alibaba Cloud sends you a notification by using an ECS system event 5 minutes before the instance is revoked. Spot instances use second billing. We recommend that you select an appropriate protection period based on the execution duration of your specific tasks. Note
This parameter takes effect only when SpotStrategy is set to SpotWithPriceLimit or SpotAsPriceGo. |
1 |
| ResourceGroupId |
string |
No |
The ID of the resource group. |
rg-bp67acfmxazb4p**** |
| SecurityEnhancementStrategy |
string |
No |
Specifies whether to enable security hardening for the operating system. Valid values:
|
Active |
| PrivateIpAddress |
string |
No |
The private IP address of the instance. When you specify a private IP address for a VPC-type ECS instance, make sure that the IP address is an idle IP address within the CIDR block of the vSwitch specified by |
10.1.**.** |
| Ipv6AddressCount |
integer |
No |
The number of IPv6 addresses to be randomly generated for the primary ENI. Valid values: 1 to 10. |
1 |
| DeploymentSetId |
string |
No |
The ID of the deployment set. |
ds-bp1brhwhoqinyjd6**** |
| DataDisk |
array<object> |
No |
The data disks. |
|
|
object |
No |
The data disks. |
||
| PerformanceLevel |
string |
No |
The performance level settings of the ESSD used as the data disk. The value of N must be the same as that in
For more details about how to select the performance level of an ESSD, see ESSD. |
PL1 |
| Description |
string |
No |
The description of the data disk. The description must be 2 to 256 characters in length and cannot start with |
testDataDiskDescription |
| SnapshotId |
string |
No |
The ID of the snapshot used to create data disk N. Valid values of N: 1 to 16. When the You cannot use snapshots that were created on or before July 15, 2013. Otherwise, an error is returned and your request is rejected. |
s-bp17441ohwka0yuh**** |
| Size |
integer |
No |
The size of data disk N. Valid values of N: 1 to 16. Unit: GiB. Valid values:
The value of this parameter must be greater than or equal to the size of the snapshot specified by the |
2000 |
| Device |
string |
No |
The mount point of the data disk. The naming conventions for mount points vary based on the number of attached data disks:
Note
This parameter is applicable only to full images. You can set this parameter to the mount point of the data disk in the full image and modify the |
/dev/xvdb |
| DiskName |
string |
No |
The name of the data disk. The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character and cannot start with |
testDataDiskName |
| Category |
string |
No |
The category of data disk N. Valid values:
Default value: cloud_efficiency for I/O optimization instances, and cloud for non-I/O optimization instances. Parameter default value description:
|
cloud_ssd |
| DeleteWithInstance |
boolean |
No |
Specifies whether to release the data disk when the instance is released. Valid values:
Default value: true. |
true |
| Encrypted |
string |
No |
Specifies whether to encrypt the data disk. |
false |
| ProvisionedIops |
integer |
No |
The number of provisioned read/write IOPS for the ESSD AutoPL disk. Valid values: 0 to min{50000, 1000 × Capacity - Baseline performance}. Baseline performance = min{1800 + 50 × Capacity, 50000}. Note
This parameter is supported only when DiskCategory is set to cloud_auto. For more information, see ESSD AutoPL disks and Modify the provisioned performance of an ESSD AutoPL disk. |
50000 |
| BurstingEnabled |
boolean |
No |
Specifies whether to enable performance burst. Valid values:
|
true |
| AutoSnapshotPolicyId |
string |
No |
The ID of the automatic snapshot policy applied to the data disk. |
sp-bp67acfmxazb4p**** |
| KMSKeyId |
string |
No |
The ID of the Key Management Service (KMS) key used by the data disk. |
0e478b7a-4262-4802-b8cb-00d**** |
| NetworkInterface |
array<object> |
No |
The elastic network interface controller (NIC) information. |
|
|
object |
No |
The elastic network interface controller (NIC) information. |
||
| VSwitchId |
string |
No |
The ID of the vSwitch to which the secondary elastic network interface controller (NIC) belongs. The instance and the secondary elastic network interface controller (NIC) must be in the same active zone of the same VPC, but they can belong to different vSwitches. The value of N in |
vsw-bp1s5fnvk4gn2tws0**** |
| NetworkInterfaceName |
string |
No |
The name of the secondary elastic network interface controller (NIC). The value of N in |
testNetworkInterfaceName |
| Description |
string |
No |
The description of the secondary elastic network interface controller (NIC). The description must be 2 to 256 characters in length and cannot start with |
testNetworkInterfaceDescription |
| SecurityGroupId |
string |
No |
The ID of the security group to which the secondary elastic network interface controller (NIC) belongs. The security group of the secondary elastic network interface controller (NIC) and the security group of the instance must be in the same VPC. The value of N in Note
You cannot specify both |
sg-bp15ed6xe1yxeycg**** |
| PrimaryIpAddress |
string |
No |
The primary private IP address of the secondary elastic network interface controller (NIC). The value of N in |
192.168.**.** |
| SecurityGroupIds |
array |
No |
The IDs of one or more security groups to which the secondary elastic network interface controller (NIC) belongs. The security groups and the secondary elastic network interface controller (NIC) must be in the same VPC. The valid values of N in Note
You cannot specify both |
sg-bp67acfmxazb4p**** |
|
string |
No |
The IDs of one or more security groups to which the secondary elastic network interface controller (NIC) belongs. The security groups and the secondary elastic network interface controller (NIC) must be in the same VPC. The valid values of N in Note
You cannot specify both |
sg-bp67acfmxazb4p**** |
|
| InstanceType |
string |
No |
The Elastic Network Interface (ENI) type. Valid values of N: 1 and 2. If N is set to 1, you can configure one primary ENI or one secondary ENI. If N is set to 2, you must configure one primary ENI and one secondary ENI. Valid values:
Default value: Secondary. |
Secondary |
| NetworkInterfaceTrafficMode |
string |
No |
The communication mode of the primary ENI. Valid values:
|
Standard |
| DeleteOnRelease |
boolean |
No |
Specifies whether to retain the ENI when the instance is released. Valid values:
Default value: true. Note
This parameter takes effect only for secondary ENIs. |
true |
| Tag |
array<object> |
No |
The tags of the instances, disks, and primary ENIs created by using this version. |
|
|
object |
No |
The tags of the instances, disks, and primary ENIs created by using this version. |
||
| Key |
string |
No |
The tag key of the instances, disks, and primary ENIs created by using this version. Valid values of N: 1 to 20. If you specify this parameter, it cannot be an empty string. The tag key can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://. |
TestKey |
| Value |
string |
No |
The tag value of the instances, disks, and primary ENIs created by using this version. Valid values of N: 1 to 20. If you specify this parameter, it can be an empty string. The tag value can be up to 128 characters in length and cannot contain http:// or https://. |
TestValue |
| SecurityGroupIds |
array |
No |
The security groups to which the instance is added. The valid values of N are subject to the quota of security groups to which an instance can be added. For more information, see Limits. Note
You cannot specify both |
sg-bp15ed6xe1yxeycg7**** |
|
string |
No |
The security groups to which the instance is added. The valid values of N are subject to the quota of security groups to which an instance can be added. For more information, see Limits. Note
You cannot specify both |
sg-bp15ed6xe1yxeycg7**** |
|
| SystemDisk.Encrypted |
string |
No |
Specifies whether to encrypt the system disk. Valid values:
Default value: false. Note
You cannot encrypt the system disk when you create an instance in Hong Kong (China) Zone D or Singapore Zone A. |
false |
| DeletionProtection |
boolean |
No |
The release protection property of the instance. This property specifies whether the instance can be released by using the ECS console or by calling the DeleteInstance operation. Valid values:
Default value: false. Note
This property applies only to pay-as-you-go instances. It can prevent only manual release operations, but not system release operations. |
false |
| CreditSpecification |
string |
No |
The operating mode of the burstable instance. Valid values:
|
Standard |
| AutoRenew |
boolean |
No |
Specifies whether to enable auto-renewal. This parameter takes effect only when the
Default value: false. |
true |
| AutoRenewPeriod |
integer |
No |
The auto-renewal period. Valid values: Valid values when PeriodUnit is set to Month: 1, 2, 3, 6, 12, 24, 36, 48, and 60. Default value: 1. |
1 |
| PeriodUnit |
string |
No |
The unit of the subscription Billable methods. Valid values: Month (default). |
Month |
| HttpEndpoint |
string |
No |
Specifies whether to enable the access channel for instance metadata. Valid values:
Default value: enabled. Note
For more information about instance metadata, see Overview of instance metadata. |
enabled |
| HttpTokens |
string |
No |
Specifies whether to forcibly use the security hardening mode (IMDSv2) to access instance metadata. Valid values:
Default value: optional. Note
For more information about the modes for accessing instance metadata, see Overview of instance metadata. |
optional |
| HttpPutResponseHopLimit |
integer |
No |
Note
This parameter is not available. |
3 |
| SystemDisk.KMSKeyId |
string |
No |
The KMS key ID of the system disk. |
0e478b7a-4262-4802-b8cb-00d3fb40**** |
| ImageOptions |
object |
No |
The image-related properties. |
|
| LoginAsNonRoot |
boolean |
No |
Specifies whether instances that use this image support logons by the ecs-user user. Valid values:
|
false |
| SecurityOptions |
object |
No |
The security options. |
|
| TrustedSystemMode |
string |
No |
The trusted system mode. Valid values: vTPM. Currently, the trusted system mode supports the following instance families:
When you create an ECS instance of the preceding instance families, you must configure the settings for this parameter. Details:
Note
If you specify an instance as a trusted instance when you create it, you can only use images that support the trusted system when you replace the system disk. For more information about the trusted system, see Overview of the trusted feature for security-enhanced instances. |
vTPM |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| LaunchTemplateVersionNumber |
integer |
The version number of the created launch template. |
2 |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DEX**** |
| LaunchTemplateId |
string |
The launch template ID. For more information, see DescribeLaunchTemplates. When you use a launch template to create an instance, you must specify |
lt-bp1apo0bbbkuy0rj**** |
Examples
Success response
JSON format
{
"LaunchTemplateVersionNumber": 2,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DEX****",
"LaunchTemplateId": "lt-bp1apo0bbbkuy0rj****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidRegion.NotExist | %s | The specified region does not exist. |
| 400 | MissingParameter | %s | A parameter is not specified. |
| 400 | InvalidParameter | %s | The specified parameter is invalid. |
| 400 | InvalidDescription.Malformed | The specified parameter "Description" is not valid. | The source description can be 2 to 256 characters in length. It cannot start with http:// and https://. |
| 400 | InvalidUserData.SizeExceeded | %s | The size of your specified user data exceeds the maximum allowed value. |
| 400 | InvalidUserData.Base64FormatInvalid | %s | The specified user data is invalid. |
| 400 | InvalidHostName.Malformed | The specified parameter "HostName" is not valid. | The specified HostName parameter is invalid. |
| 400 | InvalidParams.CreateEniParams | %s | |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | The specified tag key already exists. Tag keys must be unique. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | LaunchTemplateVersionLimitExceed | %s | The maximum number of launch template versions has been reached. |
| 404 | InvalidLaunchTemplate.NotFound | %s | The specified launch template does not exist. Check whether the parameter value is correct. |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | The specified resource group does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.