Obtaining Resource Pools

Function

This API is used to obtain resource pools.

URI

GET /v2/{project_id}/pools

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

workspaceId

No

String

Workspace ID. The default value is 0.

labelSelector

No

String

Filter by label.

status

No

String

Resource pool status. The options are as follows:

  • created: The resource pool is successfully created.

  • failed: The resource pool failed.

  • creating: The resource pool is being created.

parent

No

String

Name of the parent resource pool. It is used to query the sub-pools of a specified resource pool.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

apiVersion

String

API version. Options:

  • v2

kind

String

Resource type. Options:

  • PoolList: resource pools

items

Array of Pool objects

Resource pools.

Table 4 Pool

Parameter

Type

Description

apiVersion

String

API version. Options:

  • v2

kind

String

Resource type. Options:

  • Pool: resource pool

metadata

PoolMetadata object

Metadata of a resource pool.

spec

PoolSpec object

Description of a resource pool.

status

PoolStatus object

Status of a resource pool.

Table 5 PoolMetadata

Parameter

Type

Description

name

String

Automatically generated resource pool name, which is equivalent to pool ID.

creationTimestamp

String

Timestamp, for example, 2021-11-01T03:49:41Z.

labels

PoolMetaLabels object

Resource pool labels.

annotations

PoolMetaAnnotations object

Resource pool annotations.

Table 6 PoolMetaLabels

Parameter

Type

Description

os.modelarts/workspace.id

String

Workspace ID

os.modelarts/name

String

Resource pool name specified by the user.

os.modelarts/resource.id

String

Resource ID of the resource pool.

os.modelarts/tenant.domain.id

String

ID of the tenant corresponding to the resource pool, which records the tenant account where the resource pool is created

os.modelarts/create-from

String

Source of a resource pool, for example, admin-console, indicating that the resource pool is created by the administrator on the ModelArts console

os.modelarts.pool/biz

String

Business type of a resource pool. The value can be public or private.

os.modelarts/sharing

String

Whether the resource pool can be shared. Options:

  • unshared: It cannot be shared.

  • shared: It can be shared.

Table 7 PoolMetaAnnotations

Parameter

Type

Description

os.modelarts/description

String

Description of a resource pool.

os.modelarts/billing.mode

String

Billing mode.

os.modelarts/flavor.resource.ids

String

Resource ID corresponding to each flavor.

os.modelarts/tms.tags

String

Resource tags specified by the user during resource pool creation.

os.modelarts/scheduler.extension

String

Priority that can be set for the jobs delivered by other users to the shared resource pool

os.modelarts/volcano.scheduler.cabinet-exclusive.enabled

String

Whether a resource pool that is not provisioned for an entire cabinet can deliver the job of an entire cabinet. If this annotation exists, the resource pool can deliver such a job. By default, a resource pool provisioned for an entire cabinet (that is, creatingStep resources of the rack type) supports this function.

os.modelarts.pool/scope.external.dependency.Train

String

External dependency ID of training.

os.modelarts.pool/scope.external.dependency.Infer

String

External dependency ID of inference.

os.modelarts.pool/scope.external.dependency.Notebook

String

External dependency ID of the development environment.

Table 8 PoolSpec

Parameter

Type

Description

type

String

Resource pool type. The options are as follows:

  • Dedicate: physical resource pool, which uses a separate network and supports network connection, custom drivers, and custom job types.

scope

Array of strings

Job type enabled. Options:

  • Train: training jobs

  • Infer: inference jobs

    [- Notebook: notebook jobs](tags: hc)

resources

Array of PoolResource objects

Resource flavor list in a resource pool, including resource flavors, the number of resources for each flavor, and node pool information.

network

PoolNetwork object

Network settings for a resource pool. This parameter is mandatory for physical resource pools.

containerNetwork

PoolClusterContainerNetwork object

Kubernetes container network

kubernetesSvcIpRange

String

CIDR of the Kubernetes service network segment

masters

Array of PoolClusterMaster objects

Master node parameters in a resource pool. This parameter is optional for physical resource pools.

clusterFlavor

String

Cluster flavor of a standard pool.

driver

PoolDriver object

Resource pool driver.

Table 9 PoolResource

Parameter

Type

Description

flavor

String

Resource flavor name, for example, modelarts.vm.gpu.tnt004.

count

Integer

Minimum count for the flavors in a resource pool.

maxCount

Integer

Elastic usage of the resource flavor. This parameter value is the same the count value in a physical pool.

azs

Array of PoolNodeAz objects

AZ where resource pool nodes are deployed.

tags

Array of UserTag objects

Resource tags.

extendParams

PoolResourceExtendParams object

Custom configuration, for example, setting dockerSize for the node.

creatingStep

CreatingStep object

Batch creation information.

