Go to main content

Oracle® Solaris Zones Configuration Resources

Exit Print View

Updated: October 2017
 
 

zonecfg template Property and Tokens

Use different templates to get a specific brand, to get an empty configuration, or to create a zone configuration that looks like another zone that has already been configured.

    Use the zonecfg template property to define whether, and how, properties are changed in the following cases:

  • When new resource instances are added to a configuration.

  • During configuration cloning, when some properties must have unique values. Use tokens in the template property to provide these unique values.

Table 1  zonecfgtemplate Tokens
Token
Description
Usage
%{zonename}
The name of the zone.
Can be used in zonecfg as input from the user, or input from a template value.
%{id}
A unique instance number that is the resource's id property value.
Can be used in zonecfg as input from the user, or input from a template value. Evaluates to the id property of a particular resource. Should be used within a resource scope that supports the id property.
%{ global-rootzpooll}
Evaluates to the name of the root pool in the global zone.
Used in the default solaris-kz device resource.
%%
Evaluates to %.
Can be used in zonecfg as input from the user.
Table 2  Supported Tokens by Resource Property
Resource
Property
Supported Tokens
global property
zonepath
%{zonename}
anet
linkname
%{id}
dataset
name
%{zonename}
device
match
%{zonename}, %{id}, %{global-rootzpool}
storage
%{zonename}, %{id}, %{global-rootzpool}
fs
dir
%{zonename}
net
physical
%{id}
rootzpool
storage
%{zonename}, %{global-rootzpool}
suspend
storage
%{zonename}, %{global-rootzpool}
path
%{zonename}
zpool
storage
%{zonename}, %{global-rootzpool}
Example 1  %{zonename} Property in zonepath
zonecfg:nz> info zonepath
zonepath.template: /system/zones/%{zonename}
zonepath: /system/zones/nz
zonecfg:nz> set zonename=new-zone
zonecfg:new-zone> info zonepath
zonepath.template: /system/zones/%{zonename}
zonepath: /system/zones/new-zone
zonecfg:new-zone>
Example 2  Token Used for the storage Property in the solaris-kz device Resource
device 0:
         match not specified
         storage.template: dev:/dev/zvol/dsk/%{global-rootzpool}/VARSHARE/zones/%{zonename}/disk%{id}
         storage: dev:/dev/zvol/dsk/rpool/VARSHARE/zones/kernel-zone1/disk0
         id: 0
         bootpri: 0

Note -  You can configure a solaris-kz branded zone by using the SYSsolaris-kz template. By default, the SYSsolaris-kz template configures a zone with 4 virtual CPUs and 4 gigabytes (GB) of memory.

You can configure a minimal kernel zone by using the SYSsolaris-kz-minimal template. The SYSsolaris-kz minimal template configures a zone with 1 virtual CPU and 2 GB of memory.


The zones remote administration daemon (RAD) module configuration provides a systemic way to express, enforce, or implement changes by using the property templates. See the zonemgr(3RAD) man page. If the rad-zonemgr package was not initially installed on your system and you installed it later using pkg install, you must restart rad:local. Also restart rad:remote, if that was running. To restart, use svcadm(1M). Make sure the RAD daemon loaded the module.