Using all these Solaris Container technologies on this new
server creates an environment like that shown in Figure 5.
Now the system includes three Containers: one with
dedicated CPU resources, and two others sharing CPU
r
esources.
Figure 5—A Container with a zone on a dedicated resource
pool, and two Containers each with a zone on a shared
pool with shares.
Two Types of Zones
All systems that run Solaris 10 contain a master zone,
called the
global zone
. The global zone is the original
Solaris OS instance. It has access to the physical hardware
and can control all processes. It also has the authority to
create and control new zones, called non-global zones, in
which applications run. Non-global zones do not run
inside the global zone—they run along side it—yet the
global zone can look inside non-global zones to see how
they are configured, monitor, and control them.
Like the other zones, this global zone is also associated
with a resource pool. In our example this is resource pool
2. In this case, it shares CPU resources with the Web
servers. When the Fair Share Scheduler is enabled, the
global zone defaults to one share. So Figure 5 needs to be
amended to include the global zone as shown in Figure 6.
Figure 6—The full example with all the resource pools and
zones.
Solaris™ Containers: An Example
T
his section is a step-by-step guide that shows how to
create the email and Web server example described above.
It does this by going through the following steps:
• Creating a new resource pool
•
Creating the email zone on the new resource pool
• Enabling the Fair Share Scheduling on the Web server
resource pool
• Creating the first Web server Container
• Creating the second Web server Container
When creating the last two Containers we will also show
some extra configuration options available to Solaris
Zones.
As the starting point, Figure 7 shows how the system looks
before any of these steps are taken. The only existing
objects are the global zone, and one resource pool. The
global zone is associated with this one resource pool. This
first resource pool is also called the
default pool
, and
before any action is taken, it has all the CPUs in the
system.
Figure 7—Every system has a default processor set.
Creating a New Resource Pool
In the Solaris OS, a
resource pool
is a logical entity that
owns a subset of the system resources, like CPU and
Memory. These subsets are known as
resource sets
.
Currently the Solaris OS only has one type of resource
set—a processor set. Every resource pool is associated
with a processor set—so if you want to give this pool its
own unique CPUs, you will need to define the processor
set, the number of processors it contains, and associate it
with a pool.
Every additional resource pool created is taken out of the
default pool. So, the email server's CPU comes out of the
four CPUs initially assigned to the default pool (leaving
three). Resource pools can be dynamically created and
removed on a running system, but you must leave one
CPU for the default pool.
Resource Pool 1
(1 CPUs)
Default Resource Pool
(3 CPUs)
Global
Zone
Zone 2
3
Zone 3
2
1
Zone 1
Container 2 Container 1
Number
of Shares
Number
of Shares
Container 4 Container 3
Resource Pool 1
(1 CPU)
Resou rce Pool 2
(3 CPUs and Fair Share Scheduler)
3
2
Zone 2
W
eb Server 1
Zone 3
W
eb Server 2
Zone 1
E
mail Application
Container 2 Container 3 Container 1
Number
of Shares
Number
of Shares
Default Resource Pool
(4 CPUs)
Global
Zone
Solaris 10 Operating System sun.com/solaris
2