rootVolume

RootVolume object

Custom system disk (cloud hard disk) information.

dataVolumes

Array of DataVolumeItem objects

List of custom data disks (cloud hard disks).

volumeGroupConfigs

Array of VolumeGroupConfig objects

Advanced disk configurations. This parameter is mandatory when a custom data disk exists.

Table 10 UserTag

Parameter

Type

Description

key

String

Key. The value cannot start with CCE- or __type_baremetal.

value

String

Value.

Table 11 PoolResourceExtendParams

Parameter

Type

Description

dockerBaseSize

String

Size of the container image space on a node.

postInstall

String

Post-installation script. The entered value must be encoded using Base64.

Table 12 RootVolume

Parameter

Type

Description

volumeType

String

Disk type. The options are as follows:

  • SSD: ultra-high I/O disk

  • GPSSD: general-purpose SSD

  • SAS: high I/O disk

size

String

Disk size, in GiB.

Table 13 DataVolumeItem

Parameter

Type

Description

volumeType

String

Disk type. The options are as follows:

  • SSD: ultra-high I/O disk

  • GPSSD: general-purpose SSD

  • SAS: high I/O disk

size

String

Disk size, in GiB.

count

Integer

Number of disks.

extendParams

VolumeExtendParams object

Custom disk configuration.

Table 14 VolumeExtendParams

Parameter

Type

Description

volumeGroup

String

Name of a disk group, which is used to divide storage space. The options are as follows:

  • vgpaas: container disk.

  • default: common data disk, which is mounted in default mode.

  • vguser{num}: common data disk, which is mounted to a specified path. The group name varies depending on the path, for example, vguser1 and vguser2.

  • vg-everest-localvolume-persistent: common data disk, which is used as the persistent storage volume.

  • vg-everest-localvolume-ephemeral: common data disk, which is used as a temporary storage volume.

Table 15 VolumeGroupConfig

Parameter

Type

Description

volumeGroup

String

Disk group name. Index of the volume group in the dataVolumes.

dockerThinPool

Integer

Percentage of container disks to data disks on nodes in a resource pool. This parameter can be specified only when volumeGroup is vgpaas (container disk).

lvmConfig

LvmConfig object

LVM configuration management.

types

Array of strings

Storage type. The options are as follows:

  • volume: cloud hard disk. When dataVolumes is specified, the default value is used.

  • local: local disk. This parameter must be specified when a local disk is used.

Table 16 LvmConfig

Parameter

Type

Description

lvType

String

LVM write mode. The options are as follows:

  • linear: linear mode.

  • striped: striped mode in which multiple disks are used to form a strip to improve disk performance.

path

String

Disk mount path. This parameter takes effect only in user configuration. The value is an absolute path. Digits, letters, periods (.), hyphens (-), and underscores (_) are allowed.

Table 17 PoolNetwork

Parameter

Type

Description

name

String

Network name. The value is obtained from the metadata.name field in the network resource details.

Table 18 PoolClusterContainerNetwork

Parameter

Type

Description

mode

String

Container network model. The options are as follows:

  • overlay_l2: an overlay_l2 network (container tunnel network) built for containers by using OpenVSwitch (OVS).

  • vpc-router: an underlay_l2 network built for containers by using IPvlan and custom VPC routes.

  • eni: Cloud Native Network 2.0. This model deeply integrates the native ENI capability of VPC, uses the VPC CIDR block to allocate container addresses, and supports passthrough networking. You can use this model when creating a CCE Turbo cluster.

cidr

String

Container network segment. This parameter is valid only when the container network model is overlay_l2 or vpc-router.

Table 19 PoolClusterMaster

Parameter

Type

Description

az

String

AZ where the master node is located

Table 20 PoolDriver

Parameter

Type

Description

gpuVersion

String

GPU driver version. This parameter is available when GPUs are used in a physical resource pool. For example, the GPU driver version is 440.33.

npuVersion

String

NPU driver version.

updateStrategy

String

Driver upgrade policy. Options:

  • force: forcible upgrade. The node drivers are upgraded immediately, which may affect jobs running on the node.

  • idle: secure upgrade. The drivers are upgraded when no job is running on the node.

Table 21 PoolStatus

Parameter

Type

Description

phase

String

Resource pool status. Options:

  • Creating: The resource pool is being created.

  • Running: The resource pool is running.

  • Abnormal: The resource pool malfunctions.

  • Deleting: The resource pool is being deleted.

  • Error: An error occurred in the resource pool.

  • CreationFailed: Creating the resource pool failed.

  • ScalingFailed: Expanding the capacity of the resource pool failed.

  • Waiting: The resource pool is awaiting creation, which is typically caused by an unpaid order or unapproved request.

message

String

Message indicating that the resource pool is in the current state.

resources

