Help Center/ Elastic Cloud Server/ API Reference/ APIs/ Flavor Management/ Querying Details About Flavors and Extended Flavor Information
Updated on 2024-12-19 GMT+08:00

Querying Details About Flavors and Extended Flavor Information

Function

This API is used to query details about ECS flavors and extended flavor information.

URI

GET /v1/{project_id}/cloudservers/flavors?availability_zone={availability_zone}

Table 1 describes the parameters in the URI.
Table 1 Path parameters

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the ID, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

availability_zone

No

String

Specifies an AZ. If this parameter is not left blank, flavors in the normal, obt, or promotion states are returned.

See Regions and Endpoints.

Request

None

Response

Table 3 describes the response parameters.
Table 3 Response parameters

Parameter

Type

Description

flavors

Array of objects

Specifies ECS flavors. For details, see Table 4.

Table 4 flavors field description

Parameter

Type

Description

id

String

Specifies the ID of the ECS flavor.

name

String

Specifies the name of the ECS flavor.

vcpus

String

Specifies the number of vCPUs in the ECS flavor.

ram

Integer

Specifies the memory size (MB) in the ECS flavor.

disk

String

Specifies the system disk size in the ECS flavor.

This parameter has not been used. Its default value is 0.

swap

String

Specifies the swap partition size required by the ECS flavor.

This parameter has not been used. Its default value is "".

OS-FLV-EXT-DATA:ephemeral

Integer

Specifies the temporary disk size. This is an extended attribute.

This parameter has not been used. Its default value is 0.

OS-FLV-DISABLED:disabled

Boolean

Specifies whether the ECS flavor has been disabled. This is an extended attribute.

This parameter has not been used. Its default value is false.

rxtx_factor

Float

Specifies the ratio of the available network bandwidth to the network hardware bandwidth of the ECS.

This parameter has not been used. Its default value is 1.0.

rxtx_quota

String

Specifies the software constraints of the network bandwidth that can be used by the ECS.

This parameter has not been used. Its default value is null.

rxtx_cap

String

Specifies the hardware constraints of the network bandwidth that can be used by the ECS.

This parameter has not been used. Its default value is null.

os-flavor-access:is_public

Boolean

Specifies whether a flavor is available to all tenants. This is an extended attribute.

  • true: indicates that a flavor is available to all tenants.
  • false: indicates that a flavor is available only to certain tenants.

Default value: true

links

Array of objects

Specifies shortcut links for ECS flavors. For details, see Table 5.

os_extra_specs

Object

Specifies extended ECS specifications. For details, see Table 6.

attachableQuantity

Object

Specifies the number of NICs and disks that can be attached to an ECS. For details, see Table 7.

Table 5 links field description

Parameter

Type

Description

rel

String

Specifies the shortcut link marker name.

href

String

Provides the corresponding shortcut link.

type

String

Specifies the shortcut link type. This parameter has not been used. Its default value is null.

Table 6 os_extra_specs field description (only common parameters are listed)

Parameter

Type

Description

ecs:performancetype

String

Specifies the ECS flavor type:

  • normal: general computing
  • computingv3: general computing-plus
  • highmem: memory-optimized
  • cpuv1: computing I
  • cpuv2: computing II
  • highcpu: high-performance computing
  • diskintensive: disk-intensive
  • saphana: large-memory
  • kunpeng_highio: Kunpeng ultra-high I/O
  • kunpeng_accelerator: Kunpeng AI inference-accelerated
  • advanced_smb: general computing (providing resources for Huawei Cloud FlexusX)
NOTE:

In an earlier registered flavor, this field is hws:performancetype.

Xen ECSs do not support this parameter.

Only the flavors displayed on the console are listed. To view other flavors, contact technical support.

hw:numa_nodes

String

Specifies the number of physical CPUs of the host. The ECS specifications determine whether to return the parameter value.

resource_type

String

Specifies the resource type. resource_type is used to differentiate between the types of the physical servers accommodating ECSs.

hpet_support

String

Specifies whether to enable the high-precision clock on the ECS. true indicates to enable the function, and false indicates to disable the function. The ECS specifications determine whether to return the parameter value.

instance_vnic:type

String

Specifies the NIC type. The value of this parameter is consistently enhanced, indicating that network enhancement ECSs are to be created.

instance_vnic:instance_bandwidth

String

Specifies the maximum bandwidth in the unit of Mbit/s. The maximum value of this parameter is 10,000.

instance_vnic:max_count

String

Specifies the maximum number of NICs. The maximum value of this parameter is 4.

quota:local_disk

String

