El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating an AS Group

Updated on 2025-01-27 GMT+08:00

Function

An AS group is a collection of instances that are used in the same scenario. It is the basis for enabling or disabling AS policies and performing scaling actions. An AS group specifies parameters, such as the maximum number of instances, expected number of instances, minimum number of instances, VPC, subnet, and load balance settings.

  • Each account can create a maximum of 25 AS groups by default.
  • If a load balancer is associated with an AS group, AS automatically associates the load balancer with or dissociates the load balancer from instances when the instances are added to or removed from the AS group.
  • If ELB health check is enabled for an AS group, the instances in the AS group must use all the listening ports of each load balancer for health check. You can configure these ports in the security group of the instances.

URI

POST /autoscaling-api/v1/{project_id}/scaling_group

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Request

Table 2 Request parameters

Parameter

Mandatory

Type

Description

scaling_group_name

Yes

String

Specifies the AS group name. The name contains only letters, digits, underscores (_), and hyphens (-), and cannot exceed 64 characters.

scaling_configuration_id

Yes

String

Specifies the AS configuration ID, which can be obtained using the API for querying AS configurations. For details, see Querying AS Configurations.

desire_instance_number

No

Integer

Specifies the expected number of instances. The default value is the minimum number of instances.

The value ranges from the minimum number of instances to the maximum number of instances.

min_instance_number

No

Integer

Specifies the minimum number of instances. The default value is 0.

max_instance_number

No

Integer

Specifies the maximum number of instances. The default value is 1. The value is an integer ranging from 0 to 300.

cool_down_time

No

Integer

Specifies the cooldown period (in seconds). The value ranges from 0 to 86400 and defaults to 300.

After a scaling action is complete, the cooldown period starts. During the cooldown period, AS denies all scaling requests triggered by alarm-based policies. Scaling requests triggered manually or by scheduled or periodic policies are not affected.

NOTE:
  • When an AS group scales out, scale-in requests triggered manually or by scheduled and periodic policies will be executed immediately after the scale-out is complete, without being affected by the cooldown period.
  • When an AS group scales in, scale-out requests triggered manually or by scheduled and periodic policies will be executed immediately after the scale-in is complete, without being affected by the cooldown period.

lb_listener_id

No

String

Specifies the ID of a listener added to a load balancer. You can add up to six listeners. Separate listener IDs with commas (,).

available_zones

No

Array of strings

Specifies the AZ information. The instances added in a scaling action will be created in a specified AZ. If you do not specify an AZ, the system automatically specifies one.

networks

Yes

Array of networks objects

Specifies network information. You can select up to five subnets. The first subnet you select is used by the primary NICs of ECSs by default. For the information about the data structure, see Table 4.

security_groups

No

Array of security_groups objects

Specifies the security group information. Only one security group can be selected. For the information about the data structure, see Table 5.

If a security group is specified both in the AS configuration and the AS group, scaled-out instances will be added to the security group specified in the AS configuration. If a security group is not specified in either of them, scaled-out instances will be added to the default security group. For your convenience, specify a security group in the AS configuration.

vpc_id

Yes

String

Specifies the VPC ID, which can be obtained using the API for querying VPCs. For details, see "Querying VPCs" in Virtual Private Network API Reference.

health_periodic_audit_method

No

String

Specifies the health check method for instances in the AS group. The health check methods include ELB_AUDIT and NOVA_AUDIT. When load balancing is configured for an AS group, the default value is ELB_AUDIT. Otherwise, the default value is NOVA_AUDIT.

  • ELB_AUDIT: indicates the ELB health check, which takes effect in an AS group with a listener.
  • NOVA_AUDIT: indicates the ECS instance health check, which is the health check method that comes with AS.

health_periodic_audit_time

No

Integer

Specifies the health check interval. The value can be 1, 5, 15, 60, or 180 in the unit of minutes. If this parameter is not specified, the default value is 5.

If the value is set to 0, health check is performed every 10 seconds.

health_periodic_audit_grace_period

No

Integer

Specifies the grace period for instance health check. The unit is second and the value ranges from 0 to 86400. The default value is 600.

The health check grace period starts after an instance is added to an AS group and is enabled. The AS group will start checking the instance health only after the grace period ends.

This parameter is valid only when the instance health check method of the AS group is ELB_AUDIT.

instance_terminate_policy

No

String

