You are on page 1of 7

8/22/17 Solaris Zones : How To Change The Number Of CPUs Using Dynamic Resource Pools

THE GEEK DIARY


Solaris Zones : How To Change The Number Of CPUs Using Dynamic
HO W TO S | BAS IC S | C O N C E P TS

Resource Pools

By Sandeep (http://thegeekdiary.com/author/sandeep_patil/)

Apartments Ultra luxury 2/3 BHK apartments


on Sarjapur Road. Enquire Now
in Bangalore for a free Site visit.

Resource pools in Solaris 10/solaris 11 provide a mechanism to assign processor set and scheduling class to a
non-global zone. The resource pool framework is as shown in the figure below. The dynamic resource pools come
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 anytime online.

Note: Resource pool is an old feature and is now replace by the dedicated CPU allocation to zone, which in
turn does the same thing. It creates pools and processor sets underneath and associates them to zones. So
if you are using an update later to Solaris 10 8/07, it is better to use dedicated CPU feature of allocating
CPU to zones

(http://thegeekdiary.com/wp-content/uploads/2013/11/Resource-Pools-Framework.png)

thegeekdiary.com/solaris-zones-how-to-change-the-number-of-cpus-using-dynamic-resource-pools/ 1/7
8/22/17 Solaris Zones : How To Change The Number Of CPUs Using Dynamic Resource Pools

For this example, we will first configure a zone for dynamic resource pool usage and then demonstrate how to
change the number of CPUs of a zone from 1 to 2, then back to 1, then to 3.

Configuring zone for dynamic resource pool usage


Follow these steps to create a processor set, a resource pool, and bind it to a zone.
1. Start the /system/pools/dynamic service :

# svcadm enable /system/pools/dynamic

2. Create a file /var/tmp/pool.cfg (could be any file name) with the following contents:

# cat /var/tmp/pool.cfg
create pset pset_1 (uint pset.min = 1; uint pset.max = 1)
create pool pool_1
associate pool pool_1 (pset pset_1)

3. Create a pool from the above configuration:

# poolcfg -f /var/tmp/pool.cfg

4. Change the zone configuration to bind the pool to the zone (this is to make the pool assignment permanent
across server and zone reboots):

thegeekdiary.com/solaris-zones-how-to-change-the-number-of-cpus-using-dynamic-resource-pools/ 2/7
8/22/17 Solaris Zones : How To Change The Number Of CPUs Using Dynamic Resource Pools

# zonecfg -z zone_1
zonecfg:zone_1> set pool=pool_1
zonecfg:zone_1> verify
zonecfg:zone_1> commit
zonecfg:zone_1> exit

5. Bind pool pool_1 to zone zone_1 (this is to make the pool assignment effective immediately):

# poolbind -p pool_1 -i zoneid zone_1

6. Verify (list) the whole pool configuration:

# pooladm -n
...

7. Write the pool configuration to pool config file /etc/pooladm.conf:

# pooladm -s

8. Activate the pool configuration:

# pooladm -c

Changing the CPU count


The steps below demonstrates how to change the number of CPUs of zone zone01 to 2, then to 1, then to 3.

1. Increase the number of CPUs assigned to pset_1 (= pool_1 = zone01) from 1 to 2:

# poolcfg -dc 'modify pset pset_1 (uint pset.min = 2; uint pset.max = 2)'

2. Write this new pool configuration to pool config file /etc/pooladm.conf:

thegeekdiary.com/solaris-zones-how-to-change-the-number-of-cpus-using-dynamic-resource-pools/ 3/7
8/22/17 Solaris Zones : How To Change The Number Of CPUs Using Dynamic Resource Pools

# pooladm -s

3. Display the new pool configuration:

# poolcfg -c 'info pool pool_1' /etc/pooladm.conf


...
uint pset.min 2
uint pset.max 2
...

4. Activate the pool configuration:

# pooladm -c

5. In the zone, verify that only 2 CPUs are assigned to the zone, using mpstat 2 2 :

# zlogin zone01 mpstat 2 2


CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0 0 0 207 203 1 6 0 0 0 0 3 0 0 0 100
1 0 0 3 10 0 6 0 0 0 0 1 0 1 0 99
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0 0 0 203 203 1 1 0 0 0 0 8 0 0 0 100
1 5 0 0 2 0 1 0 0 0 0 5 0 0 0 100

6. Decrease the number of CPUs assigned to pset_1 (= pool_1 = zone01) from 2 to 1:

# poolcfg -dc 'modify pset pset_1 (uint pset.min = 1; uint pset.max = 1)'

7. Write this new pool configuration to pool config file /etc/pooladm.conf:

# pooladm -s

8. Display the new pool configuration:

thegeekdiary.com/solaris-zones-how-to-change-the-number-of-cpus-using-dynamic-resource-pools/ 4/7
8/22/17 Solaris Zones : How To Change The Number Of CPUs Using Dynamic Resource Pools

# poolcfg -c 'info pool pool_1' /etc/pooladm.conf


...
uint pset.min 1
uint pset.max 1
...

9. Activate the pool configuration:

# pooladm -c

10. In the zone, verify that only 1 CPU is assigned to the zone, using mpstat 2 2 :

# zlogin zone01 mpstat 2 2


CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
1 0 0 3 10 0 6 0 0 0 0 1 0 1 0 99
1 4 0 0 3 0 3 0 0 0 0 13 0 0 0 100

11. Increase the number of CPUs assigned to pset_1 (= pool_1 = zone01) from 1 to 3:

# poolcfg -dc 'modify pset pset_1 (uint pset.min = 3; uint pset.max = 3)'

12. Write that new pool configuration to pool config file /etc/pooladm.conf:

# pooladm -s

13. Display the new pool configuration:

# poolcfg -c 'info pool pool_1' /etc/pooladm.conf


...
uint pset.min 3
uint pset.max 3
...

14. Activate the pool configuration:

thegeekdiary.com/solaris-zones-how-to-change-the-number-of-cpus-using-dynamic-resource-pools/ 5/7
8/22/17 Solaris Zones : How To Change The Number Of CPUs Using Dynamic Resource Pools

# pooladm -c

15. In the zone, verify that now 3 CPUs are assigned to the zone, using mpstat 2 2 :

# zlogin zone01 mpstat 2 2


CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0 0 0 207 203 1 6 0 0 0 0 3 0 0 0 100
1 0 0 3 10 0 6 0 0 0 0 1 0 1 0 99
2 0 0 3 10 0 5 0 0 0 0 0 0 0 0 100
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0 0 0 202 201 1 0 0 0 0 0 0 0 0 0 100
1 5 0 0 2 0 1 0 0 0 0 7 0 0 0 100
2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 100

Examples of adding VxFS, ZFS, SVM, UFS, lofs, Raw volumes and disk devices to non-global zones.
(http://thegeekdiary.com/examples-of-adding-vxfs-zfs-ufs-lofs-raw-volumes-and-disk-devices-to-non-
global-zones/)
Resource management in solaris zones : CPU shares, capped CPU, Dedicated CPU assignment
(http://thegeekdiary.com/resource-management-in-solaris-zones-cpu-shares-capped-cpu-dedicated-cpu-
assignment/)
Resource management in solaris zones : Dynamic Resource pools (http://thegeekdiary.com/resource-
management-in-solaris-zones-dynamic-resource-pools/)
Resource management in solaris zones : Capped memory (http://thegeekdiary.com/resource-
management-in-solaris-zones-capped-memory/)

thegeekdiary.com/solaris-zones-how-to-change-the-number-of-cpus-using-dynamic-resource-pools/ 6/7
8/22/17 Solaris Zones : How To Change The Number Of CPUs Using Dynamic Resource Pools

CHEAT SHEETS

LDOMs (OVM for SPARC) Command line reference (http://thegeekdiary.com/ldoms-ovm-for-sparc-command-line-reference-


cheat-sheet/)

Solaris Volume Manager (SVM) command line reference (http://thegeekdiary.com/solaris-volume-manager-svm-command-


line-reference-cheat-sheet/)

Solaris ZFS command line reference (http://thegeekdiary.com/solaris-zfs-command-line-reference-cheat-sheet/)

RHEL 7 RHCSA Notes (Cheat Sheets) (http://thegeekdiary.com/rhel-7-rhcsa-notes-cheat-sheets/)

CentOS / RHEL 7 : firewalld Cheat Sheet (http://thegeekdiary.com/centos-rhel-7-firewalld-command-line-reference-cheat-


sheet/)

systemd command line reference (cheat sheet) (http://thegeekdiary.com/centos-rhel-7-systemd-command-line-reference-


cheat-sheet/)
SOLARIS IN TERVIEW QUESTION S

The ultimate Solaris Volume Manager (SVM) interview questions (http://thegeekdiary.com/the-ultimate-solaris-volume-


manager-svm-interview-questions/)

The ultimate Solaris zones (containers) interview questions (http://thegeekdiary.com/the-ultimate-solaris-zones-containers-


interview-questions/)

The ultimate Solaris networking interview questions (http://thegeekdiary.com/the-ultimate-solaris-networking-interview-


questions/)

The ultimate ZFS interview questions (http://thegeekdiary.com/the-ultimate-zfs-interview-questions/)


HARD W ARE CHEATS

Most Commonly used ALOM commands (http://thegeekdiary.com/most-commonly-used-alom-commands-cheat-sheet/)

Most Commonly used ILOM commands (http://thegeekdiary.com/most-commonly-used-ilom-commands-cheat-sheet/)

Most Commonly used LOM commands (http://thegeekdiary.com/most-commonly-used-lom-commands-cheat-sheet/)

Most commonly used XSCF commands (http://thegeekdiary.com/most-commonly-used-xscf-commands-cheat-sheet/)


Most Commonly used RSC commands (http://thegeekdiary.com/most-commonly-used-rsc-commands-cheat-sheet/)

How to login into console from ILOM, ALOM, LOM, ELOM, XSCF, RSC (http://thegeekdiary.com/how-to-login-into-console-
from-ilom-alom-lom-elom-xscf-rsc/)

2017 THE GEEK DIARY (HTTP://THEGEEKDIARY.COM)

thegeekdiary.com/solaris-zones-how-to-change-the-number-of-cpus-using-dynamic-resource-pools/ 7/7