Welcome!

Java Authors: Don MacVittie, Maureen O'Gara, Liz McMillan, Walter H. Pinson, III, Yakov Werde

Related Topics: Java, SOA & WOA, Virtualization

Java: Article

Deploying GlassFish v2 Virtualization in the Solaris Container

OS virtualization is done by enabling multiple isolated and secured systems in one physical server

Solaris Container = Zone + Resource Management

The Solaris Resource Management and Zones are the basic functions that form the Solaris Container. Zones provide isolation that is scalable, flexible, and lightweight for the Solaris O/S services. Zones are like having another Solaris instance inside the Solaris O/S. Zone can be categorized into two types: non-global zone and global zone (see Figure 1).

Resource Management is a policy that enables the Solaris O/S to manage and compute resources including partitioning, utilization allocation, and resource allocation on the fly through the administrative function / command.

Prerequisite
This article will walk you through how to deploy the GlassFish v2 application server under the Solaris Container. The zone will only use the allocated CPU resource in a specific resource pool. You will need Solaris 10 O/S installed on your box, and the GlassFish v2 installation package for Linux. You can download the software from the following sites:

After you have installed the Solaris 10 O/S in your box follow these steps to enable your container.

1.  Partitioning the CPU Resource
Solaris 10 O/S provides a feature for creating a resource pool using the pool configuration administration command. This feature enables the system administrator to create a CPU set and allocate the CPU available on the hardware level. In order to configure the resource pool we will need to enable the pools daemon.

   svcadm enable svc:/system/pools:default

After you run that command, check the service status using the svcs command. We will start by looking at the current configuration of the pool. This information can be displayed using the pooladm command. Here is an example of the current resource pool.

system default
...
    pool pool_default
      ...
      pset pset_default

    pset pset_default
      ...
      cpu
        int    cpu.sys_id 1
        string cpu.comment
        string cpu.status on-line
           cpu
        int    cpu.sys_id 0
        string cpu.comment
        string cpu.status on-line

The default pool for the global zone named pool_default is holding the CPU set named pset_default. Currently the CPU set of pset_default is allocated with two CPUs (cpu.sys_id=0, and cpu.sys_id=1). In this example we will be partitioning the CPU with one CPU to allocate the pool_glassfish and the other still in the pool_default. Follow the steps below to create the pool_glassfish

a.  Generate /etc/pooladm.conf

pooladm -s

b.  Create a CPU set as pset_glassfish and assign cpu.sys_id=0 to pset_glassfish

poolcfg -c 'create pset pset_glassfish (uint pset.min=1; uint pset.max=1)'

pooladm -c

c.  Create a pool with pool_glassfish as the label

poolcfg -c 'create pool pool_glassfish'

pooladm -c

d.  Associate the CPU set (pset_glassfish) to the pool (pool_glassfish)

poolcfg -c 'associate pool pool_glassfish (pset pset_glassfish)'

pooladm -c

In order to verify the configuration modification we can use the pooladm command. The amazing part about this configuration process is that the modification can be done online without rebooting the operating system. The example below is the result of the changes we have done:

system default
...

    pool pool_glassfish
      ...
           pset pset_glassfish

    pool pool_default
        ...
           pset pset_default
        pset pset_glassfish
        ...

      cpu
        int    cpu.sys_id 0
        string cpu.comment
        string cpu.status on-line

    pset pset_default
      ...

      cpu
        int    cpu.sys_id 1
        string cpu.comment
        string cpu.status on-line


More Stories By Sonny Hastomo

Sonny Hastomo is an IT architect at Sun Microsystems, Indonesia, for the telecommunication industry division. His currently is focusing on providing solution design, sizing, implementation, consulting services, and quality support to customers in their evaluation of their IT challenges.

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
Sathyan Catari 03/26/08 01:54:00 PM EDT

You may want to refer to this Article for Installing GlassFish Application server on Zones.

http://developers.sun.com/appserver/reference/techart/glassfishsolariszo...

Thanks