The value of this parameter is in format of {type}:{count}:{size}:{safeFormat}.

  • type: indicates the disk type, which can only be HDD.
  • count: indicates the number of local disks. The following types are supported:
    • For D1 ECSs, the value can be 3, 6, 12, or 24.
    • For D2 ECSs, the value can be 2, 4, 8, 12, 16, or 24.
    • For D3 ECSs, the value can be 2, 4, 8, 12, 16, 24, or 28.
  • size: indicates the capacity of a single disk, in GB. Currently, only 1675 is supported. The actual disk size is 1800, and the available size after formatting is 1675.
  • safeFormat: indicates whether the local disks of the ECS are securely formatted. The following types are supported:
    • For D1 ECSs, the value is FALSE.
    • For D2 or D3 ECSs, the value is True.
NOTE:

This field is dedicated for disk-intensive ECSs.

quota:nvme_ssd

String

The value of this parameter is in the format of {type}:{spec}:{num}:{size}:{safeFormat}.

  • type: indicates the capacity of a single NVME SSD disk attached to the ECS, which can only be 1.6 TB or 3.2 TB.
  • spec: indicates the specifications of the NVMe SSD disk, which can be large (large specifications) or lvs (small specifications).

    If spec is set to large, only I series (for example, I3) is supported.

  • num indicates the number of local disks.
  • size: indicates the capacity, in the unit of GB, of the disk used by the guest user. If the spec value is large, the value of this parameter is the size of a single disk attached to the ECS. If the value of spec is lvs, the value of size is an integer multiple of 50.
  • safeFormat: indicates whether the local disks of the ECS are securely formatted.

    If safeFormat is set to True, only I series (for example, I3) is supported.

NOTE:

This field is dedicated for ultra-high I/O ECSs.

extra_spec:io:persistent_grant

String

Specifies whether persistence is supported. The value of this parameter is true.

This parameter indicates that the ECS is persistently authorized to access the storage.

NOTE:

This field is dedicated for disk-intensive D1 ECSs.

ecs:generation

String

Specifies the generation of an ECS type.

For example, 3 in s3 indicates the general-purpose third-generation ECSs. For details about flavors and generations, see ECS Specifications in the Elastic Cloud Server User Guide.

ecs:virtualization_env_types

String

Specifies a virtualization type.

  • If the parameter value is FusionCompute, the ECS uses Xen virtualization.
  • If the parameter value is CloudCompute, the ECS uses KVM virtualization.
NOTE:

This field is optional.

cond:operation:status

String

This parameter takes effect region-wide. If an AZ is not configured in the cond:operation:az parameter, the value of this parameter is used by default. If this parameter is not set or used, the meaning of normal applies. Options:

  • normal: indicates normal commercial use of the flavor.
  • abandon: indicates that the flavor has been taken offline (not displayed).
  • sellout: indicates that the flavor has been sold out.
  • obt: indicates that the flavor is under open beta testing (OBT).
  • obt_sellout: indicates that the OBT resources are sold out.
  • promotion: indicates that the flavor is recommended (for commercial use, which is similar to normal).

cond:operation:az

String

This parameter takes effect AZ-wide. If an AZ is not configured in this parameter, the value of the cond:operation:status parameter is used by default. This parameter is in the format of "az(xx)". The value in parentheses is the flavor status in an AZ. If the parentheses are left blank, the configuration is invalid. The cond:operation:az options are the same as the cond:operation:status options.

For example, a flavor is for commercial use in AZs 0 and 3, sold out in AZ 1, for OBT in AZ 2, and is canceled in other AZs. Then, set parameters as follows:

  • cond:operation:status: abandon
  • cond:operation:az: az0(normal), az1(sellout), az2(obt), az3(normal)
NOTE:

Configure this parameter if the flavor status in an AZ is different from the cond:operation:status value.

quota:max_rate

String

Specifies the maximum bandwidth.

  • Unit: Mbit/s. If a bandwidth is in the unit of Gbit/s, it must be divided by 1,000.

quota:min_rate

String

Specifies the assured bandwidth.

  • Unit: Mbit/s. If a bandwidth is in the unit of Gbit/s, it must be divided by 1,000.

quota:max_pps

String

Specifies the maximum intranet PPS.

  • Unit: number. If a value is in the unit of 10,000, it must be divided by 10,000.

cond:operation:charge:stop

String

Specifies whether fees are billed for a stopped ECS.

  • No fees by default
  • charge
  • free

cond:operation:charge

String

Specifies a billing type.

  • All the billing types are supported if this parameter is not set.
  • period: The billing type is yearly or monthly.
  • demand: The billing type is pay-per-use.

cond:spot:operation:az

String

For sales information about spot ECSs, use the API for querying flavor sales policies.

Specifies the AZ for the flavors in spot pricing billing mode.

cond:operation:roles

String

Specifies the allowed roles.

Matched user tag (roles op_gatexxx), which is available to all users if this parameter is not set

cond:spot:operation:status

String

For sales information about spot ECSs, use the API for querying flavor sales policies.

