• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Solaris Zones : How To Change The Number Of CPUs Using Dynamic Resource Pools

by admin

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

Resource Pools Framework

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):

# 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:

# 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:

# 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:

# 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.
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

Filed Under: Solaris, Zones

Some more articles you might also be interested in …

  1. Solaris ZFS : How to replace a failed disk in rpool (x86)
  2. How to replace a disk under ZFS in Solaris
  3. Managing network resources in Solaris 11 using “dlstat” and “flowstat”
  4. Solaris : Non-root user can’t run prtdiag command
  5. How to Configure a Solaris 10 Jumpstart server and client [SPARC]
  6. Active FTP vs. Passive FTP
  7. GUDS – A Script for Gathering Solaris Performance Data
  8. Solaris Volume Manager (SVM) : Understanding metadb Flags
  9. How to identify the HBA cards/ports and WWN in Solaris
  10. Oracle VM Server for SPARC (Ldoms) : How to Change Primary/Control Domain’s UUID

You May Also Like

Primary Sidebar

Recent Posts

  • pw-cat Command Examples in Linux
  • pvs: command not found
  • pulseaudio: command not found
  • pulseaudio Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright