Go to main content

Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: April 2019
 
 

How to Install a Configured Zone

This procedure is used to install a configured non-global zone. For information on installation options, see How Zones Are Installed.

The zone must reside on its own ZFS dataset. Only ZFS is supported. The zoneadm install command automatically creates a ZFS file system (dataset) for the zonepath when the zone is installed. If a ZFS dataset cannot be created, the zone is not installed.

  1. Become a zone administrator.

    For more information, see Assigning Limited Rights to Zone Administrators.

  2. Install the configured zone my-zone by using the zoneadm command with the install subcommand, automatically creating a ZFS dataset for the zonepath ZFS.

    Note -  The parent directory of the zone path must also be a dataset or the file system creation will fail.

    Use one of the following installation methods:

    • Install the zone.
      global$ zoneadm -z my-zone install
    • Install the zone from the repository.
      global$ zoneadm -z my-zone install -m manifest -c [ profile | dir ]
    • Install the zone from an image.
      global$ zoneadm -z my-zone install -a archive -s -u
    • Install the zone from a directory.
      global$ zoneadm -z my-zone install -d path -p -v

    The system will display that a ZFS file system has been created for this zone.

    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 list -v
    # zoneadm list -cvd
      ID NAME             STATUS      PATH                      BRAND    IP
       0 global           running     /                         solaris  shared
       - my-zone          configured  /zones/my-zone            solaris  excl
    • 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

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

  4. (Optional) If a storage object contains any preexisting partitions, zpools, or UFS file systems, the install fails and an error message is displayed.

    The source zone must be in the uninstalled state before the force subcommand can be used:

    global$ zoneadm -z my-zone uninstall

    Then, continue the installation and overwrite any preexisting data by using one of the following –x options to zoneadm install:

    • –x force-zpool-import

    • –x force-zpool-create=zpoolname

    • –x force-zpool-create=zpoolname1,zpoolname2,zpoolname3

    • –x force-zpool-create-all

    This option is similar to the zpool create -f command.

    –x force-zpool-create=zpoolname can be used one or more times.

  5. 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      IP
     0  global   running      /                              solaris    shared
     -  my-zone  installed    /zones/my-zone                 solaris    excl  

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 Oracle Solaris Service Management Facility (SMF) framework. You can enable or disable individual services as described in Chapter 3, Administering Services in Managing System Services in Oracle Solaris 11.3.