N1 Grid Service Provisioning System User's Guide and Release Notes for the Solaris Plug-In 2.0

Creating and Managing Solaris Zones

The Common Tasks page of the software enables you to create and manage Solaris 10 zones.

ProcedureHow to Define a Host as a Global Zone

A global zone is a host on which individual zones are defined. Before you can create any local zones, you must have at least one host defined to be in the host set com.sun.solaris#global_zones. This task explains how to define a host as a global zone.

Steps
  1. In the left control panel, under the Hosts Setup section, click Hosts.

  2. Type the name of the host that you want to create as a global zone (container) in the Name field and click Create.

  3. Choose com.sun.solaris#global_zone from the host type menu.

  4. Modify values for any attributes as needed.

    For example, you might want to change the connection type from RAW (the default) to SSH or SSL.


    Note –

    To use SSH for the local zone connection, you must set the port to 70000.


  5. Click the appropriate checkbox to include a Remote Agent or a Local Distributor on the physical host.

ProcedureHow to Create a Solaris Local Zone

Steps
  1. In the left control panel, under Common Tasks, click the Sun Solaris icon.

  2. Click the Solaris Containers: Create and Manage link.

  3. Click the Run action next to Create: Install.

  4. Select the target host on which to create the local zone.


    Note –

    The target host must be a member of the com.sun.solaris#global_zones host set.


  5. Select the local zone host name from the Plan Variables settings.

    If desired local zone names are not present, you can create new zone names. To create new zone names, follow these steps:

    1. Click Select From List in the plan variable settings table.

    2. In the Variable Setting window, click Create Set

    3. Type the new zone set name in the New Set Name field.

    4. Click the box next to Zone Name prompt and type a new zone name.


      Note –

      Zone names become network Zone Host Names during local zone creation. Zone Host Names should resolve to matching available local network IP addresses.


  6. Click Run Plan (includes preflight).

Using the CLI to Work With Solaris Zones

By default, the N1 Grid Service Provisioning System command-line interface is located in the following directory: /opt/SUNWn1sps/N1_Grid_Service_Provisioning_system_5.0/cli/bin/cr_cli

Solaris zone plug-in plans that run Container procedures are located in the folder /com/sun/solaris/zones.


Example 6–1 Creating a Solaris Zone by Using the CLI

This example illustrates how you can use the N1 Grid Service Provisioning System command-line interface to create a Solaris zone. The example contains three command segments. All commands use an example user name of spsadmin and password of x1y2z3.

The first command creates a host for global zone on server10 and defines default values for the local_zone_default_name, local_zone_connection_type, and local_zone_port variables.


% cr_cli -cmd hdb.h.mod                     host modify
    -ID "NM:server10"                       target global host
    -tID "NM:com.sun.solaris#global_zone"   host type
    -attr "local_zone_default_name=server10_z1; 
     local_zone_connection_type=RAW; 
     local_zone_port=1131"                  local zone attributes
    -u spsadmin                             user name
    -p x1y2z3                               password

The second command creates a local zone using the default variables.


% cr_cli -cmd pe.p.run                      plan execution
    -PID "NM:/com/sun/solaris/Container-create" 	create zone plan ID
    -tar "H:NM:server10"                    target global host
    -vs "+"                                 default var set "default set"
    -comp "+"                               default component "latest build"
    -pto 6000                               plan time 1 hr max [6000 secs]
    -nto 6000                               call time 1 hr max [6000 secs]
    -u spsadmin                             user name
    -p x1y2z3                               user password

The third command activates the local zone.


% echo "server10_z1" | cr_cli -cmd pe.p.run plan execution, std input is zone name
    -PID "NM:/com/sun/solaris/Container-activate" attach zone plan ID
    -tar "H:NM:server10"                    target global host
    -f "-"                                  standard input args
    -pto 6000                               plan time 1 hr max [6000 secs]
    -nto 6000                               call time 1 hr max [6000 secs]
    -u spsadmin                             user name
    -p x1y2z3                               user password