The resources available to a tenant are limited by the specified resource units. If the existing resource unit configurations cannot meet the needs of the new tenant, you can create a new resource unit configuration.
Limitations
Only the sys tenant can create resource units.
Procedure
Log on to the
systenant of the cluster as therootuser.Execute the following statement to create a resource unit.
Sample statement:
CREATE RESOURCE UNIT unitname MAX_CPU [=] cpunum, [MIN_CPU [=] cpunum,] MEMORY_SIZE [=] memsize, [MAX_IOPS [=] iopsnum, MIN_IOPS [=] iopsnum,IOPS_WEIGHT [=]iopsweight,] [LOG_DISK_SIZE [=] logdisksize];Notes:
MAX_CPUandMIN_CPUspecify the maximum and minimum CPU resources that can be provided by a resource unit that uses the resource unit configuration. The minimum CPU specification is 1C.MAX_CPUmust be specified, whileMIN_CPUis optional. If you do not specifyMIN_CPU, the value equals that ofMAX_CPUby default.MEMORY_SIZEspecifies the size of memory that can be provided by a resource unit that uses the resource unit configuration. The minimum value is1G.The minimum values of
MAX_IOPSandMIN_IOPSare both1024, and the value ofMAX_IOPSmust be greater than or equal to that ofMIN_IOPS. If you do not specify these parameters, the system automatically calculates the values based on the CPU specifications.The system automatically calculates the values for the IOPS parameters based on the following rules:
If both
MIN_IOPSandMAX_IOPSare not specified, the system automatically calculates their values based on the value ofMIN_CPUby using this rule: One CPU core corresponds to 10,000 IOPS, which meansMAX_IOPS = MIN_IOPS = MIN_CPU * 10000. In this case:If
IOPS_WEIGHTis not specified,IOPS_WEIGHT = MIN_CPU.If
IOPS_WEIGHTis specified, the specified value takes precedence.
If only
MAX_IOPSis specified,MIN_IOPSuses the value ofMAX_IOPS. Similarly, if onlyMIN_IOPSis specified,MAX_IOPSuses the value ofMIN_IOPS. In this case:- If
IOPS_WEIGHTis not specified, the value is0by default.
- If
LOG_DISK_SIZEspecifies the log disk size. If this parameter is not specified, the default value is three times the memory size. The minimum value is2G.When you specify a value for a parameter, you can use a number without quotation marks ('), a number and a unit enclosed in quotation marks, or a number enclosed in quotation marks, for example,
'1T','1G','1M', or'1K'.Parameters:
For integer parameters such as
MAX_CPU,MIN_CPU,MAX_IOPS,MIN_IOPS, andIOPS_WEIGHT, if the parameter value is a number and a letter enclosed in quotation marks, the letter is an abbreviation of thousand, million, and the like. For example, '1K' = 1000, and '1M' = 1000,000. For example,MAX_IOPS='2K'is equivalent toMAX_IOPS=2000.If you use a number enclosed in quotation marks, the meaning is the same as that without quotation marks. For example, '100' = 100, and '1000' = 1000.
For capacity parameters such as
MEMORY_SIZEandLOG_DISK_SIZE, if you use a number and a unit enclosed in quotation marks, the unit is byte. For example, '1K' = 1024, and '1M' = 1024 * 1024.If you use a number enclosed in quotation marks, the unit is MB by default, For example, '100' = '100M' = 100 * 1024 * 1024.
Create a resource unit named
unit1.obclient> CREATE RESOURCE UNIT unit1 MAX_CPU 1, MIN_CPU 1, MEMORY_SIZE '2G', MAX_IOPS 1024, MIN_IOPS 1024, IOPS_WEIGHT 0, LOG_DISK_SIZE '2G'; obclient> CREATE RESOURCE UNIT unit1 MAX_CPU 1, MEMORY_SIZE '2G';A resource unit configuration is a template of resource units that can be used by different resource pools. For example, after you create the resource unit
unit1, you can use the resource configuration ofunit1to create resource poolspool1andpool2.
What to do next
After a resource unit is created, the administrator can specify the resource unit when the administrator creates a resource pool and allocate it to the corresponding tenant. For more information about how to create a resource pool, see Create a resource pool.
More information
For more information about how to manage resource units, see the following topics: