How To Change The Number of CPUs in Solaris Zones Using Dynamic Resource Pools

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

9/6/2020 Document 1533699.

1
Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential.

How To Change The Number Of CPUs In Solaris [TM] Zones Using Dynamic Resource Pools
(Doc ID 1533699.1)

In this Document

Goal
Solution
References

APPLIES TO:

Solaris Operating System - Version 10 3/05 and later


Oracle Solaris on SPARC (64-bit)
Oracle Solaris on x86-64 (64-bit)

GOAL

How to change the number of CPUs in a running Solaris zone

SOLUTION

Section A (8 steps) describes how to prepare a running zone for dynamic resource pool usage.
Section B (15 steps) describes how to change the number of CPUs of a zone from 1 to 2, then back to 1, then to 3.

A) By following steps 1...8 of the example below, you can create a processor set, a resource pool, and bind it to a zone.

1) Start the /system/pools/dynamic service (see also https://docs.oracle.com/cd/E26505_01/html/817-


1592/rmpool.task-57.html#gdopt ):

$ svcadm enable /system/pools/dynamic

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

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> <ctrl>d

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

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=i0s9jiqzr_178&id=1533699.1 1/4
9/6/2020 Document 1533699.1

$ 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

B) The example below (steps 1...15) shows how to change the number of CPUs of zone zone_1 to 2, then to 1, then to 3.

1) Increase the number of CPUs assigned to pset_1 (= pool_1 = zone_1) 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 zone_1 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 = zone_1) 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:

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=i0s9jiqzr_178&id=1533699.1 2/4
9/6/2020 Document 1533699.1

$ 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 zone_1 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 = zone_1) 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 zone_1 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

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=i0s9jiqzr_178&id=1533699.1 3/4
9/6/2020 Document 1533699.1

If you have further question regarding this topic, you may also contact the Oracle Solaris System Administration
or the Oracle Solaris Performance, Panics, Hangs, and DTrace Communities.

REFERENCES

NOTE:1560343.1 - How to create a basic processor set (pset) and associate it with a pool
NOTE:1006137.1 - Understanding Solaris Resource Manager Software - Resource Pools
Didn't find what you are looking for?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=i0s9jiqzr_178&id=1533699.1 4/4

You might also like