tencent cloud

弹性伸缩

产品简介
产品概述
产品优势
应用场景
使用限制
访问管理
购买指南
快速入门
五分钟创建伸缩方案
步骤1:创建启动配置
步骤2:创建伸缩组
步骤3:创建伸缩策略
教程
创建 Web 服务
创建高性能计算集群
创建请求类服务器
配置高可用业务
启动配置
启动配置概述
创建启动配置
查看启动配置列表
更改启动配置
检测异常
伸缩组
伸缩组概述
创建伸缩组
查看伸缩组列表
修改伸缩组
修改伸缩组绑定的实例
将负载均衡与伸缩组结合
删除伸缩组
创建通知
创建伸缩活动通知
指定通知接收人
扩缩容
生命周期挂钩
管理定时任务
管理告警触发策略
实例健康检查
手动扩容
缩容处理
查看伸缩活动
暂停及恢复扩缩容
指定实例免于缩容
伸缩活动取消
伸缩活动失败
冷却时间说明
监控
监控告警指标
运行状态检查
定时任务
定时任务执行时间说明
故障处理
伸缩组失效
伸缩活动失败
实践教程
为伸缩组设置固定出口 IP
部署弹性 Web 应用服务
设置服务开机启动
客户案例
高性能计算:碳云数据挖掘
API 文档
History
Introduction
API Category
Making API Requests
Scaling Group APIs
Scaling Group Instances APIs
Launch Configuration APIs
Scheduled Action APIs
Alarm Trigger Policy APIs
Notification APIs
Lifecycle Hook APIs
Instance Refresh APIs
Other APIs
Data Types
Error Codes
常见问题
联系我们
词汇表

UpgradeLaunchConfiguration

PDF
聚焦模式
字号
最后更新时间: 2025-10-30 21:28:23

1. API Description

This API will be disused soon.

Planned disuse time: 2023-11-22 14:30:38

Domain name for API request: as.intl.tencentcloudapi.com.

There is a replacement API: ModifyLaunchConfiguration. This API carries the risk of parameter overwriting, and it has currently been hidden on the official website.
This API (UpgradeLaunchConfiguration) is used to upgrade the launch configuration.

  • This API is used to upgrade the launch configuration, adopting an "entirely overwrite" approach. Regardless of previous parameter settings, they will be uniformly replaced with new configurations as specified in the interface parameters. For non-mandatory fields, if not filled in, default values will be assigned.
  • After upgrading and modifying the launch configuration, existing instances that have been scaled out using this configuration will not undergo any changes. Subsequently, newly added instances using this upgraded launch configuration will be scaled out according to the new configuration.

A maximum of 20 requests can be initiated per second for this API.

