<chapter id="z.config.ov-1"><title>Non-Global Zone Configuration (Overview)</title><highlights><para>This chapter provides an introduction to non-global zone configuration.</para><para>The following topics are covered in this chapter:</para><itemizedlist><listitem><para><olink targetptr="gejut" remap="internal">About Resources in Zones</olink></para>
</listitem><listitem><para><olink targetptr="z.config.ov-2" remap="internal">Pre-Installation Configuration
Process</olink></para>
</listitem><listitem><para><olink targetptr="z.config.ov-3" remap="internal">Zone Components</olink></para>
</listitem><listitem><para><olink targetptr="z.config.ov-5" remap="internal">Using the zonecfg Command</olink></para>
</listitem><listitem><para><olink targetptr="z.config.ov-10" remap="internal">zonecfg Modes</olink></para>
</listitem><listitem><para><olink targetptr="z.config.ov-12" remap="internal">Zone Configuration Data</olink></para>
</listitem><listitem><para><olink targetptr="z.config.ov-18" remap="internal">Tecla Command-Line Editing
Library</olink></para>
</listitem>
</itemizedlist><para>After you have learned about zone configuration, go to <olink targetptr="z.conf.start-1" remap="internal">Chapter&nbsp;18, Planning and Configuring Non-Global
Zones (Tasks)</olink> to configure non-global zones for installation on your
system.</para><para>For information about <literal>lx</literal> branded zone configuration,
see <olink targetptr="gcwwm" remap="internal">Chapter&nbsp;30, Planning the lx Branded Zone
Configuration (Overview)</olink> and <olink targetptr="gdajn" remap="internal">Chapter&nbsp;31,
Configuring the lx Branded Zone (Tasks)</olink>.</para>
</highlights><sect1 id="gejut"><title>About Resources in Zones</title><para>A zone that includes resource management features is called a container.
Resources that can be controlled in a container include the following:</para><itemizedlist><listitem><para>Resource pools or assigned CPUs, which are used for partitioning
machine resources.</para>
</listitem><listitem><para>Resource controls, which provide a mechanism for the constraint
of system resources.</para>
</listitem><listitem><para>Scheduling class, which enables you to control the allocation
of available CPU resources among zones, based on their importance. This importance
is expressed by the number of shares of CPU resources that you assign to each
zone.</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="z.config.ov-2"><title>Pre-Installation Configuration Process</title><para>Before you can install a non-global zone and use it
on your system, the zone must be configured.</para><para>The <command>zonecfg</command> command is used to create the configuration
and to determine whether the specified resources and properties are valid
on a hypothetical system. The check performed by <command>zonecfg</command> for
a given configuration verifies the following:</para><itemizedlist><listitem><para>Ensures that a zone path is specified</para>
</listitem><listitem><para>Ensures that all of the required properties for each resource
are specified</para>
</listitem>
</itemizedlist><para>For more information about the <command>zonecfg</command> command, see
the <olink targetdoc="group-refman" targetptr="zonecfg-1m" remap="external"><citerefentry><refentrytitle>zonecfg</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</sect1><sect1 id="z.config.ov-3"><title>Zone Components</title><para>This section covers the required and optional zone components that can
be configured. Additional information is provided in <olink targetptr="z.config.ov-12" remap="internal">Zone Configuration Data</olink>.</para><sect2 id="z.config.ov-9"><title>Zone Name and Path</title><para>You must choose a name and a path for your zone.</para>
</sect2><sect2 id="gdagb"><title>Zone Autoboot</title><para>The <literal>autoboot</literal> property setting determines whether
the zone is automatically booted when the global zone is booted. The zones
service, <literal>svc:/system/zones:default</literal> must also be enabled.</para>
</sect2><sect2 id="gdafs"><title>Resource Pool Association</title><para>If you have configured resource pools on your system as described in <olink targetptr="rmpool.task-1" remap="internal">Chapter&nbsp;13, Creating and Administering Resource
Pools (Tasks)</olink>, you can use the <literal>pool</literal> property to
associate the zone with one of the resource pools when you configure the zone.</para><para>If you do not have resource pools configured, you can still specify
that a subset of the system's processors be dedicated to a non-global zone
while it is running by using the <literal>dedicated-cpu</literal> resource.
The system will dynamically create a temporary pool for use while the zone
is running. With specification through <command>zonecfg</command>, pool settings
propagate during migrations.</para><note><para>A zone configuration using a persistent pool set through the <literal>pool</literal> property is incompatible with a temporary pool configured through
the <literal>dedicated-cpu</literal> resource. You can set only one of these
two properties.</para>
</note>
</sect2><sect2 id="gejlw"><title><literal>dedicated-cpu</literal> Resource</title><para>The <literal>dedicated-cpu</literal> resource specifies that a
subset of the system's processors should be dedicated to a non-global zone
while it is running. When the zone boots, the system will dynamically create
a temporary pool for use while the zone is running.</para><para>With specification in <command>zonecfg</command>, pool settings propagate
during migrations.</para><para>The <literal>dedicated-cpu</literal> resource sets limits for <literal>ncpus</literal>, and optionally, <literal>importance</literal>. </para><variablelist><varlistentry><term><literal>ncpus</literal></term><listitem><para>Specify the number of CPUs or specify a range, such as 2&ndash;4
CPUs. If you specify a range because you want dynamic resource pool behavior,
also do the following:</para><itemizedlist><listitem><para>Set the <literal>importance</literal> property.</para>
</listitem><listitem><para>Enable the <command>poold</command> service. For instructions,
see <olink targetptr="gbvdw" remap="internal">How to Enable the Dynamic Resource Pools Service
Using svcadm</olink>.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry><varlistentry><term><literal>importance</literal></term><listitem><para>If you are using a CPU range to achieve dynamic behavior,
also set the <literal>importance</literal> property, The <literal>importance</literal> property,
which is <emphasis>optional</emphasis>, defines the relative importance of
the pool. This property is only needed when you specify a range for <literal>ncpus</literal> and are using dynamic resource pools managed by <command>poold</command>.
If <command>poold</command> is not running, then <literal>importance</literal> is
ignored. If <command>poold</command> is running and <literal>importance</literal> is
not set, <literal>importance</literal> defaults to <literal>1</literal>. For
more information, see <olink targetptr="gbvhv" remap="internal">pool.importance Property Constraint</olink>.</para>
</listitem>
</varlistentry>
</variablelist><note><para>The <literal>capped-cpu</literal> resource and the <literal>dedicated-cpu</literal> resource are incompatible. The <literal>cpu-shares</literal> rctl
and the <literal>dedicated-cpu</literal> resource are incompatible.</para>
</note>
</sect2><sect2 id="gepzc"><title><literal>capped-cpu</literal> Resource</title><para>The <literal>capped-cpu</literal> resource
provides an absolute fine-grained limit on the amount of CPU resources that
can be consumed by a project or a zone. When used in conjunction with  processor
sets, CPU caps limit CPU usage within a set. The <literal>capped-cpu</literal> resource
has a single <literal>ncpus</literal> property that is a positive decimal
with two digits to the right of the decimal. This property corresponds to
units of CPUs. The resource does not accept a range. The resource does accept
a decimal number. When specifying <literal>ncpus</literal>, a value of <literal>1</literal> means 100 percent of a CPU. A value of <literal>1.25</literal> means
125 percent, because 100 percent corresponds to one full CPU on the system.</para><note><para>The <literal>capped-cpu</literal> resource and the <literal>dedicated-cpu</literal> resource are incompatible.</para>
</note>
</sect2><sect2 id="gejen"><title>Scheduling Class</title><para>You
can use the <emphasis>fair share scheduler</emphasis> (FSS) to control the
allocation of available CPU resources among zones, based on their importance.
This importance is expressed by the number of <emphasis>shares</emphasis> of
CPU resources that you assign to each zone. Even if you are not using FSS
to manage CPU resource allocation between zones, you can set the zone's scheduling-class
to use FSS so that you can set shares on projects within the zone.</para><para>When you explicitly set the <literal>cpu-shares</literal> property,
the fair share scheduler (FSS) will be used as the scheduling class for that
zone. However, the preferred way to use FSS in this case is to set FSS to
be the system default scheduling class with the <command>dispadmin</command> command.
That way, all zones will benefit from getting a fair share of the system CPU
resources. If <literal>cpu-shares</literal> is not set for a zone, the zone
will use the system default scheduling class. The following actions set the
scheduling class for a zone:</para><itemizedlist><listitem><para>You can use the <literal>scheduling-class</literal> property
in <command>zonecfg</command> to set the scheduling class for the zone.</para>
</listitem><listitem><para>You can set the scheduling class for a zone through the resource
pools facility. If the zone is associated with a pool that has its <literal>pool.scheduler</literal> property set to a valid scheduling class, then processes running
in the zone run in that scheduling class by default. See <olink targetptr="rmpool-2" remap="internal">Introduction to Resource Pools</olink> and <olink targetptr="rmpool.task-22" remap="internal">How to Associate a Pool With a Scheduling Class</olink>.</para>
</listitem><listitem><para>If the <literal>cpu-shares</literal> rctl is set and FSS has
not been set as the scheduling class for the zone through another action, <literal>zoneadmd</literal> sets the scheduling class to FSS when the zone boots.</para>
</listitem><listitem><para>If the scheduling class is not set through any other action,
the zone inherits the system default scheduling class.</para>
</listitem>
</itemizedlist><para>Note that you can use the <command>priocntl</command> described in the <olink targetdoc="group-refman" targetptr="priocntl-1" remap="external"><citerefentry><refentrytitle>priocntl</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man page to
move running processes into a different scheduling class without changing
the default scheduling class and rebooting.</para>
</sect2><sect2 id="gejkz"><title>Physical Memory Control and the <literal>capped-memory</literal> Resource</title><para>The <literal>capped-memory</literal> resource sets limits for <literal>physical</literal>, <literal>swap</literal>, and <literal>locked</literal> memory.
Each limit is optional, but at least one must be set.</para><itemizedlist><listitem><para>Determine
values for this resource if you plan to cap memory for the zone by using <literal>rcapd</literal> from the global zone. The <literal>physical</literal> property
of the <literal>capped-memory</literal> resource is used by <literal>rcapd</literal> as
the <literal>max-rss</literal> value for the zone.</para>
</listitem><listitem><para>The <literal>swap</literal> property of the <literal>capped-memory</literal> resource is
the preferred way to set the <literal>zone.max-swap</literal> resource control.</para>
</listitem><listitem><para>The <literal>locked</literal> property of the <literal>capped-memory</literal> resource
is the preferred way to set the <literal>zone.max-locked-memory</literal> resource
control.</para>
</listitem>
</itemizedlist><para>For more information, see <olink targetptr="rm.rcapd-1" remap="internal">Chapter&nbsp;10,
Physical Memory Control Using the Resource Capping Daemon (Overview)</olink>, <olink targetptr="rm.rcapd.task-1" remap="internal">Chapter&nbsp;11, Administering the Resource Capping
Daemon (Tasks)</olink>, and <olink targetptr="z.conf.start-29" remap="internal">How to Configure
the Zone</olink>.</para>
</sect2><sect2 id="z.config.ov-6"><title>Zone Network Interfaces</title><para>Zone network interfaces configured by the <command>zonecfg</command> command
to provide network connectivity will automatically be set up and placed in
the zone when it is booted.</para><para>The Internet Protocol (IP) layer accepts and delivers packets for the
network. This layer includes IP routing, the Address Resolution Protocol (ARP),
IP security architecture (IPsec), and IP Filter.</para><para>There are two IP types available for non-global zones, shared-IP and
exclusive-IP. The shared-IP zone shares a network interface and the exclusive-IP
zone must have a dedicated network interface.</para><para>For information about IP features in each type, see <olink targetptr="z.admin.ov-9" remap="internal">Networking in Shared-IP Non-Global Zones</olink> and <olink targetptr="gelkh" remap="internal">Networking in Exclusive-IP Non-Global Zones</olink>.</para><sect3 id="gekku"><title>Shared-IP Non-Global Zones</title><para>The
shared-IP zone is the default type. The zone must have one or more dedicated
IP addresses. A shared-IP zone shares the IP layer configuration and state
with the global zone. The zone should use the shared-IP instance if both of
the following are true:</para><itemizedlist><listitem><para>The zone is to be connected to the same data-link, that is,
be on the same IP subnet or subnets as the global zone</para>
</listitem><listitem><para>You do not want the other capabilities that the exclusive-IP
zone provides.</para>
</listitem>
</itemizedlist><para>Shared-IP zones are assigned one or more IP addresses using the <command>zonecfg</command> command. The data-link names must also be configured in the global
zone.</para><para>In the <command>zonecfg</command> <literal>net</literal> resource, the <literal>address</literal> and the <literal>physical</literal> properties must be set.
The <literal>defrouter</literal> property is optional.</para><para>These addresses are associated with logical network interfaces. The <command>ifconfig</command> command can be used from the global zone to add or remove
logical interfaces in a running zone. For more information, see <olink targetptr="z.admin.ov-12" remap="internal">Shared-IP Network Interfaces</olink>.</para>
</sect3><sect3 id="gekkb"><title>Exclusive-IP Non-Global Zones</title><para>Full
IP-level functionality is available in an exclusive-IP zone.</para><para>An exclusive-IP zone has its own IP-related state.</para><para>This includes the ability to use the following features in an exclusive-IP
zone:</para><itemizedlist><listitem><para>DHCPv4 and IPv6 stateless address autoconfiguration</para>
</listitem><listitem><para>IP Filter, including network address translation
(NAT) functionality</para>
</listitem><listitem><para>IP Network Multipathing (IPMP)</para>
</listitem><listitem><para>IP routing</para>
</listitem><listitem><para><command>ndd</command> for setting TCP/UDP/SCTP as well as
IP/ARP-level knobs</para>
</listitem><listitem><para>IP security (IPsec) and IKE, which automates the provision
of authenticated keying material for IPsec security association</para>
</listitem>
</itemizedlist><para>An exclusive-IP zone is assigned its own set of data-links using
the <command>zonecfg</command> command. The zone is given a data-link name
such as <literal>xge0</literal>, <literal>e1000g1</literal>, or <literal>bge32001</literal>, using the <literal>physical</literal> property of the <literal>net</literal> resource.
The <literal>address</literal> and the <literal>defrouter</literal> properties
of the <literal>net</literal> resource are not set.</para><para>Note that the assigned data-link enables the <command>snoop</command> command
to be used.</para><para>The <command>dladm</command> command can be used with the <literal>show-linkprop</literal> subcommand to show the assignment of data-links to running exclusive-IP
zones. The <command>dladm</command> command can be used with the <literal>set-linkprop</literal> subcommand to assign additional data-links to running zones. See <olink targetptr="geohb" remap="internal">Administering Data-Links in Exclusive-IP Non-Global Zones</olink> for
usage examples.</para><para>Inside a running exclusive-IP zone, the <command>ifconfig</command> command
can be used to configure IP, which includes the ability to add or remove logical
interfaces. The IP configuration in a zone can be set up in the same way as
for the global zone, by using the <literal>sysidtools</literal> described
in <olink targetdoc="group-refman" targetptr="sysidcfg-4" remap="external"><citerefentry><refentrytitle>sysidcfg</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink>.</para><note><para>The IP configuration of an exclusive-IP zone can only be viewed
from the global zone by using the <command>zlogin</command> command. An example
follows.</para><screen>global# <userinput>zlogin zone1 ifconfig -a</userinput></screen>
</note>
</sect3><sect3 id="geocw"><title>Security Differences Between Shared-IP and Exclusive-IP
Non-Global Zones</title><para>In a shared-IP zone, applications in the zone, including the superuser,
cannot send packets with source IP addresses other than the ones assigned
to the zone through the <command>zonecfg</command> utility. This type of zone
does not have access to send and receive arbitrary data-link (layer 2) packets.</para><para>For an exclusive-IP zone, <command>zonecfg</command> instead grants
the entire specified data-link to the zone. As a result, the superuser in
an exclusive-IP zone can send spoofed packets on those data-links, just as
can be done in the global  zone.</para>
</sect3><sect3 id="geotb"><title>Using Shared-IP and Exclusive-IP Non-Global Zones
at the Same Time</title><para>The shared-IP zones always share the IP layer with the global zone,
and the exclusive-IP zones always have their own instance of the IP layer.
Both shared-IP zones and exclusive-IP zones can be used on the same machine.</para>
</sect3>
</sect2><sect2 id="z.config.ov-7"><title>File Systems Mounted in Zones</title><para>Generally, the file systems mounted in a zone include the following:</para><itemizedlist><listitem><para>The set of file systems mounted when the virtual platform
is initialized</para>
</listitem><listitem><para>The set of file systems mounted from within the application
environment itself</para>
</listitem>
</itemizedlist><para>This can include, for example, the following file systems:</para><itemizedlist><listitem><para>File systems specified in a zone's <filename>/etc/vfstab</filename> file</para>
</listitem><listitem><para><filename>AutoFS</filename> and <filename>AutoFS</filename>-triggered
mounts</para>
</listitem><listitem><para>Mounts explicitly performed by a zone administrator</para>
</listitem>
</itemizedlist><para>Certain restrictions are placed on mounts performed from within the
application environment. These restrictions prevent the zone administrator
from denying service to the rest of the system, or otherwise negatively impacting
other zones.</para><para>There are security restrictions associated with mounting certain file
systems from within a zone. Other file systems exhibit special behavior when
mounted in a zone. See <olink targetptr="z.admin.ov-2" remap="internal">File Systems and Non-Global
Zones</olink> for more information.</para>
</sect2><sect2 id="z.config.ov-8"><title>Configured Devices in Zones</title><para>The <command>zonecfg</command> command uses a rule-matching system to
specify which devices should appear in a particular zone. Devices matching
one of the rules are included in the zone's <literal>/dev</literal> file system.
For more information, see <olink targetptr="z.conf.start-29" remap="internal">How to Configure
the Zone</olink>.</para>
</sect2><sect2 id="z.config.ov-13"><title>Setting Zone-Wide Resource Controls</title><para>The
global administrator can set privileged zone-wide resource controls for a
zone. Zone-wide resource controls limit the total resource usage of all process
entities within a zone.</para><para>These limits are specified for both the global and non-global zones
by using the <command>zonecfg</command> command. See <olink targetptr="z.conf.start-29" remap="internal">How to Configure the Zone</olink>.</para><para>The preferred, simpler method for setting a zone-wide resource control
is to use the property name instead of the <literal>rctl</literal> resource.</para><para>The <literal>zone.cpu-cap</literal> resource control sets an absolute
limit on the amount of CPU resources that can be consumed by a zone. A value
of <literal>100</literal> means 100 percent of one CPU as the <literal>project.cpu-cap</literal> setting. A value of <literal>125</literal> is 125 percent, because
100 percent corresponds to one full CPU on the system when using CPU caps.</para><note><para>When setting the <literal>capped-cpu</literal> resource, you can
use a decimal number for the unit. The value correlates to the <literal>zone.capped-cpu</literal> resource control, but the setting is scaled down by 100. A setting
of <literal>1</literal> is equivalent to a setting of <literal>100</literal> for
the resource control.</para>
</note><para>The <literal>zone.cpu-shares</literal> resource control sets a
limit on the number of fair share scheduler (FSS) CPU shares for a zone. CPU
shares are first allocated to the zone, and then further subdivided among
projects within the zone as specified in the <literal>project.cpu-shares</literal> entries.
For more information, see <olink targetptr="z.admin.task-71" remap="internal">Using the Fair
Share Scheduler on a Solaris System With Zones Installed</olink>. The global
property name for this control is <literal>cpu-shares</literal>.</para><para>The <literal>zone.max-locked-memory</literal> resource
control limits the amount of locked physical memory available to a zone The
allocation of the locked memory resource across projects within the zone can
be controlled by using the <literal>project.max-locked-memory</literal> resource
control. See <olink targetptr="rmctrls-tbl-5" remap="internal">Table&nbsp;6&ndash;1</olink> for
more information.</para><para>The <literal>zone.max-lwps</literal> resource control enhances
resource isolation by preventing too many LWPs in one zone from affecting
other zones. The allocation of the LWP resource across projects within the
zone can be controlled by using the <literal>project.max-lwps</literal> resource
control. See <olink targetptr="rmctrls-tbl-5" remap="internal">Table&nbsp;6&ndash;1</olink> for
more information. The global property name for this control is <literal>max-lwps</literal>.</para><para>The <literal>zone.max-msg-ids</literal>, <literal>zone.max-sem-ids</literal>, <literal>zone.max-shm-ids</literal>, and <literal>zone.max-shm-memory</literal> resource controls are used to limit System V resources used by
all processes within a zone. The allocation of System V resources across projects
within the zone can be controlled by using the project versions of these resource
controls. The global property names for these controls are <literal>max-msg-ids</literal>, <literal>max-sem-ids</literal>, <literal>max-shm-ids</literal>, and <literal>max-shm-memory</literal>.</para><para>The <literal>zone.max-swap</literal> resource control limits swap
consumed by user process address space mappings and <literal>tmpfs</literal> mounts
within a zone. The output of <command>prstat</command> <option>Z</option> displays
a SWAP column. The swap reported is the total swap consumed by the zone's
processes and <literal>tmpfs</literal> mounts. This value assists in monitoring
the swap reserved by each zone, which can be used to choose an appropriate <literal>zone.max-swap</literal> setting.</para><table frame="all" id="gdswz"><title>Zone-Wide Resource Controls</title><tgroup cols="5" colsep="1" rowsep="1"><colspec colwidth="39*"/><colspec colwidth="30*"/><colspec colwidth="33*"/><colspec colwidth="20*"/><colspec colwidth="22*"/><thead><row><entry><para>Control Name</para>
</entry><entry><para>Global Property Name</para>
</entry><entry><para>Description</para>
</entry><entry><para>Default Unit</para>
</entry><entry><para>Value Used For</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>zone.cpu-cap</literal></para>
</entry><entry>
</entry><entry><para>Absolute limit on the amount of CPU resources for this zone</para>
</entry><entry><para>Quantity (number of CPUs), expressed as a percentage</para><note><para>When setting as the <literal>capped-cpu</literal> resource, you
can use a decimal number for the unit.</para>
</note>
</entry><entry>
</entry>
</row><row><entry><para><literal>zone.cpu-shares</literal></para>
</entry><entry><para><literal>cpu-shares</literal></para>
</entry><entry><para>Number of fair share scheduler (FSS) CPU shares for this zone</para>
</entry><entry><para>Quantity (shares)</para>
</entry><entry>
</entry>
</row><row><entry><para><literal>zone.max-locked-memory</literal></para>
</entry><entry>
</entry><entry><para>Total amount of physical locked memory available to a zone.</para><para>If <literal>priv_proc_lock_memory</literal> is assigned to a zone, consider
setting this resource control as well, to prevent that zone from locking all
memory.</para>
</entry><entry><para>Size (bytes)</para>
</entry><entry><para><literal>locked</literal> property of <literal>capped-memory</literal></para>
</entry>
</row><row><entry><para><literal>zone.max-lwps</literal></para>
</entry><entry><para><literal>max-lwps</literal></para>
</entry><entry><para>Maximum number of LWPs simultaneously available to this zone</para>
</entry><entry><para>Quantity (LWPs)</para>
</entry><entry>
</entry>
</row><row><entry><para><literal>zone.max-msg-ids</literal></para>
</entry><entry><para><literal>max-msg-ids</literal></para>
</entry><entry><para>Maximum number of message queue IDs allowed for this zone</para>
</entry><entry><para>Quantity (message queue IDs)</para>
</entry><entry>
</entry>
</row><row><entry><para><literal>zone.max-sem-ids</literal></para>
</entry><entry><para><literal>max-sem-ids</literal></para>
</entry><entry><para>Maximum number of semaphore IDs allowed for this zone</para>
</entry><entry><para>Quantity (semaphore IDs)</para>
</entry><entry>
</entry>
</row><row><entry><para><literal>zone.max-shm-ids</literal></para>
</entry><entry><para><literal>max-shm-ids</literal></para>
</entry><entry><para>Maximum number of shared memory IDs allowed for this zone</para>
</entry><entry><para>Quantity (shared memory IDs)</para>
</entry><entry>
</entry>
</row><row><entry><para><literal>zone.max-shm-memory</literal></para>
</entry><entry><para><literal>max-shm-memory</literal></para>
</entry><entry><para>Total amount of System V shared memory allowed for this zone</para>
</entry><entry><para>Size (bytes)</para>
</entry><entry>
</entry>
</row><row><entry><para><literal>zone.max-swap</literal></para>
</entry><entry>
</entry><entry><para>Total amount of swap that can be consumed by user process address space
mappings and <literal>tmpfs</literal> mounts for this zone.</para>
</entry><entry><para>Size (bytes)</para>
</entry><entry><para><literal>swap</literal> property of <literal>capped-memory</literal></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>These limits can be specified for running processes by using the <command>prctl</command> command. An example is provided in <olink targetptr="z.admin.task-76" remap="internal">How to Set FSS Shares in the Global Zone Using the prctl Command</olink>.
Limits specified through the <command>prctl</command> command are not persistent.
The limits are only in effect until the system is rebooted.</para>
</sect2><sect2 id="gcnwa"><title>Configurable Privileges</title><para>When a zone is booted, a default set of <emphasis>safe</emphasis> privileges
is included in the configuration. These privileges are considered safe because
they prevent a privileged process in the zone from affecting processes in
other non-global zones on the system or in the global zone. You can use the <command>zonecfg</command> command to do the following: </para><itemizedlist><listitem><para>Add to the default set of privileges, understanding that such
changes might allow processes in one zone to affect processes in other zones
by being able to control a global resource.</para>
</listitem><listitem><para>Remove from the default set of privileges, understanding that
such changes might prevent some processes from operating correctly if they
require those privileges to run.</para>
</listitem>
</itemizedlist><note><para>There are a few privileges that cannot be removed from the zone's
default privilege set, and there are also a few privileges that cannot be
added to the set at this time.</para>
</note><para>For more information, see <olink targetptr="z.admin.ov-18" remap="internal">Privileges
in a Non-Global Zone</olink>, <olink targetptr="z.conf.start-29" remap="internal">How to Configure
the Zone</olink>, and <olink targetdoc="group-refman" targetptr="privileges-5" remap="external"><citerefentry><refentrytitle>privileges</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>.</para>
</sect2><sect2 id="z.config.ov-14"><title>Including a Comment for a Zone</title><para>You can add a comment for a zone by using the <literal>attr</literal> resource
type. For more information, see <olink targetptr="z.conf.start-29" remap="internal">How to
Configure the Zone</olink>.</para>
</sect2>
</sect1><sect1 id="z.config.ov-5"><title>Using the <command>zonecfg</command> Command</title><para>The <command>zonecfg</command> command,
which is described in the <citerefentry><refentrytitle>zonecfg</refentrytitle><manvolnum>1M</manvolnum></citerefentry> man page, is used to configure a
non-global zone.</para><para>The <command>zonecfg</command> command can also be used to persistently
specify the resource management settings for the global zone. For example,
you can use the command to configure the global zone to use a dedicated CPU
by using the <literal>dedicated-cpu</literal> resource.</para><para>The <command>zonecfg</command> command can be used in interactive mode,
in command-line mode, or in command-file mode. The following operations can
be performed using this command:</para><itemizedlist><listitem><para>Create or delete (destroy) a zone configuration</para>
</listitem><listitem><para>Add resources to a particular configuration</para>
</listitem><listitem><para>Set properties for resources added to a configuration</para>
</listitem><listitem><para>Remove resources from a particular configuration</para>
</listitem><listitem><para>Query or verify a configuration</para>
</listitem><listitem><para>Commit to a configuration</para>
</listitem><listitem><para>Revert to a previous configuration</para>
</listitem><listitem><para>Rename a zone</para>
</listitem><listitem><para>Exit from a <command>zonecfg</command> session</para>
</listitem>
</itemizedlist><para>The <command>zonecfg</command> prompt is of the following form:</para><screen>zonecfg:<replaceable>zonename</replaceable>></screen><para>When you are configuring a specific resource type, such as a file system,
that resource type is also included in the prompt:</para><screen>zonecfg:<replaceable>zonename</replaceable>:fs></screen><para>For more information, including procedures that show how to use the
various <command>zonecfg</command> components described in this chapter, see <olink targetptr="z.conf.start-1" remap="internal">Chapter&nbsp;18, Planning and Configuring Non-Global
Zones (Tasks)</olink>.</para>
</sect1><sect1 id="z.config.ov-10"><title><command>zonecfg</command> Modes</title><para>The concept of  a <emphasis>scope</emphasis> is used
for the user interface. The scope can be either <emphasis>global</emphasis> or <emphasis>resource specific</emphasis>. The default scope is global.</para><para>In the global scope,
the <command>add</command> subcommand and the <command>select</command> subcommand
are used to select a specific resource. The scope then changes to that resource
type.</para><itemizedlist><listitem><para>For the <command>add</command> subcommand, the <command>end</command> or <command>cancel</command> subcommands are used to complete the resource specification.</para>
</listitem><listitem><para>For the <command>select</command> subcommand, the <command>end</command> or <command>cancel</command> subcommands are used to complete the resource modification.</para>
</listitem>
</itemizedlist><para>The scope then reverts back to global.</para><para>Certain subcommands, such as <command>add</command>, <command>remove</command>,
and <command>set</command>,  have  different semantics in each scope.</para><sect2 id="z.config.ov-4"><title><command>zonecfg</command> Interactive Mode</title><para>In interactive mode, the following subcommands are
supported. For detailed information about semantics and options used with
the subcommands, see the <citerefentry><refentrytitle>zonecfg</refentrytitle><manvolnum>1M</manvolnum></citerefentry> man page for options. For any subcommand
that could result in destructive actions or  loss of work, the system requests
user confirmation before proceeding. You can use the <option>F</option> (force)
option to bypass this confirmation.</para><variablelist><varlistentry><term><command>help</command></term><listitem><para>Print general help, or display help about a given resource.</para><screen>zonecfg:my-zone:inherit-pkg-dir> <userinput>help</userinput></screen>
</listitem>
</varlistentry><varlistentry><term><command>create</command></term><listitem><para>Begin configuring an in-memory configuration for the specified
new zone for one of these purposes:</para><itemizedlist><listitem><para>To apply the Sun default settings to a new configuration.
This method is the default.</para>
</listitem><listitem><para>With the <option>t</option> <replaceable>template</replaceable> option,
to create a configuration that is identical to the specified template. The
zone name is changed from the template name to the new zone name.</para>
</listitem><listitem><para>With the <option>F</option> option, to overwrite an existing
configuration.</para>
</listitem><listitem><para>With the <option>b</option> option, to create a blank configuration
in which nothing is set.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry><varlistentry><term><command>export</command></term><listitem><para>Print the configuration to standard output, or to the output
file specified, in a form that can be used in a command file.</para>
</listitem>
</varlistentry><varlistentry><term><command>add</command></term><listitem><para>In the global scope, add the specified resource type to the
configuration.</para><para>In the resource scope, add a property of the given name with the given
value.</para><para>See <olink targetptr="z.conf.start-29" remap="internal">How to Configure the Zone</olink> and
the <citerefentry><refentrytitle>zonecfg</refentrytitle><manvolnum>1M</manvolnum></citerefentry> man page for more information.</para>
</listitem>
</varlistentry><varlistentry><term><command>set</command></term><listitem><para>Set a given property name to the given property value. Note
that some properties, such as <literal>zonepath</literal>, are global, while
others are resource specific. Thus, this command is applicable in both the
global and resource scopes.</para>
</listitem>
</varlistentry><varlistentry><term><command>select</command></term><listitem><para>Applicable only in the global scope. Select the resource of
the given type that matches the given property name-property value pair criteria
for modification. The scope is changed to that resource type. You must specify
a sufficient number of property name-value pairs for the resource to be uniquely
identified.</para>
</listitem>
</varlistentry><varlistentry><term><command>clear</command></term><listitem><para>Clear the value for optional settings. Required settings cannot
be cleared. However, some required settings can be changed by assigning a
new value.</para>
</listitem>
</varlistentry><varlistentry><term><command>remove</command></term><listitem><para>In the global scope, remove the specified resource type. You
must specify a sufficient number of property name-value pairs for the resource
type to be uniquely identified. If no property name-value pairs are specified,
all instances will be removed.  If more than one exists, a confirmation is
required unless the <option>F</option> option is used.</para><para>In the resource scope, remove the specified property name-property value
from the current resource.</para>
</listitem>
</varlistentry><varlistentry><term><command>end</command></term><listitem><para>Applicable only in the resource scope. End the resource specification.</para><para>The <command>zonecfg</command> command then verifies that the current
resource is fully specified.</para><itemizedlist><listitem><para>If the resource is fully specified, it is added to the in-memory
configuration and the scope will revert back to global.</para>
</listitem><listitem><para>If the specification is incomplete, the system displays an
error message that describes what needs to be done.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry><varlistentry><term><command>cancel</command></term><listitem><para>Applicable only in the resource scope. End the resource specification
and reset the scope to global. Any partially specified resources are not retained.</para>
</listitem>
</varlistentry><varlistentry><term><command>delete</command></term><listitem><para>Destroy the specified configuration. Delete the configuration
both from memory and from stable storage. You must use the <option>F</option> (force)
option with <command>delete</command>.</para><caution><para>This action is instantaneous. No commit is required, and a
deleted zone cannot be reverted.</para>
</caution>
</listitem>
</varlistentry><varlistentry><term><command>info</command></term><listitem><para>Display information about the current configuration or the
global resource properties <literal>zonepath</literal>, <literal>autoboot</literal>,
and <literal>pool</literal>. If a resource type is specified, display information
only about resources of that type. In the resource scope, this subcommand
applies only to the resource being added or modified.</para>
</listitem>
</varlistentry><varlistentry><term><command>verify</command></term><listitem><para>Verify current configuration for correctness. Ensure that
all resources have all of their required properties specified.</para>
</listitem>
</varlistentry><varlistentry><term><command>commit</command></term><listitem><para>Commit current configuration from memory to stable storage.
Until the in-memory configuration is committed, changes can be removed with
the <command>revert</command> subcommand. A configuration must be committed
to be used by <command>zoneadm</command>. This operation is attempted automatically
when you complete a <command>zonecfg</command> session. Because only a correct
configuration can be committed, the commit operation automatically does a
verify.</para>
</listitem>
</varlistentry><varlistentry><term><command>revert</command></term><listitem><para>Revert configuration back to the last committed state.</para>
</listitem>
</varlistentry><varlistentry><term><command>exit</command></term><listitem><para>Exit the <command>zonecfg</command> session.   You can use
the <option>F</option> (force) option with <command>exit</command>.</para><para>A <command>commit</command> is automatically attempted if  needed. Note
that an EOF character can also be used to exit the session.</para>
</listitem>
</varlistentry>
</variablelist>
</sect2><sect2 id="z.config.ov-15"><title><command>zonecfg</command> Command-File
Mode</title><para>In command-file mode, input is taken from a file. The <command>export</command> subcommand
described in <olink targetptr="z.config.ov-4" remap="internal">zonecfg Interactive Mode</olink> is
used to produce this file. The configuration can be printed to standard output,
or the <option>f</option> option can be used to specify an output file.</para>
</sect2>
</sect1><sect1 id="z.config.ov-12"><title>Zone Configuration Data</title><para>Zone configuration data consists of two kinds of entities:
resources and properties. Each resource has a type, and each resource can
also have a set of one or more properties. The properties have names and values.
The set of properties is dependent on the resource type.</para><sect2 id="z.config.ov-16"><title>Resource and Property Types</title><para>The resource and property types are
described as follows:</para><variablelist><varlistentry><term><literal>zonename</literal></term><listitem><para>The name of the zone. The following rules apply to zone names:</para><itemizedlist><listitem><para>Each zone must have a unique name.</para>
</listitem><listitem><para>A zone name is case-sensitive.</para>
</listitem><listitem><para>A zone name must begin with an alphanumeric character.</para><para>The name can contain alphanumeric characters, underbars (<literal>_</literal>),
hyphens (<literal>-</literal>), and periods (<literal>.</literal>).</para>
</listitem><listitem><para>The name cannot be longer than 64 characters.</para>
</listitem><listitem><para>The name <literal>global</literal> and all names beginning
with <literal>SUNW</literal> are reserved and cannot be used.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry><varlistentry><term><literal>zonepath</literal></term><listitem><para>The <literal>zonepath</literal> property is the path to the
zone root. Each zone has a path to its root directory that is relative to
the global zone's root directory. At installation time, the global zone directory
is required to have restricted visibility. It must be owned by <literal>root</literal> with
the mode <literal>700</literal>.</para><para>The non-global zone's root path is one level lower. The zone's root
directory has the same ownership and permissions as the root directory (<literal>/</literal>) in the global zone. The zone directory must be owned by <literal>root</literal> with the mode <literal>755</literal>. These directories are created
automatically with the correct permissions, and do not need to be verified
by the zone administrator. This hierarchy ensures that unprivileged users
in the global zone are prevented from traversing a non-global zone's file
system.</para><informaltable frame="none"><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="50*"/><colspec colwidth="50*"/><thead><row><entry valign="top"><para>Path</para>
</entry><entry valign="top"><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>/home/export/my-zone</literal></para>
</entry><entry><para><command>zonecfg</command> <literal>zonepath</literal></para>
</entry>
</row><row><entry><para><literal>/home/export/my-zone/root</literal></para>
</entry><entry><para>Root of the zone</para>
</entry>
</row><row><entry><para><literal>/home/export/my-zone/root/dev</literal></para>
</entry><entry><para>Devices created for the zone</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para>See <olink targetptr="z.admin.ov-8" remap="internal">Traversing File
Systems</olink> for a further discussion of this issue.</para><note><para>You can move a zone to another location on the same system by
specifying a new, full <literal>zonepath</literal> with the <literal>move</literal> subcommand
of <command>zoneadm</command>. See <olink targetptr="gbwym" remap="internal">Moving a Non-Global
Zone</olink> for instructions.</para>
</note>
</listitem>
</varlistentry><varlistentry><term><literal>autoboot</literal></term><listitem><para>If this property is set to true, the zone is automatically
booted when the global zone is booted. Note that if the zones service, <literal>svc:/system/zones:default</literal> is disabled, the zone will not autoboot, regardless of the setting
of this property. You can enable the zones service with the <literal>svcadm</literal> command
described in the <olink targetdoc="group-refman" targetptr="svcadm-1m" remap="external"><citerefentry><refentrytitle>svcadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page:</para><screen>global# <userinput>svcadm enable zones</userinput></screen>
</listitem>
</varlistentry><varlistentry><term><literal>bootargs</literal></term><listitem><para>This property is used to set a boot argument for the zone. The
boot argument is applied unless overridden by the <command>reboot</command>, <literal>zoneadm boot</literal>, or <literal>zoneadm reboot</literal> commands. See <olink targetptr="gdepq" remap="internal">Zone Boot Arguments</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><literal>pool</literal></term><listitem><para>This property is used to associate the zone with a resource pool
on the system. Multiple zones can share the resources of one pool. Also see <olink targetptr="gejlw" remap="internal">dedicated-cpu Resource</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><literal>limitpriv</literal></term><listitem><para>This property is used to specify a privilege mask other than the
default. See <olink targetptr="z.admin.ov-18" remap="internal">Privileges in a Non-Global Zone</olink>.</para><para>Privileges are added by specifying the privilege name, with or without
the leading <literal>priv_</literal>. Privileges are excluded by preceding
the name with a dash (<literal>-</literal>) or an exclamation mark (<literal>!</literal>).
The privilege values are separated by commas and placed within quotation marks
(<literal>&ldquo;</literal>).</para><para>As described in <olink targetdoc="group-refman" targetptr="priv-str-to-set-3c" remap="external"><citerefentry><refentrytitle>priv_str_to_set</refentrytitle><manvolnum>3C</manvolnum></citerefentry></olink>, the special privilege sets
of <literal>none</literal>, <literal>all</literal>, and <literal>basic</literal> expand
to their normal definitions. Because zone configuration takes place from the
global zone, the special privilege set <literal>zone</literal> cannot be used.
Because a common use is to alter the default privilege set by adding or removing
certain privileges, the special set <literal>default</literal> maps to the
default, set of privileges. When <literal>default</literal> appears at the
beginning of the <literal>limitpriv</literal> property, it expands to the
default set.</para><para>The following entry adds the ability to use DTrace programs that only
require the <literal>dtrace_proc</literal> and <literal>dtrace_user</literal> privileges
in the zone:</para><screen>global# zonecfg -z userzone
zonecfg:userzone> set limitpriv="default,dtrace_proc,dtrace_user"</screen><para>If the zone's privilege set contains a disallowed privilege, is missing
a required privilege, or includes an unknown privilege, an attempt to verify,
ready, or boot the zone will fail with an error message.</para>
</listitem>
</varlistentry><varlistentry><term><literal>scheduling-class</literal></term><listitem><para>This property sets the scheduling class
for the zone. See <olink targetptr="gejen" remap="internal">Scheduling Class</olink> for additional
information and tips.</para>
</listitem>
</varlistentry><varlistentry><term><literal>ip-type</literal></term><listitem><para>This property is required to be set only if the zone is an exclusive-IP
zone. See <olink targetptr="gekkb" remap="internal">Exclusive-IP Non-Global Zones</olink> and <olink targetptr="z.conf.start-29" remap="internal">How to Configure the Zone</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><literal>dedicated-cpu</literal></term><listitem><para>This resource dedicates a subset of the system's processors to
the zone while it is running. The <literal>dedicated-cpu</literal> resource
provides limits for <literal>ncpus</literal> and, optionally, <literal>importance</literal>. For more information, see <olink targetptr="gejlw" remap="internal">dedicated-cpu
Resource</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><literal>capped-cpu</literal></term><listitem><para>This resource sets a limit on the amount of CPU resources that
can be consumed by the zone while it is running. The <literal>capped-cpu</literal> resource
provides a limit for <literal>ncpus</literal>. For more information, see <olink targetptr="gepzc" remap="internal">capped-cpu Resource</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><literal>capped-memory</literal></term><listitem><para>This resource groups the properties used when capping memory for
the zone. The <literal>capped-memory</literal> resource provides limits for <literal>physical</literal>, <literal>swap</literal>, and <literal>locked</literal> memory.
At least one of these properties must be specified.</para>
</listitem>
</varlistentry><varlistentry><term><literal>dataset</literal></term><listitem><para>Adding a Zetabyte File System (ZFS) dataset resource enables the
delegation of storage administration to a non-global zone. The zone administrator
can create and destroy file systems within that dataset, and modify properties
of the dataset. The zone administrator cannot affect datasets that have not
been added to the zone or exceed any top level quotas set on the dataset assigned
to the zone.</para><para>ZFS datasets can be added to a zone in the following ways.</para><itemizedlist><listitem><para>As an lofs mounted file system, when the goal is solely to
share space with the global zone</para>
</listitem><listitem><para>As a delegated dataset</para>
</listitem>
</itemizedlist><para>See <olink targetdoc="zfsadmin" targetptr="ftyxh" remap="external">Chapter 10, <citetitle remap="chapter">ZFS Advanced Topics,</citetitle> in <citetitle remap="book">Solaris ZFS Administration Guide</citetitle></olink> and <olink targetptr="z.admin.ov-2" remap="internal">File Systems and Non-Global Zones</olink>.</para><para>Also see <olink targetptr="gclkx" remap="internal">Chapter&nbsp;28, Troubleshooting Miscellaneous
Solaris Zones Problems</olink> for information on dataset issues.</para>
</listitem>
</varlistentry><varlistentry><term><literal>fs</literal></term><listitem><para>Each zone can have various file systems that are mounted when
the zone transitions from the installed state to the ready state. The file
system resource specifies the path to the file system mount point. For more
information about the use of file systems in zones, see <olink targetptr="z.admin.ov-2" remap="internal">File Systems and Non-Global Zones</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><literal>inherit-pkg-dir</literal></term><listitem><para>This resource should not be configured in a whole root zone.</para><para>In a sparse root zone, the <literal>inherit-pkg-dir</literal> resource
is used to represent directories that contain packaged software that a non-global
zone shares with the global zone.</para><para>The contents of software packages transferred into the <literal>inherit-pkg-dir</literal> directory are inherited in read-only mode by the non-global zone.
The zone's packaging database is updated to reflect the packages. These resources
cannot be modified or removed after the zone has been installed using <command>zoneadm</command>.</para><note><para>Four default <literal>inherit-pkg-dir</literal> resources are
included in the configuration. These directory resources indicate which directories
should have their associated packages inherited from the global zone. The
resources are implemented through a read-only loopback file system mount.</para><itemizedlist><listitem><para><literal>/lib</literal></para>
</listitem><listitem><para><literal>/platform</literal></para>
</listitem><listitem><para><literal>/sbin</literal></para>
</listitem><listitem><para><literal>/usr</literal></para>
</listitem>
</itemizedlist>
</note>
</listitem>
</varlistentry><varlistentry><term><literal>net</literal></term><listitem><para>The network interface resource is the interface name. Each
zone can have network interfaces that should be set up when the zone transitions
from the installed state to the ready state.</para>
</listitem>
</varlistentry><varlistentry><term><literal>device</literal></term><listitem><para>The device resource is the device matching specifier. Each
zone can have devices that should be configured when the zone transitions
from the installed state to the ready state.</para>
</listitem>
</varlistentry><varlistentry><term><literal>rctl</literal></term><listitem><para>The <literal>rctl</literal> resource is used for zone-wide
resource controls. The controls are enabled when the zone transitions from
the installed state to the ready state.</para><para> See <olink targetptr="z.config.ov-13" remap="internal">Setting Zone-Wide Resource Controls</olink> for
more information.</para><note><para>To configure zone-wide controls using the <literal>set</literal> <replaceable>global_property_name</replaceable> subcommand of <command>zonefig</command> instead
of the <literal>rctl</literal> resource, see <olink targetptr="z.conf.start-29" remap="internal">How
to Configure the Zone</olink>.</para>
</note>
</listitem>
</varlistentry><varlistentry><term><literal>attr</literal></term><listitem><para>This generic attribute can be used for user comments or by
other subsystems. The <literal>name</literal> property of an <literal>attr</literal> must
begin with an alphanumeric character. The <literal>name</literal> property
can contain alphanumeric characters, hyphens (<literal>-</literal>), and periods
(<literal>.</literal>). Attribute names beginning with <literal>zone.</literal> are
reserved for use by the system.</para>
</listitem>
</varlistentry>
</variablelist>
</sect2><sect2 id="z.config.ov-17"><title>Resource Type Properties</title><para>Resources also have properties to configure. The following properties
are associated with the resource types shown.</para><variablelist><varlistentry><term><literal>dedicated-cpu</literal></term><listitem><para><literal>ncpus</literal>, <literal>importance</literal></para><para>Specify the number of CPUs and, optionally, the relative importance
of the pool. The following example specifies a CPU range for use by the zone <literal>my-zone</literal>. <literal>importance</literal> is also set.</para><screen>zonecfg:my-zone> <userinput>add dedicated-cpu</userinput>
zonecfg:my-zone:dedicated-cpu> <userinput>set ncpus=1-3</userinput>
zonecfg:my-zone:dedicated-cpu> <userinput>set importance=2</userinput>
zonecfg:my-zone:dedicated-cpu> <userinput>end</userinput></screen>
</listitem>
</varlistentry><varlistentry><term><literal>capped-cpu</literal></term><listitem><para><literal>ncpus</literal></para><para>Specify the number of CPUs. The following example specifies a CPU cap
of 3.5 CPUs for the zone <literal>my-zone</literal>.</para><screen>zonecfg:my-zone> <userinput>add capped-cpu</userinput>
zonecfg:my-zone:capped-cpu> <userinput>set ncpus=3.5</userinput>
zonecfg:my-zone:capped-cpu> <userinput>end</userinput></screen>
</listitem>
</varlistentry><varlistentry><term><literal>capped-memory</literal></term><listitem><para><literal>physical</literal>, <literal>swap</literal>, <literal>locked</literal>Specify the memory limits for the zone <literal>my-zone</literal>.
Each limit is optional, but at least one must be set.</para><screen>zonecfg:my-zone> <userinput>add capped-memory</userinput>
zonecfg:my-zone:capped-memory> <userinput>set physical=50m</userinput>
zonecfg:my-zone:capped-memory> <userinput>set swap=100m</userinput>
zonecfg:my-zone:capped-memory> <userinput>set locked=30m</userinput>
zonecfg:my-zone:capped-memory> <userinput>end</userinput></screen>
</listitem>
</varlistentry><varlistentry><term><literal>fs</literal></term><listitem><para><literal>dir</literal>, <literal>special</literal>, <literal>raw</literal>, <literal>type</literal>, <literal>options</literal></para><para>The <literal>fs</literal> resource parameters supply the values that
determine how and where to mount file systems. The <literal>fs</literal> parameters
are defined as follows:</para><variablelist><varlistentry><term><literal>dir</literal></term><listitem><para>Specifies the mount point for the file system</para>
</listitem>
</varlistentry><varlistentry><term><literal>special</literal></term><listitem><para>Specifies the block special device name or directory from
the global zone to mount</para>
</listitem>
</varlistentry><varlistentry><term><literal>raw</literal></term><listitem><para>Specifies the raw device on which to run <literal>fsck</literal> before
mounting the file system</para>
</listitem>
</varlistentry><varlistentry><term><literal>type</literal></term><listitem><para>Specifies the file system type</para>
</listitem>
</varlistentry><varlistentry><term><literal>options</literal></term><listitem><para>Specifies mount options similar to those found with the <command>mount</command> command </para>
</listitem>
</varlistentry>
</variablelist><para>The lines in the following example specify that <literal>/dev/dsk/c0t0d0s2</literal> in
the global zone is to be mounted as <literal>/mnt</literal> in a zone being
configured. The <literal>raw</literal> property specifies an optional device
on which the <command>fsck</command> command is to be run before an attempt
is made to mount the file system. The file system type to use is UFS. The
options <literal>nodevices</literal> and <literal>logging</literal> are added.</para><screen>zonecfg:my-zone> <userinput>add fs</userinput>
zonecfg:my-zone:fs> <userinput>set dir=/mnt</userinput>
zonecfg:my-zone:fs> <userinput>set special=/dev/dsk/c0t0d0s2</userinput>
zonecfg:my-zone:fs> <userinput>set raw=/dev/rdsk/c0t0d0s2</userinput>
zonecfg:my-zone:fs> <userinput>set type=ufs</userinput>
zonecfg:my-zone:fs> <userinput>add options [nodevices,logging]</userinput>
zonecfg:my-zone:fs> <userinput>end</userinput></screen><para>For more information, see <olink targetptr="z.admin.ov-23" remap="internal">The -o nosuid Option</olink>, <olink targetptr="z.admin.ov-7" remap="internal">Security Restrictions and File System Behavior</olink>,
and the <olink targetdoc="group-refman" targetptr="fsck-1m" remap="external"><citerefentry><refentrytitle>fsck</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="group-refman" targetptr="mount-1m" remap="external"><citerefentry><refentrytitle>mount</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man pages. Also note that
section 1M man pages are available for mount options that are unique to a
specific file system. The names of these man pages have the form <literal>mount_</literal><replaceable>filesystem</replaceable>.</para><note><para>To add a ZFS file system using the <literal>fs</literal> resource
property, see <olink targetdoc="zfsadmin" targetptr="gbbrq" remap="external"><citetitle remap="section">Adding ZFS File Systems to a Non-Global Zone</citetitle> in <citetitle remap="book">Solaris ZFS Administration Guide</citetitle></olink>.</para>
</note>
</listitem>
</varlistentry><varlistentry><term><literal>dataset</literal></term><listitem><para><literal>name</literal></para><para>The lines in the following example specify that the dataset <replaceable>sales</replaceable> is to be visible and mounted in the non-global zone and no
longer visible in the global zone.</para><screen>zonecfg:my-zone> <userinput>add dataset</userinput>
zonecfg:my-zone> <userinput>set name=tank/sales</userinput>
zonecfg:my-zone> <userinput>end</userinput></screen>
</listitem>
</varlistentry><varlistentry><term><literal>inherit-pkg-dir</literal></term><listitem><para><literal>dir</literal></para><para>The lines in the following example specify that <literal>/opt/sfw</literal> is
to be loopback mounted from the global zone.</para><screen>zonecfg:my-zone> <userinput>add inherit-pkg-dir</userinput>
zonecfg:my-zone:inherit-pkg-dir> <userinput>set dir=/opt/sfw</userinput>
zonecfg:my-zone:inherit-pkg-dir> <userinput>end</userinput></screen>
</listitem>
</varlistentry><varlistentry><term><literal>net</literal></term><listitem><para><literal>address</literal>, <literal>physical</literal>, <literal>defrouter</literal></para><note><para>For a shared-IP zone, both the IP address and the device are specified.
Optionally, the default router can be set . For an exclusive-IP zone, only
the physical interface is specified.</para>
</note><para>In the following example for a shared-IP zone, the IP address <literal>192.168.0.1</literal> is added to the zone. An <literal>hme0</literal> card is used for
the physical interface. To determine which physical interface to use, type <command>ifconfig</command> <option>a</option> on your system. Each line of the output,
other than loopback driver lines, begins with the name of a card installed
on your system. Lines that contain <literal>LOOPBACK</literal> in the descriptions
do not apply to cards. The default route is set to <literal>10.0.0.1</literal> for
the zone.</para><screen>zonecfg:my-zone> <userinput>add net</userinput>
zonecfg:my-zone:net> <userinput>set physical=hme0</userinput>
zonecfg:my-zone:net> <userinput>set address=192.168.0.1</userinput>
zonecfg:my-zone:net> <userinput>set defrouter=10.0.0.1</userinput>
zonecfg:my-zone:net> <userinput>end</userinput></screen><para>In the following example for an exclusive-IP zone, a <literal>bge32001</literal> link
is used for the physical interface, which is a VLAN on <literal>bge1</literal>.
To determine which data-links are available, use the command <command>dladm</command> <literal>show-link</literal>. Note that <literal>ip-type=exclusive</literal> must also
be specified.</para><screen>zonecfg:my-zone> <userinput>set ip-type=exclusive</userinput>
zonecfg:my-zone> <userinput>add net</userinput>
zonecfg:my-zone:net> <userinput>set physical=bge32001</userinput>
zonecfg:my-zone:net> <userinput>end</userinput></screen><note><para>Prior to <trademark>OpenSolaris</trademark> build snv_83, the
data-link used with exclusive-IP
zones must be GLDv3 .
Non-GLDv3 data-links appear as <literal>type: legacy</literal> in the <command>dladm</command> <literal>show-link</literal> output. The <literal>ce</literal> legacy
device is an exception. This device can support an exclusive-IP zone.</para>
</note>
</listitem>
</varlistentry><varlistentry><term><literal>device</literal></term><listitem><para><literal>match</literal></para><para>In the following example, a <literal>/dev/pts</literal> device is included
in a zone.</para><screen>zonecfg:my-zone> <userinput>add device</userinput>
zonecfg:my-zone:device> <userinput>set match=/dev/pts*</userinput>
zonecfg:my-zone:device> <userinput>end</userinput></screen><note><para>See <olink targetptr="z.admin.ov-13" remap="internal">Device Use in Non-Global
Zones</olink>.</para>
</note>
</listitem>
</varlistentry><varlistentry><term><literal>rctl</literal></term><listitem><para><literal>name</literal>, <literal>value</literal></para><para> The following zone-wide resource controls are available.</para><itemizedlist><listitem><para><literal>zone.cpu-cap</literal></para>
</listitem><listitem><para><literal>zone.cpu-shares</literal> (preferred: <literal>cpu-shares</literal>)</para>
</listitem><listitem><para><literal>zone.max-locked-memory</literal></para>
</listitem><listitem><para><literal>zone.max-lwps</literal> (preferred: <literal>max-lwps</literal>)</para>
</listitem><listitem><para><literal>zone.max-msg-ids</literal> (preferred: <literal>max-msg-ids</literal>)</para>
</listitem><listitem><para><literal>zone.max-sem-ids</literal> (preferred: <literal>max-sem-ids</literal>)</para>
</listitem><listitem><para><literal>zone.max-shm-ids</literal> (preferred: <literal>max-shm-ids</literal>)</para>
</listitem><listitem><para><literal>zone.max-shm-memory</literal> (preferred: <literal>max-shm-memory</literal>)</para>
</listitem><listitem><para><literal>zone.max-swap</literal></para>
</listitem>
</itemizedlist><para>Note that the preferred, simpler method for setting a zone-wide resource
control is to use the property name instead of the <literal>rctl</literal> resource,
as shown in <olink targetptr="z.conf.start-29" remap="internal">How to Configure the Zone</olink>.
If zone-wide resource control entries in a zone are configured using <literal>add</literal> <literal>rctl</literal>, the format is different than resource
control entries in the <literal>project</literal> database. In a zone configuration,
the <literal>rctl</literal> resource type consists of three name/value pairs.
The names are <literal>priv</literal>, <literal>limit</literal>, and <literal>action</literal>. Each of the names takes a simple value.</para><screen width="100">zonecfg:my-zone> <userinput>add rctl</userinput>
zonecfg:my-zone:rctl> <userinput>set name=zone.cpu-shares</userinput>
zonecfg:my-zone:rctl> <userinput>add value (priv=privileged,limit=10,action=none)</userinput>zonecfg:my-zone:rctl> <userinput>end</userinput></screen><screen width="100">zonecfg:my-zone> <userinput>add rctl</userinput>
zonecfg:my-zone:rctl> <userinput>set name=zone.max-lwps</userinput>
zonecfg:my-zone:rctl> <userinput>add value (priv=privileged,limit=100,action=deny)</userinput>
zonecfg:my-zone:rctl> <userinput>end</userinput></screen><para>For general information about resource controls and attributes, see <olink targetptr="rmctrls-1" remap="internal">Chapter&nbsp;6, Resource Controls (Overview)</olink> and <olink targetptr="z.admin.ov-3" remap="internal">Resource Controls Used in Non-Global Zones</olink>. </para>
</listitem>
</varlistentry><varlistentry><term><literal>attr</literal></term><listitem><para><literal>name</literal>, <literal>type</literal>, <literal>value</literal></para><para>In the following example, a comment about a zone is added.</para><screen>zonecfg:my-zone> <userinput>add attr</userinput>
zonecfg:my-zone:attr> <userinput>set name=comment</userinput>
zonecfg:my-zone:attr> <userinput>set type=string</userinput>
zonecfg:my-zone:attr> <userinput>set value="Production zone"</userinput>
zonecfg:my-zone:attr> <userinput>end</userinput></screen>
</listitem>
</varlistentry>
</variablelist><para>You can use the <command>export</command> subcommand to print a zone
configuration to standard output. The configuration is saved in a form that
can be used in a command file.</para>
</sect2>
</sect1><sect1 id="z.config.ov-18"><title>Tecla Command-Line Editing Library</title><para>The Tecla command-line editing library is included for use with the <command>zonecfg</command> command. The library provides a mechanism for command-line
 history and editing support.</para><para>The Tecla command-line editing library is documented in the following
man pages:</para><itemizedlist><listitem><para><citerefentry><refentrytitle>enhance</refentrytitle><manvolnum>1</manvolnum></citerefentry></para>
</listitem><listitem><para><citerefentry><refentrytitle>libtecla</refentrytitle><manvolnum>3LIB</manvolnum></citerefentry></para>
</listitem><listitem><para><citerefentry><refentrytitle>ef_expand_file</refentrytitle><manvolnum>3TECLA</manvolnum></citerefentry></para>
</listitem><listitem><para><citerefentry><refentrytitle>gl_get_line</refentrytitle><manvolnum>3TECLA</manvolnum></citerefentry></para>
</listitem><listitem><para><citerefentry><refentrytitle>gl_io_mode</refentrytitle><manvolnum>3TECLA</manvolnum></citerefentry></para>
</listitem><listitem><para><citerefentry><refentrytitle>pca_lookup_file</refentrytitle><manvolnum>3TECLA</manvolnum></citerefentry></para>
</listitem><listitem><para><citerefentry><refentrytitle>tecla</refentrytitle><manvolnum>5</manvolnum></citerefentry></para>
</listitem>
</itemizedlist>
</sect1>
</chapter>