Updated on 2026-02-10 GMT+08:00

Creating a Desktop Pool

Function

Creates and assigns a desktop pool to a user or user group. When the user logs in, the user is bound to one of the desktops.

To use this function, you need to authorize the cloud service by calling the API for enabling the agency function.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    workspace:desktopPools:create

    Write

    desktopPool *

    -

    -

    • ims:images:get
    • ims:images:list
    • ims:images:share
    • ims:images:updateMemberStatus
    • ims:images:deleteMember
    • ims:images:addMember
    • vpc:networks:get
    • vpc:ports:create
    • vpc:ports:delete
    • vpc:ports:get
    • vpc:ports:update
    • vpc:securityGroups:get
    • vpc:subnets:get
    • vpc:vpcs:get
    • dss:pools:list

    user

    -

    userGroup

    -

    -

    • g:RequestTag/<tag-key>

    • g:TagKeys

    • g:EnterpriseProjectId

URI

POST /v2/{project_id}/desktop-pools

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Desktop pool name, which must be unique. The desktop name can contain 1 to 255 characters, including uppercase letters, lowercase letters, digits, and hyphens (-).

type

Yes

String

Desktop pool type. The options are DYNAMIC (dynamic pool) and STATIC (static pool).

size

Yes

Integer

Desktop pool size: number of desktops to be created in the current desktop pool.

description

No

String

Desktop pool description.

availability_zone

No

String

AZ. Desktops are created in the specified AZ.

product_id

Yes

String

Package ID.

flavor_id

No

String

Product specification ID.

image_type

Yes

String

Specifies the image type. The default value is private.

  • private: Private image.

  • gold: Public image.

image_id

Yes

String

Image ID. This parameter is used together with product_id for creating desktops using custom images.

root_volume

Yes

VolumeInfo object

System disk.

data_volumes

No

Array of VolumeInfo objects

Data disks.

vpc_id

No

String

Specifies the VPC ID when the desktop is created.

subnet_ids

Yes

Array of strings

ID of the subnet used for creating a desktop.

security_groups

No

Array of SecurityGroupIdInfo objects

Security group used by the desktop. If no security group is specified, the security group specified in the desktop agent is used by default.

authorized_objects

No

Array of AuthorizedObjects objects

Users or user groups to be authorized.

ou_name

No

String

OU name, which is used for connecting to the AD. An OU must be created in the AD in advance.

tags

No

Array of Tag objects

Tag list.

enterprise_project_id

No

String

Enterprise project ID, which is 0 by default.

disconnected_retention_period

No

Integer

Number of minutes within which the binding relationship between a user and a desktop is retained when the dynamic pool desktop is disconnected. After the binding relationship times out, the user is automatically unbound.

enable_autoscale

No

Boolean

Specifies whether to enable auto scaling for the desktop pool. The value false indicates that auto scaling is disabled, and the value true indicates that auto scaling is enabled.

autoscale_policy

No

AutoscalePolicy object

Auto scaling policy.

desktop_name_policy_id

No

String

Policy ID, which is used to specify the desktop name generation policy.

Table 3 VolumeInfo

Parameter

Mandatory

Type

Description

id

No

String

Specifies the IDs of the disks to be operated in batches.

type

Yes

String

Desktop data disk type, which must be the same as the disk type provided by the system.

  • SAS: High I/O;

  • SSD: Ultra-high I/O

size

Yes

Integer

Disk capacity in GB.

iops

No

Integer

Number of read/write operations performed by an EVS disk per second.

throughput

No

Integer

Amount of data read from and written to an EVS disk per second.

resource_spec_code

No

String

Specifications.

kms_id

No

String

KMS key ID.

Table 4 SecurityGroupIdInfo

Parameter

Mandatory

Type

Description

id

Yes

String

Security group ID.

Table 5 AuthorizedObjects

Parameter

Mandatory

Type

Description

object_type

Yes

String

Enumeration of bound object types.

  • USER: user

  • USER_GROUP: user group

object_id

Yes

String

User ID or user group ID.

object_name

Yes

String

Username or user group name.

domain

No

String

Domain name of the user/user group.

user_group

Yes

String

Specifies the user permission group to which the desktop user belongs.

  • sudo: Linux administrator group.

  • default: Default Linux user group.

  • administrators: Windows administrator group. Administrators have full access to the desktop and can make any required changes except for forbidden operations.

  • users: Standard Windows user group. Standard users can use most software programs and change system settings that do not affect other users.

created_at

No

String

Creation time.

Table 6 Tag

Parameter

Mandatory

Type

Description

key

Yes

String

Specifies the tag key. This parameter cannot be left blank and can contain a maximum of 128 Unicode characters. The value can contain uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). The value cannot contain the following characters: =*<>,|/.

value

No

String

Value of a tag, which can contain a maximum of 43 Unicode characters. The value can contain uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). The value cannot contain the following characters: =*<>,|/.

Table 7 AutoscalePolicy

Parameter

Mandatory

Type

Description

autoscale_type

No

String

Auto scaling type. The options are as follows: ACCESS_CREATED: created during access; AUTO_CREATED: auto scaling.

max_auto_created

No

Integer

Maximum number of desktops that can be automatically created.

min_idle

No

Integer

Number of reserved idle desktops.

once_auto_created

No

Integer

Number of desktops that can be automatically created at a time. (deprecated)

min_retention

No

Integer

Minimum number of desktops.

idle_retention_duration

No

Integer

Idle desktop reservation duration, in minutes.

Response Parameters

Status code: 200

Table 8 Response body parameters

Parameter

Type

Description

job_id

String

ID of the cloud desktop creation task.

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 401

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 403

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 404

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Status code: 500

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

error_detail

String

Error details.

encoded_authorization_message

String

Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason.

Example Requests

POST /v2/0bec5db98280d2d02fd6c00c2de791ce/desktop-pools

{
  "name" : "POOL01",
  "type" : "STATIC",
  "size" : 50,
  "image_type" : "gold",
  "image_id" : "a866298d-67db-44b0-a1f1-9d09bdddc20f",
  "root_volume" : {
    "type" : "SAS",
    "size" : 80
  },
  "availability_zone" : "az3.manage.x86",
  "subnet_ids" : [ "5dee0216-2260-47c2-9368-98a27d910e55" ],
  "product_id" : "workspace.c2.large.windows.2"
}

Example Responses

Status code: 200

Response to the request for creating a desktop pool.

{
  "job_id" : "3979904c-7beb-4f34-835f-2fa989a5550a"
}

Status Codes

Status Code

Description

200

Response to the request for creating a desktop pool.

400

The request cannot be understood by the server due to malformed syntax.

401

Authentication failed.

403

No operation permissions.

404

No resources found.

500

An internal service error occurred. For details about the error code, see the error code description.

Error Codes

See Error Codes.