2. Input Parameters

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 Params. The value used for this API: UpgradeLaunchConfiguration.
Version Yes String Common Params. The value used for this API: 2018-04-19.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
LaunchConfigurationId Yes String Launch configuration ID.
ImageId Yes String Image ID in the format of img-xxx. There are three types of images:
  • Public images
  • Custom images
  • Shared images

  • You can obtain the image IDs in the CVM console.
  • You can also use the DescribeImages and look for ImageId in the response.
  • InstanceTypes.N Yes Array of String List of instance models. Different instance models specify different resource specifications. Up to 5 instance models can be supported.
    LaunchConfigurationName Yes String Display name of the launch configuration, which can contain letters, digits, underscores and hyphens (-), and dots. Up to of 60 bytes allowed..
    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.
    EnhancedService No EnhancedService Enhanced services. You can use this parameter to specify whether to enable services such as Cloud Security and Cloud Monitor. If this parameter is not specified, Cloud Monitor and Cloud Security will be enabled by default.
    InstanceChargeType No String Instance billing type. CVM instances are POSTPAID_BY_HOUR by default.

  • POSTPAID_BY_HOUR: Pay-as-you-go on an hourly basis

  • SPOTPAID: Bidding
  • InstanceMarketOptions No InstanceMarketOptionsRequest Market options of the instance, such as parameters related to spot instances. This parameter is required for spot instances.
    InstanceTypesCheckPolicy No String Instance type verification policy. Value range: ALL, ANY. Default value: ANY.

  • ALL: The verification will success only if all instance types (InstanceType) are available; otherwise, an error will be reported.

  • ANY: The verification will success if any instance type (InstanceType) is available; otherwise, an error will be reported.

    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.
  • InternetAccessible No InternetAccessible Configuration of public network bandwidth. If this parameter is not specified, 0 Mbps will be used by default.
    LoginSettings No LoginSettings This parameter is now invalid and should not be used. Upgrading the launch configuration API does not allow modification or overwriting of the LoginSettings parameter. LoginSettings will not change after upgrade.
    ProjectId No Integer Project ID of the instance. Leave it blank as the default.
    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.
    SystemDisk No SystemDisk System disk configuration of the instance. If this parameter is not specified, the default value will be used.
    UserData No String Base64-encoded custom data of up to 16 KB.
    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 Details of the monthly subscription, including the purchase period, auto-renewal. It is required if the InstanceChargeType is PREPAID.
    DiskTypePolicy No String Selection policy of cloud disks. Default value: ORIGINAL. Valid values:

  • ORIGINAL: uses the configured cloud disk type

  • AUTOMATIC: automatically chooses an available cloud disk type
  • IPv6InternetAccessible No IPv6InternetAccessible IPv6 public network bandwidth configuration. If the IPv6 address is available in the new instance, public network bandwidth can be allocated to the IPv6 address. This parameter is invalid if Ipv6AddressCount of the scaling group associated with the launch configuration is 0.

    3. Output Parameters

    Parameter Name Type Description
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Upgrading a launch configuration with required parameters

    This example shows you how to upgrade 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.

    Input Example

    POST / HTTP/1.1
    Host: as.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: UpgradeLaunchConfiguration
    <Common request parameters>
    
    {
        "ImageId": "img-8toqc6s3",
        "LaunchConfigurationName": "as_test",
        "InstanceTypes": [
            "S2.SMALL1"
        ],
        "LaunchConfigurationId": "asc-gj14vczi"
    }

    Output Example

    {
        "Response": {
            "RequestId": "d68a3364-a933-4664-bee4-fb89b8c69b49"
        }
    }

    Example2 Upgrading a launch configuration with detailed parameters

    This example shows you how to upgrade 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.

    Input Example

    POST / HTTP/1.1
    Host: as.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: UpgradeLaunchConfiguration
    <Common request parameters>
    
    {
        "SystemDisk": {
            "DiskSize": "50",
            "DiskType": "LOCAL_BASIC"
        },
        "LoginSettings": {
            "KeyIds": [
                "skey-k8eypc1l"
            ]
        },
        "LaunchConfigurationId": "asc-gj14vczi",
        "InstanceTypes": [
            "S2.SMALL1"
        ],
        "ImageId": "img-8toqc6s3",
        "EnhancedService": {
            "SecurityService": {
                "Enabled": "TRUE"
            },
            "MonitorService": {
                "Enabled": "TRUE"
            }
        },
        "LaunchConfigurationName": "as_test",
        "InternetAccessible": {
            "PublicIpAssigned": "TRUE",
            "InternetChargeType": "TRAFFIC_POSTPAID_BY_HOUR",
            "InternetMaxBandwidthOut": "5"
        },
        "DataDisks": [
            {
                "Encrypt": "FALSE",
                "DeleteWithInstance": "TRUE",
                "DiskSize": "1000",
                "ThroughputPerformance": "100",
                "DiskType": "CLOUD_HSSD"
            }
        ]
    }

    Output Example

    {
        "Response": {
            "RequestId": "1430a2d3-eb73-44c6-8316-218c4562a85c"
        }
    }

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    CallCvmError CVM API call failed.
    InternalError An internal error occurred.
    InvalidImageId.NotFound The image cannot be found.
    InvalidParameter.ActionNotFound Invalid Action request.
    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.ParameterDeprecated This parameter has been disused.
    InvalidParameter.ParameterMustBeDeleted Some parameters cannot coexist and should be deleted.
    InvalidParameterValue Wrong parameter value.
    InvalidParameterValue.AccountNotSupportBandwidthPackageId The bandwidth package ID is not supported in this account.
    InvalidParameterValue.CvmConfigurationError Exception with CVM parameter validation.
    InvalidParameterValue.CvmError Exception with CVM parameter validation.
    InvalidParameterValue.HostNameIllegal Invalid hostname
    InvalidParameterValue.IPv6InternetChargeType The specified IPv6 public network bandwidth billing mode is invalid.
    InvalidParameterValue.InstanceTypeNotSupported The instance type is not supported.
    InvalidParameterValue.InvalidImageId Invalid image ID.
    InvalidParameterValue.InvalidInstanceType Invalid instance type.
    InvalidParameterValue.InvalidLaunchConfigurationId Invalid launch configuration ID.
    InvalidParameterValue.LaunchConfigurationNameDuplicated The launch configuration name already exists.
    InvalidParameterValue.MissingBandwidthPackageId The bandwidth package ID is required.
    InvalidParameterValue.NotStringTypeFloat The value should be a floating point string.
    InvalidParameterValue.ProjectIdNotFound The project ID does not exist.
    InvalidParameterValue.Range The value is outside the specified range.
    InvalidParameterValue.UserDataFormatError Incorrect UserData format.
    InvalidParameterValue.UserDataSizeExceeded The UserData is too long.
    MissingParameter Parameter missing.
    ResourceNotFound.BandwidthPackageIdNotFound The specified bandwidth package ID is not found.
    ResourceNotFound.LaunchConfigurationIdNotFound The specified launch configuration does not exist.

    帮助和支持

    本页内容是否解决了您的问题?

    填写满意度调查问卷,共创更好文档体验。

    文档反馈