Specifies the instance removal policy.

  • OLD_CONFIG_OLD_INSTANCE (default): The earlier-created instances based on the earlier-created AS configurations are removed first.
  • OLD_CONFIG_NEW_INSTANCE: The later-created instances based on the earlier-created AS configurations are removed first.
  • OLD_INSTANCE: The earlier-created instances are removed first.
  • NEW_INSTANCE: The later-created instances are removed first.

notifications

No

Array of strings

Specifies the notification mode.

EMAIL refers to notification by email.

This parameter has been discarded. You can configure notifications for the AS group by referring to Notifications.

delete_publicip

No

Boolean

Specifies whether to delete the EIPs bound to ECS instances when the instances are removed from the AS group during scale-in actions. The value can be true or false. The default value is false.
  • true: The EIPs bound to ECSs will be released when the ECSs are removed.
  • false: The EIPs bound to ECSs will be unbound but will not be released when the ECSs are removed.

delete_volume

No

Boolean

Specifies whether to delete the data disks attached to ECS instances when the instances are removed from the AS group during scale-in actions. The value can be true or false. The default value is false.
  • true: The data disks attached to ECSs will be released when the ECSs are removed.
  • false: The data disks attached to ECSs will be detached but will not be released when the ECSs are removed.

multi_az_priority_policy

No

String

Specifies the priority policy used to select target AZs when adjusting the number of instances in an AS group.

  • EQUILIBRIUM_DISTRIBUTE (default): When AS scales out the AS group, it preferentially distributes instances evenly across AZs in the available_zones list. If it fails in the target AZ, it selects another AZ based on the PICK_FIRST policy.
  • PICK_FIRST: When AS scales out the AS group, the target AZ is determined in the order in the available_zones list.

description

No

String

Specifies the description of the AS group. The value can contain 1 to 256 characters.

Table 3 lbaas_listeners field description

Parameter

Mandatory

Type

Description

pool_id

Yes

String

Specifies the backend server group ID.

protocol_port

Yes

Integer

Specifies the port configured for the backend server group, which is the port on which a backend server listens for traffic. The port ranges from 1 to 65535.

weight

Yes

Integer

Specifies the weight, which determines the percentage of requests a backend server processes. The value of this parameter ranges from 0 to 100.

Table 4 networks field description

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the subnet ID.

Table 5 security_groups field description

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the security group ID.

Example Request

This example creates an AS group with the name GroupNameTest, the AS configuration ID 47683a91-93ee-462a-a7d7-484c006f4440, the VPC ID a8327883-6b07-4497-9c61-68d03ee193a, the NIC ID 3cd35bca-5a10-416f-8994-f79169559870, the maximum number of instances of 10, the expected number of instances of 0, the minimum number of instances of 0, and the health check method of ECS health check, and the multi-AZ scaling policy of PICK_FIRST.

{
    "scaling_group_name": "GroupNameTest",
    "scaling_configuration_id": "47683a91-93ee-462a-a7d7-484c006f4440",
    "desire_instance_number": 0,
    "min_instance_number": 0,
    "max_instance_number": 10,
    "health_periodic_audit_method": "NOVA_AUDIT",
    "vpc_id": "a8327883-6b07-4497-9c61-68d03ee193a",
    "available_zones": ["XXXa","XXXb"],
    "networks": [
        {
            "id": "3cd35bca-5a10-416f-8994-f79169559870"
        }
    ],
}

Response

Table 6 Response parameters

Parameter

Type

Description

scaling_group_id

String

Specifies the AS group ID.

Example Response

{
    "scaling_group_id": "a8327883-6b07-4497-9c61-68d03ee193a1"
}

Returned Values

  • Normal

    200

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    The server failed to process the request.

    401 Unauthorized

    You must enter the username and password to access the requested page.

    403 Forbidden

    You are forbidden to access the requested page.

    404 Not Found

    The server could not find the requested page.

    405 Method Not Allowed

    You are not allowed to use the method specified in the request.

    406 Not Acceptable

    The response generated by the server could not be accepted by the client.

    407 Proxy Authentication Required

    You must use the proxy server for authentication to process the request.

    408 Request Timeout

    The request timed out.

    409 Conflict

    The request could not be processed due to a conflict.

    500 Internal Server Error

    Failed to complete the request because of an internal service error.

    501 Not Implemented

    Failed to complete the request because the server does not support the requested function.

    502 Bad Gateway

    Failed to complete the request because the request is invalid.

    503 Service Unavailable

    Failed to complete the request because the system is unavailable.

    504 Gateway Timeout

    A gateway timeout error occurred.

Error Codes

See Error Codes.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback