2019-12-28 Create CPU Pools



Overview

I wanted to isolate domains on my Xen server, VICTORIA .

References

Procedure

The procedure I followed can be found in “ Cpupools Howto ”.

List Initial CPU Pools

I used the following command to list the current CPU pools on VICTORIA :

xl cpupool-list

The result was:

Name               CPUs   Sched     Active   Domain count
Pool-0               8    credit       y          1

Split into NUMA Pools

I used the following command to allocate automatically the CPUs between NUMA nodes:

xl cpupool-numa-split

I used the following command to see the result:

xl cpupool-list -c

The result was:

Name               CPU list
Pool-node0         0,1,2,3,4,5,6,7

It would appear that NUMA is not used on VICTORIA

Design New CPU Pools

My design for the CPU Pools is:

CPU # CPU Pool Name VM Image
0 Pool-node0 DOM0
1 RAC1 PADSTOW
2
3 RAC2 BOTANY
4
5 OEM CRONULLA
6
7 Client AUBURN

Create New CPU Pools

I ran the following series of commands to create these new CPU pools:

[root@victoria ~]# xl cpupool-create name=\"RAC1\"
Using config file "command line"
cpupool name:   RAC1
scheduler:      credit
number of cpus: 0
[root@victoria ~]# xl cpupool-create name=\"RAC2\"
Using config file "command line"
cpupool name:   RAC2
scheduler:      credit
number of cpus: 0
[root@victoria ~]# xl cpupool-create name=\"OEM\"
Using config file "command line"
cpupool name:   OEM
scheduler:      credit
number of cpus: 0
[root@victoria ~]# xl cpupool-create name=\"Client\"
Using config file "command line"
cpupool name:   Client
scheduler:      credit
number of cpus: 0

I checked the creation of these pools with the following command:

xl cpupool-list

The result was:

Name               CPUs   Sched     Active   Domain count
Pool-node0           8    credit       y          1
RAC1                 0    credit       y          0
RAC2                 0    credit       y          0
OEM                  0    credit       y          0
Client               0    credit       y          0

Remove CPUs from Pool-node0

Before I can CPUs to these new pools, I have to remove them from the Pool-node0 CPU pool. This was done with the following commands:

xl cpupool-cpu-remove Pool-node0 1
xl cpupool-cpu-remove Pool-node0 2
xl cpupool-cpu-remove Pool-node0 3
xl cpupool-cpu-remove Pool-node0 4
xl cpupool-cpu-remove Pool-node0 5
xl cpupool-cpu-remove Pool-node0 6
xl cpupool-cpu-remove Pool-node0 7

Add CPUs to Correct Pools

I used the following commands to add the CPUs to the correct pools:

xl cpupool-cpu-add RAC1 1
xl cpupool-cpu-add RAC1 2
xl cpupool-cpu-add RAC2 3
xl cpupool-cpu-add RAC2 4
xl cpupool-cpu-add OEM 5
xl cpupool-cpu-add OEM 6
xl cpupool-cpu-add Client 7

I used the following command to verify the correct allocation of CPUs to pools:

xl cpupool-list -c

The result was:

Name               CPU list
Pool-node0         0
RAC1               1,2
RAC2               3,4
OEM                5,6
Client             7

Update Configuration Files

I updated the following configuration files with the pool="<pool_name> option:

/OVS/running_pool/PADSTOW/padstow.cfg 
/OVS/running_pool/CRONULLA/cronulla.hvm
/OVS/running_pool/BOTANY/botany.cfg
/OVS/running_pool/AUBURN/auburn.cfg

Verify Correct Allocation of CPUs to Domains

After starting these domains, I used the following command to verify that each domain was running on the properly allocated CPU:

xl vcpu-list

The result was:

Name                                ID  VCPU   CPU State   Time(s) CPU Affinity
Domain-0                             0     0    0   ---      67.8  all
Domain-0                             0     1    0   ---      40.1  all
Domain-0                             0     2    0   r--      67.7  all
Domain-0                             0     3    0   ---      34.5  all
Domain-0                             0     4    0   ---     150.1  all
Domain-0                             0     5    0   ---      77.7  all
Domain-0                             0     6    0   -b-     104.3  all
Domain-0                             0     7    0   ---      57.2  all
padstow                              1     0    1   -b-     255.6  all
cronulla                             2     0    5   -b-     293.8  all
cronulla                             2     1    6   -b-     290.8  all
botany                               3     0    3   -b-      57.5  all
auburn                               4     0    7   -b-      11.8  all