sun.com docs.sun.com My Sun Worldwide Sites

Previous Previous     Contents     Index     Next Next

Chapter 20

Installing, Booting, Halting, Uninstalling, and Cloning Non-Global Zones (Tasks)

This chapter describes how to install and boot a non-global zone. A method for using cloning to install a zone on the same system is also provided. Other tasks associated with installation, such as halting, rebooting, and uninstalling zones, are addressed. The procedure to completely delete a zone from a system is also included.

For general information about zone installation and related operations, see Chapter 19, About Installing, Halting, and Uninstalling Non-Global Zones (Overview).

For information about lx branded zone installation and cloning, see Chapter 32, About Installing, Booting, Halting, and Uninstalling lx Branded Zones (Overview) and Chapter 33, Installing, Booting, Halting, Uninstalling and Cloning lx Branded Zones (Tasks).

Zone Installation (Task Map)

Task

Description

For Instructions

(Optional) Verify a configured zone prior to installing the zone.

Ensure that a zone meets the requirements for installation. If you skip this procedure, the verification is performed automatically when you install the zone.

(Optional) How to Verify a Configured Zone Before It Is Installed 

Install a configured zone.

Install a zone that is in the configured state.

How to Install a Configured Zone 

Obtain the universally unique identifier (UUID) for the zone.

This separate identifier, assigned when the zone is installed, is an alternate way to identify a zone.

How to Obtain the UUID of an Installed Non-Global Zone 

(Optional) Transition an installed zone to the ready state.

You can skip this procedure if you want to boot the zone and use it immediately.

(Optional) How to Transition the Installed Zone to the Ready State 

Boot a zone.

Booting a zone places the zone in the running state. A zone can be booted from the ready state or from the installed state. Note that you must perform the internal zone configuration when you log in to the zone after booting it for the first time.

How to Boot a Zone, Internal Zone Configuration, Performing the Initial Internal Zone Configuration

Boot a zone in single-user mode.

Boots only to milestone svc:/milestone/single-user:default. This milestone is equivalent to init level s. See the init(1M) and svc.startd(1M) man pages.

How to Boot a Zone in Single-User Mode 

Installing and Booting Zones

Use the zoneadm command described in the zoneadm(1M) man page to perform installation tasks for a non-global zone. You must be the global administrator to perform the zone installation. The examples in this chapter use the zone name and zone path established in Configuring, Verifying, and Committing a Zone.

Procedure(Optional) How to Verify a Configured Zone Before It Is Installed

You can verify a zone prior to installing it. One of the checks performed is a check for sufficient disk size. If you skip this procedure, the verification is performed automatically when you install the zone.

You must be the global administrator in the global zone to perform this procedure.

  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.

  2. Verify a configured zone named my-zone by using the -z option with the name of the zone and the verify subcommand.

    global# zoneadm -z my-zone verify

    This message regarding verification of the zone path will be displayed:

    Warning: /export/home/my-zone does not exist, so it cannot be verified.
    When 'zoneadm install' is run, 'install' will try to create
    /export/home1/my-zone, and 'verify' will be tried again,
    but the 'verify' may fail if:
    the parent directory of /export/home/my-zone is group- or other-writable
    or
    /export/home1/my-zone overlaps with any other installed zones.

    However, if an error message is displayed and the zone fails to verify, make the corrections specified in the message and try the command again.

    If no error messages are displayed, you can install the zone.

ProcedureHow to Install a Configured Zone

This procedure is used to install a configured non-global zone.

You must be the global administrator in the global zone to perform this procedure.


Note - In Step 2, if the zonepath is on ZFS, the zoneadm install command automatically creates a ZFS file system (dataset) for the zonepath when the zone is installed. You can block this action by including the -x nodataset parameter.


  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.

  2. Install the configured zone my-zone by using the zoneadm command with the install option.

    • Install the zone, automatically creating a ZFS file system if the zonepath is on ZFS.

      global# zoneadm -z my-zone install

      The system will display:

      A ZFS file systm has been created for this zone.

    • Install the zone that has a zonepath on ZFS, but do not automatically create the ZFS file system.

      global# zoneadm -z my-zone install -x nodataset

    You will see various messages as the files and directories needed for the zone's root file system are installed under the zone's root path.

  3. (Optional) If an error message is displayed and the zone fails to install, type the following to get the zone state:

    global# zoneadm -z my-zone list -v

    • If the state is listed as configured, make the corrections specified in the message and try the zoneadm install command again.

    • If the state is listed as incomplete, first execute this command:

      global# zoneadm -z my-zone uninstall

      Then make the corrections specified in the message, and try the zoneadm install command again.

  4. When the installation completes, use the list subcommand with the -i and -v options to list the installed zones and verify the status.

    global# zoneadm list -iv

    You will see a display that is similar to the following:

    ID  NAME     STATUS       PATH                           BRAND 
     0  global   running      /                              native
     -  my-zone  installed    /export/home/my-zone           native

Troubleshooting

If a zone installation is interrupted or fails, the zone is left in the incomplete state. Use uninstall -F to reset the zone to the configured state.

Next Steps

This zone was installed with the minimal network configuration described in Chapter 15, "Managing Services (Tasks)," in System Administration Guide: Basic Administration by default. You can switch to the open network configuration, or enable or disable individual services, when you log in to the zone. See Switching the Non-Global Zone to a Different Networking Service Configuration for details.

ProcedureHow to Obtain the UUID of an Installed Non-Global Zone

A universally unique identifier (UUID) is assigned to a zone when it is installed. The UUID can be obtained by using zoneadm with the list subcommand and the -p option. The UUID is the fifth field of the display.

  • View the UUIDs for zones that have been installed.

    global# zoneadm list -p

    You will see a display similar to the following:

    0:global:running:/:native
    6:my-zone:running:/export/home/my-zone:61901255-35cf-40d6-d501-f37dc84eb504:native

Example 20-1   How to Use the Zone UUID in a Command
global# zoneadm -z my-zone -u 61901255-35cf-40d6-d501-f37dc84eb504 list -v

If both -u uuid-match and -z zonename are present, the match is done based on the UUID first. If a zone with the specified UUID is found, that zone is used, and the -z parameter is ignored. If no zone with the specified UUID is found, then the system searches by the zone name.

More Information
About the UUID

Zones can be uninstalled and reinstalled under the same name with different contents. Zones can also be renamed without the contents being changed. For these reasons, the UUID is a more reliable handle than the zone name.

See Also

For more information, see zoneadm(1M) and libuuid(3LIB).

Previous Previous     Contents     Index     Next Next
Company Info Contact Terms of Use Privacy Copyright 1994-2007 Sun Microsystems, Inc.