Go to main content

Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: April 2019

About Cloning Non-Global Zones

Cloning allows you to copy an existing configured and installed zone on your system to rapidly provision a new zone on the same system. Note that at a minimum, you must reset properties and resources for the components that cannot be identical for different zones. Thus, the zonepath must always be changed. In addition, for a shared-IP zone, the IP addresses in any net resources must be different. For an exclusive-IP zone, the physical property of any net resources must be different. Application-specific configurations generally must be re-configured in the clone. For example, if you have a database instance in a zone and you clone that zone, you might have to reconfigure the database instance in the clone so that it recognizes itself as a different instance.

  • Cloning a zone is a faster way to install a zone.

  • The new zone will include any changes that have been made to customize the source zone, such as added packages or file modifications.

    You can clone a zone by using one of the following methods:

  • Clone a zone using the zoneadm clone command. This method is recommended if you are cloning a small number of zones.

    When the source zonepath and the target zonepath both reside on ZFS and are in the same pool, the zoneadm clone command automatically uses ZFS to clone the zone. When using ZFS clone, the data is not actually copied until it is modified. Thus, the initial clone takes very little time. The zoneadm command takes a ZFS snapshot of the source zonepath, and sets up the target zonepath. The zonepath of the destination zone is used to name the ZFS clone.

    Note -  You can specify that a ZFS zonepath be copied instead of ZFS cloned, even though the source could be cloned in this way.

    See Cloning a Non-Global Zone on the Same System for more information.

  • Cloning a zone using a Unified Archive file. This method is recommended when you must clone multiple zones for a large deployment. Cloning a zone by this method requires the following steps:

    1. Creating a Unified Archive file. A Unified Archive file can contain all zones or selected zones.

    2. Using the zonecfg and zoneadm commands to configure and install the new zone or zones. When you create a new zone using an archive as a reference source, the new zone will mimic the original system's configuration.

      See Chapter 1, Oracle Solaris System Recovery and Cloning (Overview) in Using Unified Archives for System Recovery and Cloning in Oracle Solaris 11.3 for further information.