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,]
[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 the MIN_CPU parameter is equal to that of the MAX_CPU parameter. Minimum value: 1C. |
| MIN_IOPS | The minimum number of IOPS. This parameter is optional. Minimum value: 1024. |
| LOG_DISK_SIZE | The log disk size for the resource unit. The default value is three times the specified memory size. The minimum value is 2G. |
Examples
Create a resource unit named unit1 with the following specifications: CPU cores: 4; memory size: 5 GB; IOPS: 128; disk size: 10 GB.
obclient> CREATE RESOURCE UNIT unit1 MAX_CPU 4, MEMORY_SIZE '5G', MAX_IOPS 1280,LOG_DISK_SIZE '10G', MIN_IOPS=1024;
Query OK, 0 rows affected