Computer Hardware User Manual
Version 3.1-en Solaris 10 Container Guide - 3.1 5. Cookbooks Effective: 30/11/2009
5.1.13. Configuring a zone by command file or template
[dd] Zones can be configured by using command files for zo n ecfg or by the use of templates. This
allows quick and automatic configuration of many zones avoiding errors.
• Using the zo n ecfg command file
A command file is set up for automatic configuration of the zone.
1. Create zonecfg command file
- with zonecf g -z < zone > expo rt -f <fil e > of an existing zone
- alternatively: create the zone config file with a text editor, one command per line
2. Use the command file to configure a new zone
− z onecf g -z < zone> -f < file>
• Using templates
A new zone is configured by using an already configured zone. Any necessary configuration
changes are done after that
− zone c fg -z <zon e> cr e ate - t <te mplat e -zon e >
5.1.14. Automatic quick installation of zones
[ug] The installation of zones takes just a few to several minutes, depending on the speed of the file
system (disks) and the zone software to be copied. This can be reduced considerably if many zones
are to be created that are identical with respect to their configuration (essential criteria for this are the
inhe r it-pk g-dir settings).
Preparation:
1. zone c fg of a template zone with the desired configuration,
which must not be used later on (for example with the name te m plat e 1).
In so doing, zonepa th must be set, the configuration of the network address should be
absent because the zone merely serves as a template after all and is not to become
operational.
2. Install the zone templ ate1 with z onea d m.
3. Save the contents of the zone templ a te1 in a tar file templ a te1. t ar .
(Note: cp -r is not suitable for copying zones!)
Creation of duplicated zones:
1. Configure with zone cfg using the template function
(cre a te - t temp late1 ).
(The inher it-pk g -dir settings must not be changed!)
2. Change zonepa t h with zonecf g (can be done by script)
3. Enter the network address(es) with zone cfg.
4. Unpack temp late1 . tar below z onepa th of the new zone.
5. <zone> attach
6. Boot the new zone for operation.
Since the template zone cannot be started up directly, the following procedure is required to install
patches:
1. Configure the zone t e mplat e1 (manually or with sysid cfg file)
2. Install the patches (it is best to have all configured zones booted up)
3. De-configure the zone t e mpla t e1 with the command
zlog i n tem plate 1 sys - uncon fig
4. Re-create the zone content file templ a te1. t ar .
Alternatively, the command z onead m -z t empla t e1 clon e can be used instead of a
manual copy.
79