N1 Grid Service Provisioning System 5.0 User's Guide for the Solaris Plug-In

Chapter 3 Using the Solaris Plug-In

This chapter explains how to use the specific components and plans that are provided with the Solaris Plug-In. The chapter contains the following information:

Creating and Managing Solaris Zones

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

ProcedureHow to Identify 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 identify a host as a global zone.

Steps
  1. Select Hosts from the Hosts Setup section of the left control panel.

  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. Select the Sun Solaris icon under the Common Tasks section of the left control panel.

  2. Select 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 enter 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 3–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

Component Types

There are no specific component types for Solaris containers. However, some specific host types are associated with Solaris containers. For information, see Hosts and Solaris Zones.

Components

Container Component

The Container component is the main component delivered by the Solaris plug-in. The Container component is an untyped component.

The Container component includes several procedures. You can run these procedures directly from the N1 Grid Service Provisioning System interface or from within execution plans.

Create Procedure

Creating a Container component creates a corresponding local Solaris 10 zone. The host target of this procedure is a Solaris 10 host that is running a provisioning software remote agent. The target host type must be set to com.sun.solaris#global_zone. The create procedure uses Solaris 10 zonecfg and zoneadm commands to configure and install a local Solaris 10 zone from the Solaris 10 global zone. After the installation, this procedure then installs a remote agent on the newly create local zone. A new host of type com.sun.solaris#local_zone appears on the host page.

Attach Procedure

This procedure is similar to the create procedure, but it does not create the zone. Instead, the procedure attaches to an existing local zone on the host. This procedure creates a Container component in the provisioning software database and installs a remote agent on the existing local zone. The attach procedure is useful for times when a tool other than N1 Grid Service Provisioning System created the zone. For example, you might use the attach procedure when a zone has been created directly through Solaris APIs or by another software management application.

Detach Procedure

The detach procedure is similar to the delete procedure. This procedure removes the Container component from the provisioning software database and uninstalls the remote agent. However, the local zone is not removed from the global zone host. If the local zone is booted, it remains booted. If it is halted, it remains halted.

Activate Procedure

This procedure activates (boots) a local zone. You select the zone from the list of installed Container components on the targeted Solaris 10 host. The procedure uses the zoneadm -z zonename boot command. This procedure also initiates provisioning software host preparation for unprepared hosts.

Deactivate Procedure

This procedure deactivates (halts) a local zone. You select the zone from the list of installed Container components on the targeted Solaris 10 host. The procedure uses the zoneadm -z zonename halt command.

Delete Procedure

The delete procedure uses the Solaris 10 zonecfg and zoneadm commands to remove the specified Solaris 10 local zone from the global zone host. The procedure also removes the corresponding Container component from the provisioning software database.

Plans

For each of the procedures described for the Container component, an associated plan is provided in the /com/sun/solaris plan folder. These plans are convenient to use with command-line shell calls, as shown in Example 3–1

Hosts and Solaris Zones

The Solaris Plug-In includes a specific host set, a host search, and two host types for Solaris 10 zones.

Global Zone Host Set

Any host on which you want to install a zone must be a member of the global zone host set. To ensure this relationship, set the host type of the target host to com.sun.solaris#global_zone.

Global Zone Host Search

The global zones host search provides a search string that matches any host that is a global zone.

Global Zone Host Type

Any physical host on which you want to install a zone must have a host type of com.sun.solaris#global_zone.

Local Zone Host Type

When you install the Container component onto a global zone host, the provisioning software creates a host of type com.sun.solaris#local_zone.

Troubleshooting

If you are experiencing problems managing your Solaris zones through the provisioning software, messages will likely appear on the screen to tell you that a problem exists.

For example, if you try to create a local zone for a target host that is not known to be a global zone, then you see a message similar to the following:


Problems encountered during plan run or preflight

The plan (or preflight) "/system/autogen/Container-inst-create-1098225529078" 
finished with 1 failed host(s).

The specified target host "masterserver" was not in the required host set 
"com.sun.solaris#global_zones" for component "/com/sun/solaris/Container".

Although the message in this example is easily deciphered, not all messages are this straightforward. To find out more information about the specific problem, follow the Details links.