Consolidating Servers and Applications by Using Solaris Container Manager
Raghuraman Sesharaman, Navin Kumar, and Amol Chiplunkar; October 2007
This document explains how you can consolidate servers and applications by using Solaris
Container Manager.
Overview of Solaris Container Manager
Solaris Container Manager is an integral part of Sun Management Center 4.0 software
and is shipped with Sun Management Center as an add-on product. Solaris Container
Manager works in a browser-based console to manage software containers, maximize resource utilization, and
increase data center productivity.
The Solaris Container Manager software organizes existing resource management utilities that run on
the Solaris 8, Solaris 9, and Solaris 10 Operating System.
The Solaris Container Manager software provides the ability to control resource management for
use by each software application. This control is especially useful in implementing server
consolidation in your data center. Server consolidation produces the following benefits:
Maximizes the number of applications that can run on your servers, so that your computer resources are not wasted
Reduces the number of servers in your data center, which simplifies management
Scenario
Problem: Say that in your data center you have ten systems that run the Solaris OS for SPARC platforms and ten systems
that run the Solaris OS for x64 platforms. Each of these systems run an application. For example, four
systems run Web servers, four systems run database applications, and two systems run
unique applications. This setup leads to maintenance and space issues and under-utilization of
CPU and memory resources.
Solution: Consolidate the applications running on these systems onto fewer
systems.
Creating Zones
As part of the consolidation effort, it is important to evaluate the needs
of the applications that will share the consolidated system. Solaris Zones provide separate
environments on a system and logically isolates applications from one another. Each application
receives a dedicated namespace in which to run, and cannot see, monitor, or
affect applications running in another zone.
You can create non-global zones using the zone wizard of Solaris Container Manager.
To Create Zones
Create a non-global zone on one of the systems that runs the Solaris OS for SPARC platforms and
deploy the Web Server application.
Before You Begin
You must have a resource pool with available CPU shares.
In the left pane of the Sun Management Center main window, select Manage
Solaris Containers.
Select a host name.
Click the Zones tab.
Click the New Zone button.
The New Zone wizard appears. To display help text about each wizard step,
click the Help tab in the wizard pane.
Provide basic zone identity information.
Provide the zone path.
The zone path is the fully qualified path that serves as the root
path for this zone. If the path ends with a directory name that
does not exist, the directory will be created for you. If you are
using an existing directory, the permissions must be set to 700.
Select a network interface.
The network interface drop-down list shows only those network interfaces that were found
on this host.
If you want the zone to reboot automatically in the event of
a system crash, select the Auto Reboot Enabled box.
Provide an IP address.
The IP address should be assigned by the network administrator.
Choose Native from the Zone Brand drop-down list.
The zone brand determines the scripts that are executed when a zone is
installed and booted and identifies the correct application type at application launch time.
Native zones contain the same operating environment as the parent host.
Provide additional zone identity information.
Provide the zone host name.
The zone host name is the name given to the zone for rlogin
and telnet purposes.
Provide the root password.
The root password for the zone must be between six and eight characters
long.
Choose the time zone from the Time Zone drop-down list.
The time zone does not have to be the time zone in which
the system is physically located.
If you select DNS as the naming service, you must also provide the
domain name and name server to use for the zone.
Choose a resource pool for this zone.
A resource pool is an object that is used to allocate CPU resources.
Select an available resource pool based on your requirements for total CPUs and
CPU shares.
Provide CPU shares attributes.
The value in the CPU Shares field is a positive integer that
is used by the Fair Share Scheduler (FSS) to allocate system resources to
the projects associated with this zone. The field is populated with a default
value of 1.
The value in the Project CPU Shares field establishes the ratio by
which the FSS will allocate system resources to the projects associated with this zone.
The field is populated with a default value of 1000.
Specify the memory configuration.
You can assign the memory in four segments:
Physical memory - Amount of allocated physical memory in megabytes.
Maximum swap - Amount of memory available to use for swap space in megabytes.
Locked memory - Amount of locked memory in megabytes.
Shared memory - Amount of shared memory in megabytes.
Provide IPQoS attributes.
The IP quality-of-service (IPQoS) feature facilitates control of the inbound and outbound traffic
of a Solaris zone.
Identify any additional network connections.
To add a network virtual interface, type an IP address and select a
network interface from the drop-down menu. Each network interface can have multiple IP
addresses, but an IP address can only be used one time. For additional
information, see the zonecfg(1M) man page.
Specify devices to be configured in the zone.
To make a device available, type a logical device path in the Device
Directory field, for example, /dev/rdsk/c1t3d0s0 or /dev/sound/*. Each zone can have devices that should
be configured when the zone transitions from the installed state to the ready
state.
To include a file system in the zone, provide a mount point
and path and the file system type.
To specify a file system, provide the following information:
Mount point in the Mount Directory field
A path in either the Special or Raw Device Directory field
Select the file system type from the Type drop-down menu.
For additional information, see the zonecfg(1M), mount(1M), mount(2), fsck(1M), and vfstab(4) man pages.
If you want this zone to share packaged software with a global zone,
specify the directory path from which the packages should be inherited.
The inherit-pkg-dir resource is used to represent directories that contain packaged software that
a non-global zone shares with the global zone. To inherit packages from the
global zone, type the directory path of the packages to be inherited.
For additional information, see the zonecfg(1M) man page.
Verify privileges to assign to the new zone by default.
The privileges listed in the available privileges list are assigned to the new zone
by default. To change the default set of zone privileges, select the privileges
to be excluded from the available default zone privileges.
Include any optional zone privileges.
Review the zone configuration.
Click the Finish button to create the zone according to the specified configuration,
or click the Previous button to change the zone parameters.
Next Steps
Check the performance of the system in terms of CPU and memory
consumption.
Copying Zones
You can create multiple copies of a non-global zone on a single
system or a copy of a non-global zone on multiple systems. When a
non-global zone is copied, all its properties are inherited to the new zones.
To Copy Zones
If the performance of the system in terms of CPU and memory
consumption is satisfactory, create three copies of the zone on the same system. The
three new zones will have Web Server applications running on them automatically. When
a non-global zone is copied, all its properties are inherited to the new
zones.
In the left pane of the Sun Management Center main window, select Manage
Solaris Containers.
Click a Solaris 10 host name.
Click the Zones tab.
Click the Zone Copy button.
The Zone Copy wizard appears.
Choose whether to create multiple copies of a zone on the same host
or to create a copy of a zone on multiple hosts.
To create multiple copies of a zone on the same host, select
the Same host option, click Next and follow the prompts.
To create a copy of a zone on multiple hosts, select the
Multiple hosts option, click Next and follow the prompts.
Follow the steps in the wizard.
When you copy a zone on the same host, if the zone host
is running at least Solaris 10 Update 3, you can choose to clone
the zone. Cloning creates an exact replica of the zone, including all its
contents.
When you copy a zone to multiple hosts, if the zone host
is running at least Solaris 10 Update 3, you can choose to copy
the zone's contents.
Next Steps
When you perform this procedure, you would have consolidated the four Web Server
applications running on four systems onto a single system by using zones.
Repeat the procedures To Create Zones and To Copy Zones for four database applications. When you perform
these procedures, you would have consolidated the four database applications running on four
systems onto a single system.
For the two systems that run unique applications, create two zones on a
system and deploy the applications manually.
Effectively, you have consolidated the applications running on ten systems onto three systems.
One system runs Web Server applications, second system runs database applications, and the
third system runs the unique applications.
Migrating Zones
If you have a bigger system that has enough CPU and memory,
say a Sun Fire T2000, you can even consolidate the applications running on the
three systems to a single system by using the zone migration feature.
The zone migration feature enables you to migrate a selected zone from the
source system to the target system.
Zone migration is the process of moving an installed non-global zone from one
system to other. Manual zone migration involves many steps, such as detaching the
zone on the source system, migrating the zone archive to the target system,
reconfiguring the zone on the target system, and attaching the zone on the
target system.
In Solaris Container Manager, the entire migration process is presented as a single
operation. After you select the zone to be migrated and click the Migrate
Zone button, the Zone Migrate wizard appears. Through this wizard, you select the
target systems to which the zone needs to be migrated. This feature simplifies
the entire migration process.
Requirements for Zone Migration
The following are the requirements for migrating a zone from the source system
to the target system.
The global zone on the target system must be running the same Solaris release as the source system.
The source and target systems must have the same system architecture.
The target system must have the same versions of the following required operating system packages and patches as those installed on the source system.
Packages that deliver files under an inherit-pkg-dir resource
Packages where SUNW_PKG_ALLZONES=true
Other packages and patches, such as those for third-party products, can be different.
For branded zones, the brand must be the same on the source system and on the target system.
To Migrate Zones
The migration process varies depending on the architecture of the source and target
systems.
If you migrate native and branded zones on the source systems that run the Solaris OS for x64 platforms
to the target system that runs the Solaris OS for x64 platforms, zone migration will be successful because the
source and target systems have the same system architecture. You can start running
the applications from the target system.
If you migrate native zones on the source systems that run the Solaris OS for SPARC platforms to
the target system that runs the Solaris OS for x64 platforms, only the zones infrastructure such as project settings and
CPU settings will be migrated because the source and target systems have different
architectures. You still need to manually deploy applications on the target system.
In the left pane of the Sun Management Center main window, select Manage
Solaris Containers.
Select a host name.
Click the Zones tab.
Select a zone that you want to migrate.
Click the Migrate Zone button.
The Zone Migrate wizard appears. To display help text about each wizard step,
click the Help tab in the wizard pane.
Search for hosts.
Type a host name in the Host Name text field.
Select the operating system and platform from their drop-down lists.
Type the minimum number of processors in the Total Processors field.
Type the minimum amount of memory in the Total Memory field.
Type the minimum clock speed in the Clock Speed field and click Next.
Select the host(s) to which you want to migrate the zone.
Type the target zone path and click Next.
Review the zone migrate configuration and click Finish.
Creating Branded Zones
Consolidating applications running on systems that run the Solaris OS for x64 platforms involves similar steps
except that you need to create branded zones instead of native zones. You
need to specify lx as the zone brand instead of native brand.
The branded zone (BrandZ) framework extends the Solaris Zones infrastructure. The branded zone
(BrandZ) framework enables you to create non-global zones that contain non-native operating environments
used for running applications. All brand management is performed through extensions to the
current zones structure.
You can create branded zones using the zone wizard of Solaris Container Manager.
To Create Branded Zones
In the left pane of the Sun Management Center main window, select Manage
Solaris Containers.
Select a host name.
Click the Zones tab.
Click the New Zone button.
The New Zone wizard appears. To display help text about each wizard step,
click the Help tab in the wizard pane.
Provide basic zone identity information.
Provide the zone path.
The zone path is the fully qualified path that serves as the root
path for this zone. If the path ends with a directory name that
does not exist, the directory will be created for you. If you are
using an existing directory, the permissions must be set to 700.
Select a network interface.
The network interface drop-down list shows only those network interfaces that were found
on this host.
If you want the zone to reboot automatically in the event of
a system crash, select the Auto Reboot Enabled box.
Choose lx from the Zone Brand drop-down list.
The zone brand determines the scripts that are executed when a zone is
installed and booted and identifies the correct application type at application launch time.
lx indicates that the zone contains a Linux environment, regardless of the operating
environment on the parent host. The lx value for zone brand is available
only on systems that run the Solaris 10 8/07 OS for x64 platforms.
Specify the image path, install arguments, and system configuration file.
The system configuration file is required to provide the attributes that are required
for zone management.
Choose a resource pool for this zone.
A resource pool is an object which is used to allocate CPU resources.
You should select an available resource pool based on your requirements for total
CPUs and CPU shares.
Provide CPU shares attributes.
The value in the CPU Shares field is a positive integer that is
used by the Fair Share Scheduler (FSS) to allocate system resources to the
projects associated with this zone. The field is populated with a default value
of 1.
The value in the Project CPU Shares field establishes the ratio by
which the FSS will allocate system resources to the projects associated with this zone.
The field is populated with a default value of 1000.
Specify the memory configuration.
You can assign the memory in four segments:
Physical memory - Amount of allocated physical memory in megabytes.
Maximum swap - Amount of memory available to use for swap space in megabytes.
Locked memory - Amount of locked memory in megabytes.
Shared memory - Amount of shared memory in megabytes.
Provide IPQoS attributes.
The IP quality-of-service (IPQoS) feature facilitates control of the inbound and outbound traffic
of a Solaris zone.
Identify any additional network connections.
To add a network virtual interface, type an IP address and select a
network interface from the drop-down menu. Each network interface can have multiple IP
addresses, but an IP address can only be used one time. For additional
information, see the zonecfg(1M) man page.
Specify devices to be configured in the zone.
To make a device available, type a logical device path in the Device
Directory field, for example, /dev/rdsk/c1t3d0s0 or /dev/sound/*. Each zone can have devices that should
be configured when the zone transitions from the installed state to the ready
state.
Include any user-defined attributes.
You can add your own attributes for items that you want to persist
on the zone after a reboot or for some other user-defined purpose. For
example, you can use this feature to define an audio device for a
branded zone. The attribute must include a name, a value, and a type.
To include a file system in the zone, provide a mount point
and path and the file system type.
To specify a file system, provide the following information:
Mount point in the Mount Directory field
A path in either the Special or Raw Device Directory field
Select the file system type from the Type drop-down menu.
For additional information, see the zonecfg(1M), mount(1M), mount(2), fsck(1M), and vfstab(4) man pages.
If you want this zone to share packaged software with a global zone,
specify the directory path from which the packages should be inherited.
The inherit-pkg-dir resource is used to represent directories that contain packaged software that
a non-global zone shares with the global zone. To inherit packages from the
global zone, type the directory path of the packages to be inherited.
For additional information, see the zonecfg(1M) man page.
Verify privileges to assign to the new zone by default.
The privileges listed in the available privileges list are assigned to the new zone
by default. To change the default set of zone privileges, select the privileges
to be excluded from the available default zone privileges.
Include any optional zone privileges.
Review the zone configuration.
Click the Finish button to create the zone according to the specified configuration,
or click the Previous button to change the zone parameters.
For More Information
For additional information about the features described in this article, see the following: