Go to main content

Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: April 2019

Converting a Global Zone Into a Non-Global Zone

Because zones do not nest, the P2V process makes any existing zones inside the converted system image unusable in the destination zone. Unified archives bypass this limitation by using the archiveadm create -r -z command. For more information, see Recovery Archives in Using Unified Archives for System Recovery and Cloning in Oracle Solaris 11.3.

This section provides the following information:

About Converting an Oracle Solaris System (Global Zone) Into a solaris Brand Non-Global Zone

An existing Oracle Solaris 11 system can be directly migrated into a solaris brand zone on an Oracle Solaris 11 system. Use the Unified Archive archiveadm command on systems running Oracle Solaris 11.2 or higher. Use legacy archives on systems running the Oracle Solaris 11 or Oracle Solaris 11.1 releases.

For all systems, use the zonep2vchk command on the source system to prepare for converting and archiving the system image. Use the zonecfg and zoneadm commands to configure and to install the archive in the destination zone on the target system.

    The following restrictions apply to migrating a global zone to a non-global zone:

  • The global zone on the target system must be running an Oracle Solaris 11 release that is equal to or higher than the source system.

  • To ensure that the zone runs properly, the target system must have the same or a later version of required operating system packages. Other packages, such as packages for third-party products, can be different.

For more information, see the zonep2vchk(1M), archiveadm(1M), zfs(1M), zonecfg(1M), and zoneadm(1M), and solaris(5) man pages.

Scanning the Source System With zonep2vchk

  1. Assume the root role.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.3.

  2. Run the zonep2vchk tool with the –b option to perform a basic analysis that checks for Oracle Solaris features in use that might be impacted by a P2V migration.
    source# zonep2vchk -b
  3. Run the zonep2vchk tool with the –s option to perform a static analysis of application files.

    This inspects ELF binaries for system and library calls that might affect operation inside a zone.

    source# zonep2vchk -s /opt/myapp/bin,/opt/myapp/lib
  4. Run the zonep2vchk tool with the –r option to perform runtime checks that look for processes that could not be executed successfully inside a zone.
    source# zonep2vchk -r 2h
  5. Run the zonep2vchk tool with the –c option on the source system to generate a template zonecfg script, named s11-zone.config in this procedure.
    source# zonep2vchk -c > /net/somehost/p2v/s11-zone.config

    This configuration will contain resource limits and network configuration based on the physical resources and networking configuration of the source host.

How to Create an Archive of the System Image on a Network Device

Archive the file systems in the global zone. Verify that no non-global zones are installed on the source system. The examples in this section use the archiveadm command for creating archives.

  1. Become an administrator who is assigned the Unified Archive Administration rights profile.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.3.

  2. Create a recovery archive of the global zone on network storage.

    In this procedure, the recovery archive of the global zone is named /net/somehost/p2v/s11-zone-config.uar.

    source$ archiveadm create -r -z global /net/somehost/p2v/s11-zone-config.uar

See Also

The Unified Archive generated with archiveadm contains a zone configuration that serves as a starting point for the converted zone. Additional configuration may be needed to configure the zone in a way that is optimal for the target system. For more information, see How to Create a Recovery Archive in Using Unified Archives for System Recovery and Cloning in Oracle Solaris 11.3 and the archiveadm(1M) man page.

How to Configure and Install a Migrated Zone on the Target System

The template zonecfg script generated by the zonep2vchk tool defines aspects of the source system's configuration that must be supported by the destination zone configuration. Additional target system dependent information must be manually provided to fully define the zone.

In this procedure, the zone is named s11-zone and the configuration file is named /net/somehost/p2v/s11-zone-config.uar.

  1. Become a zone administrator.

    You must also be assigned the Network Management rights profile. The root role has all of these rights.

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

  2. Configure the zone from the archive.
    target$ zonecfg -z s11-zone
    Use 'create' to begin configuring a new zone.
    zonecfg:s11-zone> create -a /net/somehost/p2v/s11-zone-config.uar
    zonecfg:s11-zone> info
  3. Add the zone's storage resources.
    zonecfg:s11-zone> set zonepath=/system/zones/%{zonename}
    zonecfg:s11-zone> add rootzpool
    zonecfg:s11-zone:rootzpool> add storage iscsi://zfssa/luname.naa.600144F0DBF8AF19000052E820D60003
    zonecfg:zonename:rootzpool> end

    Best practice is to use ZOSS for a storage resource when configuring zones that were deployed using Unified Archives. See Getting Started With Oracle Solaris Zones on Shared Storage.

  4. Use the following commands in the global zone of the target system to view the current link configuration.
    target$ dladm show-link
    target$ dladm show-phys
    target$ ipadm show-addr

    By default, the zonecfg script defines an exclusive-IP network configuration with an anet resource for every physical network interface that was configured on the source system. The target system automatically creates a VNIC for each anet resource when the zone boots.

    The use of VNICs make it possible for multiple zones to share the same physical network interface. The lower-link name of an anet resource is initially set to change-me by the zonecfg command. You must manually set this field to the name of one of the data links on the target system. Any link that is valid for the lower link of a VNIC can be specified.

  5. Commit and exit the zone configuration.
    zonecfg:s11-zone> commit
    zonecfg:s11-zone> exit
Example 5  Installing a Zone From a Unified Archive File

Install the zone using the Unified Archive file created on the source system. This example does not alter the original system configuration during the installation.

target$ zoneadm -z s11-zone install -a s11-zone-config.uar