REST API - create

vcenter resource pool: create

Creates a resource pool. This operation was added in vSphere API 7.0.0.0.

Request:

HTTP request

POST https://{server}/rest/vcenter/resource-pool

Request Body Structure:

{
    "spec"{
        "parent""obj-103",
        "name""string",
        "memory_allocation"{
            "shares"{
                "shares"1,
                "level""LOW"
            },
            "expandable_reservation"true,
            "limit"1,
            "reservation"1
        },
        "cpu_allocation"{
            "shares"{
                "shares"1,
                "level""LOW"
            },
            "expandable_reservation"true,
            "limit"1,
            "reservation"1
        }
    }
}

Request Body Parameters:

Name Type Description
bold = required
spec create_spec Specification of the new resource pool to be created, see vcenter.resource_pool.create_spec.
spec.name string Name of the resource pool. This attribute was added in vSphere API 7.0.0.0.

spec.parent string Parent of the created resource pool. This attribute was added in vSphere API 7.0.0.0.

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: ResourcePool. When operations return a value of this structure as a result, the field will be an identifier for the resource type: ResourcePool.

spec.cpu_allocation resource_allocation_create_spec Resource allocation for CPU. This attribute was added in vSphere API 7.0.0.0.

Optional. if unset or empty, use the default CPU allocation specification.

spec.cpu_allocation.reservation long Amount of resource that is guaranteed available to a resource pool. Reserved resources are not wasted if they are not used. If the utilization is less than the reservation, the resources can be utilized by other running virtual machines. Units are MB fo memory, and MHz for CPU. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset or empty, vcenter.resource_pool.resource_allocation_create_spec.reservation will be set to 0.

spec.cpu_allocation.expandable_reservation boolean In a resource pool with an expandable reservation, the reservation can grow beyond the specified value, if the parent resource pool has unreserved resources. A non-expandable reservation is called a fixed reservation. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset or empty, vcenter.resource_pool.resource_allocation_create_spec.expandable_reservation will be set to true.

spec.cpu_allocation.limit long The utilization of a resource pool will not exceed this limit, even if there are available resources. This is typically used to ensure a consistent performance of resource pools independent of available resources. If set to -1, then there is no fixed limit on resource usage (only bounded by available resources and shares). Units are MB for memory, and MHz for CPU. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset or empty, vcenter.resource_pool.resource_allocation_create_spec.limit will be set to -1.

spec.cpu_allocation.shares shares_info Shares are used in case of resource contention. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset or empty, vcenter.resource_pool.resource_allocation_create_spec.shares will be set to 'NORMAL'.

spec.cpu_allocation.shares.level string The allocation level. It maps to a pre-determined set of numeric values for shares. If the shares value does not map to a predefined size, then the level is set as CUSTOM. This attribute was added in vSphere API 7.0.0.0.

Defines the possible values for the allocation level. This enumeration was added in vSphere API 7.0.0.0. Value is one of:
LOW: For CPU: Shares = 500 * number of virtual CPUs.
For Memory: Shares = 5 * virtual machine memory size in MB.
. This constant was added in vSphere API 7.0.0.0.
NORMAL: For CPU: Shares = 1000 * number of virtual CPUs.
For Memory: Shares = 10 * virtual machine memory size in MB.
. This constant was added in vSphere API 7.0.0.0.
HIGH: For CPU: Shares = 2000 * nmumber of virtual CPUs.
For Memory: Shares = 20 * virtual machine memory size in MB.
. This constant was added in vSphere API 7.0.0.0.
CUSTOM: If set, in case there is resource contention the server uses the shares value to determine the resource allocation. This constant was added in vSphere API 7.0.0.0.

spec.cpu_allocation.shares.shares long When vcenter.resource_pool.shares_info.level is set to CUSTOM, it is the number of shares allocated. Otherwise, this value is ignored.

There is no unit for this value. It is a relative measure based on the settings for other resource pools.

. This attribute was added in vSphere API 7.0.0.0.

Optional. It is only relevant when level has value CUSTOM. This field is optional and it is only relevant when the value of level is CUSTOM.

spec.memory_allocation resource_allocation_create_spec Resource allocation for memory. This attribute was added in vSphere API 7.0.0.0.

Optional. if unset or empty, use the default memory allocation specification.

spec.memory_allocation.reservation long Amount of resource that is guaranteed available to a resource pool. Reserved resources are not wasted if they are not used. If the utilization is less than the reservation, the resources can be utilized by other running virtual machines. Units are MB fo memory, and MHz for CPU. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset or empty, vcenter.resource_pool.resource_allocation_create_spec.reservation will be set to 0.

spec.memory_allocation.expandable_reservation boolean In a resource pool with an expandable reservation, the reservation can grow beyond the specified value, if the parent resource pool has unreserved resources. A non-expandable reservation is called a fixed reservation. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset or empty, vcenter.resource_pool.resource_allocation_create_spec.expandable_reservation will be set to true.

spec.memory_allocation.limit long The utilization of a resource pool will not exceed this limit, even if there are available resources. This is typically used to ensure a consistent performance of resource pools independent of available resources. If set to -1, then there is no fixed limit on resource usage (only bounded by available resources and shares). Units are MB for memory, and MHz for CPU. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset or empty, vcenter.resource_pool.resource_allocation_create_spec.limit will be set to -1.

spec.memory_allocation.shares shares_info Shares are used in case of resource contention. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset or empty, vcenter.resource_pool.resource_allocation_create_spec.shares will be set to 'NORMAL'.

spec.memory_allocation.shares.level string The allocation level. It maps to a pre-determined set of numeric values for shares. If the shares value does not map to a predefined size, then the level is set as CUSTOM. This attribute was added in vSphere API 7.0.0.0.

Defines the possible values for the allocation level. This enumeration was added in vSphere API 7.0.0.0. Value is one of:
LOW: For CPU: Shares = 500 * number of virtual CPUs.
For Memory: Shares = 5 * virtual machine memory size in MB.
. This constant was added in vSphere API 7.0.0.0.
NORMAL: For CPU: Shares = 1000 * number of virtual CPUs.
For Memory: Shares = 10 * virtual machine memory size in MB.
. This constant was added in vSphere API 7.0.0.0.
HIGH: For CPU: Shares = 2000 * nmumber of virtual CPUs.
For Memory: Shares = 20 * virtual machine memory size in MB.
. This constant was added in vSphere API 7.0.0.0.
CUSTOM: If set, in case there is resource contention the server uses the shares value to determine the resource allocation. This constant was added in vSphere API 7.0.0.0.

spec.memory_allocation.shares.shares long When vcenter.resource_pool.shares_info.level is set to CUSTOM, it is the number of shares allocated. Otherwise, this value is ignored.

There is no unit for this value. It is a relative measure based on the settings for other resource pools.

. This attribute was added in vSphere API 7.0.0.0.

Optional. It is only relevant when level has value CUSTOM. This field is optional and it is only relevant when the value of level is CUSTOM.

Response:

HTTP Status Code: 200

Representation:

{
    "value""obj-103"
}

Response Type:

Name Type Description
bold = required
value string The identifier of the newly created resource pool.

Errors:

HTTP Status Code Type Description
500 error If the system reports an error while responding to the request.
400 invalid_argument If a parameter passed in the spec is invalid.
404 not_found If the resource specified in parent could not be found
500 resource_inaccessible If the specified resource in parent is not accessible.
503 service_unavailable If the system is unable to communicate with a service to complete the request.
500 unable_to_allocate_resource if any of the resources needed to create the resource pool could not be allocated.
401 unauthenticated If the user can not be authenticated.
403 unauthorized If the user doesn't have the required privileges.