Resource pools in solaris 10/solaris 11 provides a mechanism to assign processor set and scheduling class to non-global zone. The resource pool framework is as shown in the figure below. The dynamic resource pools comes in extremely useful when you have a variable load on zones and you want to dynamically change the resource allocation to these zones. Unlike the capped CPU allocation, dynamic resource pool allocation to zones is online and can be changed any time online.
Configuring dynamic resource pools in Solaris zones
The resource pool configuration allows us to dynamically configure CPU resources to the zones without rebooting the zones. By default when dynamic resource pool is enabled on a system, it would have a default processor set and a default pool already configured with all CPU resources in it. Let us now see how we can configure new processor sets and pools and bind them to the 2 zones, zone01 and zone02.
Enable the dynamic resource pool service :
global # svcadm enable /system/pools/dynamic
Make sure the poold daemon is running
global # pooladm pooladm: couldn't open pools state file: Facility is not active
global # pooladm -e
If you check pooladm command now, you would see a default pool and a default processor set already configure with all the CPUs in it.
global # pooladm system default string system.comment int system.version 1 boolean system.bind-default true string system.poold.objectives wt-load pool pool_default int pool.sys_id 0 boolean pool.active true boolean pool.default true int pool.importance 1 string pool.comment pset pset_default pset pset_default int pset.sys_id -1 boolean pset.default true uint pset.min 1 uint pset.max 65536 string pset.units population uint pset.load 15 uint pset.size 4 string pset.comment cpu int cpu.sys_id 1 string cpu.comment string cpu.status on-line cpu int cpu.sys_id 3 string cpu.comment string cpu.status on-line cpu int cpu.sys_id 0 string cpu.comment string cpu.status on-line cpu int cpu.sys_id 2 string cpu.comment string cpu.status on-line
Save the in memory pool configuration to /etc/pooladm.conf. This is required only if you are enabling the resource pool daemon fro the first time.
global # pooladm -s
Create a configuration file /var/tmp/pool.conf to create the resource pool from. Here we are creating 2 pools pool01 and pool02 with below configuration
Pool name - pool01 processor set name - pset01 Min. Processors - 1 Max Processors - 1 Pool name - pool02 processor set name - pset02 Min. Processors - 1 Max Processors - 2
global # cat /var/tmp/pool.conf create pset pset01 (uint pset.min = 1; uint pset.max = 1) create pool pool01 associate pool pool01 (pset pset01) create pset pset02 (uint pset.min = 1; uint pset.max = 2) create pool pool02 associate pool pool02 (pset pset02)
Flush the in-memory configuration
global # pooladm -x
save the blank configuration to /etc/pooladm.conf
global # pooladm -s
Save the /var/tmp/pool.conf config as /etc/pooladm.conf.
Create the 2 pools from the configuration file we just created
global # poolcfg -f /var/tmp/pool.cfg
Activate the new /etc/pooladm.conf config :
global # pooladm -c
If you check pooladm now, you would see the 2 pools created with respective processor sets.
# pooladm system default string system.comment int system.version 1 boolean system.bind-default true string system.poold.objectives wt-load pool pool01 int pool.sys_id 1 boolean pool.active true boolean pool.default false int pool.importance 1 string pool.comment pset pset01 pool pool_default int pool.sys_id 0 boolean pool.active true boolean pool.default true int pool.importance 1 string pool.comment pset pset_default pool pool02 int pool.sys_id 2 boolean pool.active true boolean pool.default false int pool.importance 1 string pool.comment pset pset02 pset pset01 int pset.sys_id 1 boolean pset.default false uint pset.min 1 uint pset.max 1 string pset.units population uint pset.load 0 uint pset.size 1 string pset.comment cpu int cpu.sys_id 2 string cpu.comment string cpu.status on-line pset pset_default int pset.sys_id -1 boolean pset.default true uint pset.min 1 uint pset.max 65536 string pset.units population uint pset.load 8 uint pset.size 1 string pset.comment cpu int cpu.sys_id 3 string cpu.comment string cpu.status on-line pset pset02 int pset.sys_id 2 boolean pset.default false uint pset.min 1 uint pset.max 2 string pset.units population uint pset.load 0 uint pset.size 2 string pset.comment cpu int cpu.sys_id 1 string cpu.comment string cpu.status on-line cpu int cpu.sys_id 0 string cpu.comment string cpu.status on-line
Configure both the zones and assign the pools to respective zones :
global # zoneadm list -ivc ID NAME STATUS PATH BRAND IP 0 global running / solaris shared 3 zone01 running /rpool/zone01 solaris excl 4 zone02 running /rpool/zone02 solaris excl
global # zonecfg -z zone01 zonecfg:zone01> set pool=pool01 zonecfg:zone01> verify zonecfg:zone01> commit zonecfg:zone01> exit
global # zonecfg -z zone02 zonecfg:zone02> set pool=pool02 zonecfg:zone02> verify zonecfg:zone02> commit zonecfg:zone02> exit
The above pool binding to zones takes effect after reboot and persist across reboots, but to make the pool binding effective immediately :
global # poolbind -p pool01 -i zoneid zone01 global # poolbind -p pool02 -i zoneid zone02
Now check the processor assignment to the zones :
global # zlogin zone01 psrinfo -p 1
global # zlogin zone02 psrinfo -p 2
Resource management in solaris zones : CPU shares, capped CPU, Dedicated CPU assignment
Resource management in solaris zones : Dynamic Resource pools
Resource management in solaris zones : Capped memory
Solaris Zones : How To Change The Number Of CPUs Using Dynamic Resource Pools