Specifies the status of a flavor in spot pricing billing mode.

  • Equivalent to abandon if this parameter is not set.
  • normal: indicates commercial use of the flavor.
  • abandon: indicates that the VM has been taken offline.
  • sellout: indicates that the flavor has been sold out.
  • obt: indicates that the flavor is under OBT (not supported currently).
  • private: indicates that the flavor is private, which is available only to specified users (not supported currently).
  • test: indicates that the flavor is at free trial phase (not supported currently).
  • promotion: indicates that the flavor is recommended.

cond:network

String

Specifies network constraints.

Network features are supported. If this parameter is not set, the default configuration on the console is used.

cond:storage

String

Specifies storage constraints.

Disk features are supported. If this parameter is not set, the default configuration on the console is used.

  • scsi: indicates that SCSI is supported.
  • localdisk: indicates that local disks are supported.
  • ib: indicates that IB is supported.

cond:storage:type

String

Specifies supported disk types. If you do not specify this parameter, the configuration on the console is used.

  • SATA: common I/O disks (sold out)
  • SAS: high I/O disks
  • GPSSD: General Purpose SSDs
  • SSD: ultra-I/O disks
  • ESSD: extreme SSDs
  • GPSSD2: General Purpose SSD V2
  • ESSD2: extreme SSD V2

cond:compute:live_resizable

String

Specifies computing constraints.

  • If the value of this parameter is true, online capacity expansion is supported.
  • If this parameter does not exist or its value is set to false, online capacity expansion is not supported.

cond:compute

String

Specifies computing constraints.

  • autorecovery: indicates that automatic recovery is supported.
  • If this parameter does not exist, automatic recovery is not supported.

ecs:instance_architecture

String

Specifies the CPU architecture corresponding to the flavor. This parameter is returned only for Kunpeng ECSs.

The value arm64 indicates that the CPU architecture is Kunpeng.

info:gpu:name

String

Specifies the number and names of GPUs.

info:cpu:name

String

Specifies the CPU name.

quota:gpu

String

Specifies the GPU name.

quota:vif_max_num

String

Specifies the maximum number of elastic network interfaces that can be bound to an ECS.

quota:sub_network_interface_max_num

String

Specifies the maximum number of auxiliary network interfaces that can be bound to an ECS.

network_interface:traffic_mirroring_supported

String

Specifies whether the flavor supports traffic mirroring.

security:enclave_supported

String

Specifies whether the flavor supports QingTian Enclave.

info:gpus

String

Specifies information about the GPU.

  • name: GPU name
  • memory_mb: GPU memory
  • count: the number of GPUs
  • alias_prefix: internal alias of a GPU

info:asic_accelerators

String

Specifies information about the accelerator.

  • name: accelerator name
  • memory_mb: accelerator memory
  • count: the number of accelerators
  • alias_prefix: internal alias of an accelerator
Table 7 attachableQuantity field description

Parameter

Type

Description

free_scsi

Integer

Specifies the number of SCSI disks that can be attached.

free_blk

Integer

Specifies the number of VBD disks that can be attached.

free_disk

Integer

Specifies the number of disks that can be attached.

free_nic

Integer

Specifies the number of NICs that can be attached.

For more information, see "ECS Specifications and Types" in the Elastic Cloud Server User Guide.

Example Request

Query details about ECS flavors and extended flavor information.

GET https://{endpoint}/v1/{project_id}/cloudservers/flavors?availability_zone=availability_value

Example Response

{
    "flavors": [
        {
            "attachableQuantity": {
                "free_scsi": 60,
                "free_blk": 24,
                "free_disk": 60,
                "free_nic": 12
            },
            "id": "c3.2xlarge.2",
            "name": "c3.2xlarge.2",
            "vcpus": "8",
            "ram": 16384,
            "disk": "0",
            "swap": "",
            "links": [
                {
                    "rel": "self",
                    "href": "https://ecs.region.example.com/v1.0/743b4c0428d94531b9f2add666642e6b/flavors/c3.2xlarge.2",
                    "type": null
                },
                {
                    "rel": "bookmark",
                    "href": "https://ecs.region.example.com/743b4c0428d94531b9f2add666642e6b/flavors/c3.2xlarge.2",
                    "type": null
                }
            ],
            "OS-FLV-EXT-DATA:ephemeral": 0,
            "rxtx_factor": 1,
            "OS-FLV-DISABLED:disabled": false,
            "rxtx_quota": null,
            "rxtx_cap": null,
            "os-flavor-access:is_public": true,
            "os_extra_specs": {
                "ecs:virtualization_env_types": "CloudCompute",
                "ecs:generation": "c3",
                "ecs:instance_architecture":"arm64" ,
                "ecs:performancetype": "computingv3",
                "resource_type": "IOoptimizedC3_2"
            }
        }
    ]                              
}

Error Codes

See Error Codes.