PoolResourceStatus object

The amount of resources in different states in the resource pool.

scope

Array of PoolScopeStatus objects

Service status of a resource pool.

driver

PoolDriverListStatus object

Resource pool driver.

parent

String

Name of the parent node of a resource pool. This parameter is left blank for physical pools.

root

String

Name of the root node in a resource pool. For a physical pool, the value is its name.

Table 22 PoolResourceStatus

Parameter

Type

Description

creating

Array of PoolResourceFlavorCount objects

Data model for the number of resources of the specified specifications

available

Array of PoolResourceFlavorCount objects

Data model for the number of resources of the specified specifications

abnormal

Array of PoolResourceFlavorCount objects

Data model for the number of resources of the specified specifications

deleting

Array of PoolResourceFlavorCount objects

Data model for the number of resources of the specified specifications

Table 23 PoolResourceFlavorCount

Parameter

Type

Description

flavor

String

Resource flavor name, for example, modelarts.vm.gpu.tnt004.

count

Integer

Minimum count for the specifications in a resource pool

maxCount

Integer

Elastic usage of the resource specifications. This parameter value is the same the count value in a physical pool.

azs

Array of PoolNodeAz objects

AZ where resource pool nodes are deployed.

creatingStep

CreatingStep object

Batch creation information.

Table 24 PoolNodeAz

Parameter

Type

Description

az

String

AZ name.

count

Integer

Number of nodes for expanding the capacity of a specified AZ.

Table 25 CreatingStep

Parameter

Type

Description

step

Integer

Creation step.

type

String

Batch creation type.

  • rack: entire rack

  • hyperinstance: supernodes

Table 26 PoolScopeStatus

Parameter

Type

Description

scopeType

String

Enabled job types. The options are as follows:

  • Train: training jobs

  • Infer: inference jobs

  • Notebook: notebook jobs

state

String

Service status. The options are as follows:

  • Enabling: The service is being enabled.

  • Enabled: The service has been enabled.

  • EnableFailed: The service fails to be enabled.

  • Disabling: The service is being disabled.

  • Disabled: The service has been disabled.

plugins

Array of PoolScopePluginPhase objects

Plug-in status.

message

String

Cause of the failure to enable or disable the environment.

Table 27 PoolScopePluginPhase

Parameter

Type

Description

name

String

Plug-in type.

phase

String

Plug-in status. The options are as follows:

  • Pending: The plug-in is pending.

  • Running: The plug-in is running.

  • Updating: The plug-in is being updated.

  • Abnormal: The plug-in is abnormal.

  • Deleting: The plug-in is being deleted.

Table 28 PoolDriverListStatus

Parameter

Type

Description

gpu

PoolDriverStatus object

GPU driver information.

npu

PoolDriverStatus object

NPU driver information.

Table 29 PoolDriverStatus

Parameter

Type

Description

version

String

Driver version

state

String

Driver status. Options:

  • Creating: The driver is being created.

  • Upgrading: The driver is being upgraded.

  • Running: The driver is running.

  • Abnormal: The driver malfunctions.

Example Requests

Obtain resource pools.

GET https://{endpoint}/v2/{project_id}/pools

{ }

Example Responses

Status code: 200

OK

{
  "kind" : "PoolList",
  "apiVersion" : "v2",
  "items" : [ {
    "kind" : "Pool",
    "apiVersion" : "v2",
    "metadata" : {
      "name" : "auto-pool-os-86c13962597848eeb29c5861153a391f",
      "creationTimestamp" : "2022-09-16T03:10:40Z",
      "labels" : {
        "os.modelarts/name" : "auto-pool-os",
        "os.modelarts/resource.id" : "maos-auto-pool-os-72w8d"
      },
      "annotations" : {
        "os.modelarts/description" : "",
        "os.modelarts/billing.mode" : "0",
        "os.modelarts/external-access" : "elb"
      }
    },
    "spec" : {
      "type" : "Dedicate",
      "scope" : [ "Train", "Infer" ],
      "resources" : [ {
        "flavor" : "modelarts.vm.cpu.4ud",
        "count" : 2
      } ],
      "network" : {
        "name" : "network-maos-86c13962597848eeb29c5861153a391f"
      }
    },
    "status" : {
      "phase" : "Running",
      "root" : "auto-pool-os-86c13962597848eeb29c5861153a391f",
      "scope" : [ {
        "scopeType" : "Train",
        "state" : "Enabled"
      }, {
        "scopeType" : "Infer",
        "state" : "Enabled"
      } ],
      "resources" : {
        "available" : [ {
          "flavor" : "modelarts.vm.cpu.4ud",
          "count" : 2,
          "azs" : [ {
            "az" : "az-7c",
            "count" : 2
          } ]
        } ]
      }
    }
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.