CREATE RESOURCE UNIT

2023-12-25 08:49:41  Updated

Purpose

You can use this statement to create a resource unit, which defines the specifications of hardware resources and is used to allocate hardware resources to tenants.

Unit specifications specify the total amount of allocatable resources on a single server in a single zone. A tenant can store data on a server only when the tenant has a resource unit on the server.

The total amount of resources allocated to a tenant is calculated as follows: Unit specifications × Unit quantity.

Syntax

CREATE RESOURCE UNIT unit_name
MEMORY_SIZE [=] 'size_value',
MAX_CPU [=] cpu_num,
[MAX_IOPS [=] iops_num,]
[MIN_CPU [=] cpu_num,]
[MIN_IOPS [=] iops_num,]
[IOPS_WEIGHT [=]iopsweight,]
[LOG_DISK_SIZE [=] 'size_value'];

Parameters

Parameter Description
MEMORY_SIZE The memory size for the resource unit. Minimum value: 1G.
MAX_CPU The maximum number of CPU cores for the resource unit. Minimum value: 1C.
MAX_IOPS The maximum number of input/output operations per second (IOPS). This parameter is optional. Minimum value: 1024.
MIN_CPU The minimum number of CPU cores for the resource unit. This parameter is optional. By default, the value of this parameter is equal to the value of MAX_CPU. Minimum value: 1C.
MIN_IOPS The minimum number of IOPS. This parameter is optional. Minimum value: 1024.
IOPS_WEIGHT The weight of the specified IOPS. This parameter is optional.
LOG_DISK_SIZE The log disk size for the resource unit. The default value is three times the specified memory size. Minimum value: 2G.

Examples

Create a resource unit named unit1 with the following configurations: a maximum of 4 CPU cores, 5 GB of memory, a maximum of 1280 IOPS, 10 GB of log disk size, and IOPS weight of 1.

obclient> CREATE RESOURCE UNIT unit1 MAX_CPU 4, MEMORY_SIZE '5G', MAX_IOPS 1280,LOG_DISK_SIZE '10G', MIN_IOPS=1024, IOPS_WEIGHT=1;
Query OK, 0 rows affected

Contact Us