Use cloning to provision a new zone on a system by copying the data from a source zonepath to a target zonepath.
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. However, you can specify that the ZFS zonepath be copied and not ZFS cloned.
You must configure the new zone before you can install it. The parameter passed to the zoneadm create subcommand is the name of the zone to clone. This source zone must be halted.
For more information, see Assigning Limited Rights to Zone Administrators.
global$ zoneadm -z my-zone halt
global$ zonecfg -z my-zone export -f /zones/master
Set different properties and resources for the components that cannot be identical for different zones. For example, you must set a new zonepath.
For a shared-IP zone, the IP addresses in any net resources must be changed.
For an exclusive-IP zone, the physical property of any net resource must be changed.
global# zonecfg -z zone1 -f /zones/master
global# zoneadm -z zone1 clone my-zone
The system displays:
Cloning zonepath /zones/my-zone...
This continues the operation and overwrites any preexisting data. This option is similar to the zpool create -f command.
-x force-zpool-import
-x force-zpool-create=zpoolname
-x force-zpool-create=zpoolname1,zpoolname2,zpoolname3
-x force-zpool-create-all
The –x force-zpool-create=zpoolname option can be used multiple times.
ID NAME STATUS PATH BRAND IP 0 global running / solaris shared - my-zone installed /zones/my-zone solaris excl - zone1 installed /zones/zone1 solaris excl
Provide an absolute path to the configuration file:
# zoneadm -z zone1 clone -c /path/config.xml my-zone
Note that you must provide an absolute path to the configuration file.