Creating Resource Pools
Function
This API is used to create resource pools.
URI
POST /v2/{project_id}/pools
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
request-type |
No |
String |
Request source. The order function is enabled only when console is set. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
apiVersion |
Yes |
String |
API version. Options:
|
kind |
Yes |
String |
Resource type. Options:
|
metadata |
Yes |
PoolMetadataCreation object |
Metadata of a resource pool. |
spec |
No |
PoolSpecCreation object |
Description of a resource pool. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
labels |
Yes |
PoolLabelsCreation object |
Resource pool labels. |
annotations |
No |
PoolAnnotationsCreation object |
Resource pool annotations. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
os.modelarts/workspace.id |
No |
String |
Workspace ID. The default value is 0. |
os.modelarts/name |
Yes |
String |
Specified resource pool name. The value contains 4 to 25 characters, including lowercase letters, hyphens (-), and digits. |
os.modelarts/sharing |
No |
String |
Whether the resource pool can be shared. The value can be unshared or shared. |
os.modelarts/node.prefix |
No |
String |
Customized node prefix. This parameter is optional. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
os.modelarts/description |
No |
String |
Description of a resource pool |
os.modelarts/billing.mode |
No |
String |
Billing mode |
os.modelarts/order.id |
No |
String |
Order ID, which is mandatory for creating a yearly/monthly resource pool or changing the billing mode |
os.modelarts/scheduler.extension |
No |
String |
Priority that can be set for the jobs delivered by other users to the shared resource pool |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Resource pool type. The options are as follows:
|
scope |
No |
Array of strings |
Job type enabled, which cannot be specified for logical pools. Options:
|
resources |
Yes |
Array of PoolResource objects |
Resource specifications in a resource pool, including resource specifications and the number of resources for each specification |
parent |
No |
String |
Parent resource pool ID. This parameter is mandatory when a logical sub-pool is created based on a specified resource pool. |
network |
No |
PoolNetwork object |
Network settings for a resource pool. This parameter is mandatory for creating physical resource pools and is unavailable for creating logical resource pools. |
containerNetwork |
No |
PoolContainerNetwork object |
Kubernetes container network segment. Only one container network segment is supported. This parameter is optional. If this parameter is not set, the default value is specified by CCE. |
kubernetesSvcIpRange |
No |
String |
CIDR of the Kubernetes service network segment |
masters |
No |
Array of PoolClusterMaster objects |
Master node parameters in a resource pool. This parameter is optional for physical resource pools and is unavailable for logical resource pools. |
clusterFlavor |
No |
String |
Cluster flavor of a standard pool. |
driver |
No |
PoolDriver object |
Resource pool driver |
ipv6enable |
No |
Boolean |
Whether to enable IPv6 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
flavor |
Yes |
String |
Resource flavor name, for example, modelarts.vm.gpu.tnt004. |
count |
Yes |
Integer |
Minimum count for the flavors in a resource pool. |
maxCount |
No |
Integer |
Elastic usage of the resource flavor. This parameter value is the same the count value in a physical pool; It is greater than or equal to the count value in a logical pool. |
azs |
No |
Array of PoolNodeAz objects |
AZ where resource pool nodes are deployed. |
tags |
No |
Array of UserTag objects |
Resource tags. |
extendParams |
No |
PoolResourceExtendParams object |
Custom configuration, for example, setting dockerSize for the node. |
creatingStep |
No |
CreatingStep object |
Batch creation information. |
rootVolume |
No |
RootVolume object |
Custom system disk (cloud hard disk) information. |
dataVolumes |
No |
Array of DataVolumeItem objects |
List of custom data disks (cloud hard disks). |
volumeGroupConfigs |
No |
Array of VolumeGroupConfig objects |
Advanced disk configurations. This parameter is mandatory when a custom data disk exists. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
az |
Yes |
String |
AZ name. |
count |
Yes |
Integer |
Number of nodes for expanding the capacity of a specified AZ. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Key. The value cannot start with CCE- or __type_baremetal. |
value |
Yes |
String |
Value. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
dockerBaseSize |
No |
String |
Size of the container image space on a node. |
postInstall |
No |
String |
Post-installation script. The entered value must be encoded using Base64. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
step |
No |
Integer |
Creation step. |
type |
No |
String |
Batch creation type.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
volumeType |
Yes |
String |
Disk type. The options are as follows:
|
size |
Yes |
String |
Disk size, in GiB. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
volumeType |
Yes |
String |
Disk type. The options are as follows:
|
size |
Yes |
String |
Disk size, in GiB. |
count |
No |
Integer |
Number of disks. |
extendParams |
Yes |
VolumeExtendParams object |
Custom disk configuration. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
volumeGroup |
Yes |
String |
Name of a disk group, which is used to divide storage space. The options are as follows:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
volumeGroup |
Yes |
String |
Disk group name. Index of the volume group in the dataVolumes. |
dockerThinPool |
No |
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 |
No |
LvmConfig object |
LVM configuration management. |
types |
No |
Array of strings |
Storage type. The options are as follows:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
lvType |
Yes |
String |
LVM write mode. The options are as follows:
|
path |
No |
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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
Network name. The value is obtained from the metadata.name field in the network resource details. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
cidr |
No |
String |
CIDR block of the container network segment. Recommended: 10.0.0.0/12-19, 172.16.0.0/16-19, or 192.168.0.0/16-19. If the selected CIDR block conflicts with existing ones, an error will be reported. This parameter cannot be modified after the cluster is created. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
az |
No |
String |
AZ where the master node is located |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
gpuVersion |
No |
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 |
No |
String |
NPU driver version. This parameter is available when Ascend chips are used in a physical resource pool. For example, the Ascend driver version is C78. |
updateStrategy |
No |
String |
Driver upgrade policy. Options:
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
API version. Options:
|
kind |
String |
Resource type. Options:
|
metadata |
PoolMetadata object |
Metadata of a resource pool. |
spec |
PoolSpec object |
Description of a resource pool. |
status |
PoolStatus object |
Status of a resource pool. |
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. |
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:
|
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.pool/subpools.count |
String |
Number of logical sub-pools in a 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. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Resource pool type. The options are as follows:
|
scope |
Array of strings |
Job type enabled, which cannot be specified for logical pools. Options:
|
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 and is unavailable for logical resource pools. |
clusterFlavor |
String |
Cluster flavor of a standard pool. |
driver |
PoolDriver object |
Resource pool driver. |
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; It is greater than or equal to the count value in a logical 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. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Key. The value cannot start with CCE- or __type_baremetal. |
value |
String |
Value. |
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. |
Parameter |
Type |
Description |
---|---|---|
volumeType |
String |
Disk type. The options are as follows:
|
size |
String |
Disk size, in GiB. |
Parameter |
Type |
Description |
---|---|---|
volumeType |
String |
Disk type. The options are as follows:
|
size |
String |
Disk size, in GiB. |
count |
Integer |
Number of disks. |
extendParams |
VolumeExtendParams object |
Custom disk configuration. |
Parameter |
Type |
Description |
---|---|---|
volumeGroup |
String |
Name of a disk group, which is used to divide storage space. The options are as follows:
|
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:
|
Parameter |
Type |
Description |
---|---|---|
lvType |
String |
LVM write mode. The options are as follows:
|
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. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Network name. The value is obtained from the metadata.name field in the network resource details. |
Parameter |
Type |
Description |
---|---|---|
mode |
String |
Container network model. The options are as follows:
|
cidr |
String |
Container network segment. This parameter is valid only when the container network model is overlay_l2 or vpc-router. |
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. This parameter is available when Ascend chips are used in a physical resource pool. For example, the Ascend driver version is C78. |
updateStrategy |
String |
Driver upgrade policy. Options:
|
Parameter |
Type |
Description |
---|---|---|
phase |
String |
Resource pool status. Options:
|
message |
String |
Message indicating that the resource pool is in the current state. |
resources |
PoolResourceStatus object |
Left blank for logical pools, which do not need to be created. |
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. |
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 |
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; It is greater than or equal to the count value in a logical pool. |
azs |
Array of PoolNodeAz objects |
AZ where resource pool nodes are deployed. |
creatingStep |
CreatingStep object |
Batch creation information. |
Parameter |
Type |
Description |
---|---|---|
az |
String |
AZ name. |
count |
Integer |
Number of nodes for expanding the capacity of a specified AZ. |
Parameter |
Type |
Description |
---|---|---|
step |
Integer |
Creation step. |
type |
String |
Batch creation type.
|
Parameter |
Type |
Description |
---|---|---|
scopeType |
String |
Enabled job types. The options are as follows:
|
state |
String |
Service status. The options are as follows:
|
plugins |
Array of PoolScopePluginPhase objects |
Plug-in status. |
message |
String |
Cause of the failure to enable or disable the environment. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Plug-in type. |
phase |
String |
Plug-in status. The options are as follows:
|
Parameter |
Type |
Description |
---|---|---|
gpu |
PoolDriverStatus object |
GPU driver information. |
npu |
PoolDriverStatus object |
NPU driver information. |
Parameter |
Type |
Description |
---|---|---|
version |
String |
Driver version |
state |
String |
Driver status. Options:
|
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 409
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
-
Create a physical pool.
POST https://{endpoint}/v2/{project_id}/pools { "kind": "Pool", "apiVersion": "v2", "metadata": { "annotations": { "os.modelarts/description": "" }, "labels": { "os.modelarts/name": "pool-ae01", "os.modelarts/workspace.id": "0" } }, "spec": { "type": "Dedicate", "scope": [ "Train" ], "network": { "name": "network-21e1-6f5da086876d4cd084d36f8bd3346036" }, "resources": [ { "count": 1, "flavor": "modelarts.vm.cpu.8ud", } ] } }
-
Create a logical pool.
POST https://{endpoint}/v2/{project_id}/pools { "kind" : "Pool", "apiVersion" : "v1", "metadata" : { "labels" : { "os.modelarts/name" : "pool-logic-01" }, "annotations" : { "os.modelarts/description" : "", "os.modelarts/billing.mode" : 0, "os.modelarts/product.id" : "xxx" } }, "spec" : { "type" : "Logical", "scope" : [ "Train" ], "resources" : [ { "flavor" : "modelarts.vm.gpu.tnt004", "count" : 2 } ] } }
Example Responses
Status code: 200
OK
{ "kind" : "Pool", "apiVersion" : "v2", "metadata" : { "name" : "pool-ae01-6f5da086876d4cd084d36f8bd3346036", "creationTimestamp" : "2024-10-24T12:42:43Z", "labels" : { "os.modelarts/name" : "pool-ae01", "os.modelarts/workspace.id" : "0", "os.modelarts/node.prefix" : "", "os.modelarts/resource.id" : "maos-pool-ae01-d7mjs", "os.modelarts/tenant.domain.id" : "75fef1f8a9d64d0cb8de795599185b48", "os.modelarts/tenant.project.id" : "6f5da086876d4cd084d36f8bd3346036", "os.modelarts.pool/biz" : "private", "os.modelarts/create-from" : "console" }, "annotations" : { "os.modelarts/billing.mode" : "0", "os.modelarts.pool/subpools.count" : "0", "os.modelarts/flavor.resource.ids" : "{\"modelarts.vm.cpu.8ud\":\"maos.vm.cpu.8ud.1976103046\"}", "os.modelarts/tenant.domain.name" : "ei_batch_t00420620_01" } }, "spec" : { "type" : "Dedicate", "scope" : [ "Train" ], "resources" : [ { "flavor" : "modelarts.vm.cpu.8ud", "count" : 1, "maxCount" : 1 } ], "network" : { "name" : "network-21e1-6f5da086876d4cd084d36f8bd3346036" } }, "status" : { "resources" : { } } }
Status code: 400
Bad request
{ "error_code" : "ModelArts.50004000", "error_msg" : "Bad request" }
Status code: 409
Already exists
{ "error_code" : "ModelArts.50015000", "error_msg" : "Pool already exists." }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad request |
409 |
Already exists |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.