• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Server Groups
  6. Creating an ECS Group

Creating an ECS Group

Function Description

This interface is used to create an ECS group.

URI

  • URI format

    POST /v2/{tenant_id}/os-server-groups

    POST /v2.1/{tenant_id}/os-server-groups

  • Parameter description

    Parameter

    Mandatory

    Description

    tenant_id

    Yes

    Specifies the tenant or project ID.

Restrictions

Only anti-affinity groups are supported.

Request

Parameter

Type

Mandatory

Description

server_group

Dict

Yes

Specifies the ECS group information.

Table 1 server_group field description

Parameter

Type

Mandatory

Description

name

String

Yes

Specifies the ECS group name. The value contains 1 to 255 characters.

policies

List(String)

Yes

Specifies the policies associated with an ECS group. Options:

  • anti-affinity: ECSs in this group must be deployed on different hosts.
  • affinity: ECSs in this group must be deployed on the same host.
  • soft-anti-affinity: ECSs in this group are deployed on different hosts if possible. If the ECSs cannot be deployed on different hosts, deploy them based on the actual condition for successful ECS creation. This policy is newly added in version 2.15.
  • soft-affinity: ECSs in this group are deployed on the same host if possible. If the ECSs cannot be deployed on the same host, deploy them based on the actual condition for successful ECS creation. This policy is newly added in version 2.15.
    NOTE:

    Only the anti-affinity policy is supported.

Response

Parameter

Type

Mandatory

Description

server_group

Dict

Yes

Specifies the ECS group information.

Table 2 server_group field description

Parameter

Type

Mandatory

Description

id

String

Yes

Specifies the ECS group UUID.

name

String

Yes

Specifies the ECS group name.

policies

List(String)

Yes

Specifies the policies associated with an ECS group. Options:

anti-affinity: ECSs in this group must be deployed on different hosts.

affinity: ECSs in this group must be deployed on the same host.

soft-anti-affinity: ECSs in this group are deployed on different hosts if possible. If the ECSs cannot be deployed on different hosts, deploy them based on the actual condition for successful ECS creation. This policy is newly added in version 2.15.

soft-affinity: ECSs in this group are deployed on the same host if possible. If the ECSs cannot be deployed on the same host, deploy them based on the actual condition for successful ECS creation. This policy is newly added in version 2.15.

members

List(String)

Yes

Specifies the ECSs in an ECS group.

metadata

Dict

Yes

Specifies the ECS group metadata.

project_id

String

Yes

Specifies the tenant ID in UUID format for the ECS group.

NOTE:

This parameter is added in micro version 2.13.

user_id

String

Yes

Specifies the user ID in UUID format for the ECS group.

NOTE:

This parameter is added in micro version 2.13.

Example Request

POST /v2/9c53a566cb3443ab910cf0daebca90c4/os-server-groups
POST /v2.1/9c53a566cb3443ab910cf0daebca90c4/os-server-groups
{
    "server_group": {
        "name": "test",
        "policies": ["anti-affinity"]
    }
}

Example Response

{
    "server_group": {
        "id": "5bbcc3c4-1da2-4437-a48a-66f15b1b13f9",
        "name": "test",
        "policies": [
            "anti-affinity"
        ],
        "members": [],
        "metadata": {}
    }
}

Returned Value

See General Request Returned Values.