<chapter id="z.inst.task-1"><title>Installing, Booting, Halting, Uninstalling,
 and Cloning Non-Global Zones (Tasks)</title><highlights><para>This chapter describes how to install and boot a non-global zone. A
method for using cloning to install a zone on the same system is also provided.
Other tasks associated with installation, such as halting, rebooting, and
uninstalling zones, are addressed. The procedure to completely delete a zone
from a system is also included.</para><para>For general information about zone installation and related operations,
see <olink targetptr="z.inst.ov-1" remap="internal">Chapter&nbsp;19, About Installing, Halting,
Cloning, and Uninstalling Non-Global Zones (Overview)</olink>.</para><para>For information about <literal>lx</literal> branded zone installation
and cloning, see <olink targetptr="gdbki" remap="internal">Chapter&nbsp;32, About Installing,
Booting, Halting, Cloning, and Uninstalling lx Branded Zones (Overview)</olink> and <olink targetptr="gdduh" remap="internal">Chapter&nbsp;33, Installing, Booting, Halting, Uninstalling
and Cloning lx Branded Zones (Tasks)</olink>.</para>
</highlights><sect1 id="z.inst.task-51"><title>Zone Installation (Task Map)</title><informaltable frame="all"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="21*"/><colspec colwidth="50*"/><colspec colwidth="29*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>(Optional) Verify a configured zone prior to installing the zone.</para>
</entry><entry><para>Ensure that a zone meets the requirements for installation. If you skip
this procedure, the verification is performed automatically when you install
the zone.</para>
</entry><entry><para><olink targetptr="z.inst.task-6" remap="internal">(Optional) How to Verify a Configured
Zone Before It Is Installed</olink></para>
</entry>
</row><row><entry><para>Install a configured zone.</para>
</entry><entry><para>Install a zone that is in the configured state.</para>
</entry><entry><para><olink targetptr="z.inst.task-7" remap="internal">How to Install a Configured Zone</olink></para>
</entry>
</row><row><entry><para>Obtain the universally unique identifier (UUID) for the zone.</para>
</entry><entry><para>This separate identifier, assigned when the zone is installed, is an
alternate way to identify a zone.</para>
</entry><entry><para><olink targetptr="gdhcr" remap="internal">How to Obtain the UUID of an Installed Non-Global
Zone</olink></para>
</entry>
</row><row><entry><para>(Optional) Transition an installed zone to the ready state.</para>
</entry><entry><para>You can skip this procedure if you want to boot the zone and use it
immediately.</para>
</entry><entry><para><olink targetptr="z.inst.task-12" remap="internal">(Optional) How to Transition the Installed
Zone to the Ready State</olink></para>
</entry>
</row><row><entry><para>Boot a zone.</para>
</entry><entry><para>Booting a zone places the zone in the running state. A zone can be booted
from the ready state or from the installed state. Note that you must perform
the internal zone configuration when you log in to the zone after booting
it for the first time.</para>
</entry><entry><para><olink targetptr="z.inst.task-13" remap="internal">How to Boot a Zone</olink>, <olink targetptr="z.login.ov-14" remap="internal">Internal Zone Configuration</olink>, <olink targetptr="z.login.task-31" remap="internal">Performing the Initial Internal Zone Configuration</olink></para>
</entry>
</row><row><entry><para>Boot a zone in single-user mode.</para>
</entry><entry><para>Boots only to milestone <literal>svc:/milestone/single-user:default</literal>.
This milestone is equivalent to <command>init</command> level <literal>s</literal>.
See the <olink targetdoc="group-refman" targetptr="init-1m" remap="external"><citerefentry><refentrytitle>init</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="group-refman" targetptr="svc.startd-1m" remap="external"><citerefentry><refentrytitle>svc.startd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man pages.</para>
</entry><entry><para><olink targetptr="fnjyv" remap="internal">How to Boot a Zone in Single-User Mode</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="z.inst.task-2"><title>Installing and Booting Zones</title><para>Use
the <command>zoneadm</command> command described in the <citerefentry><refentrytitle>zoneadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry> man
page to perform installation tasks for a non-global zone. You must be the
global administrator to perform the zone installation. The examples in this
chapter use the zone name and zone path established in <olink targetptr="z.conf.start-85" remap="internal">Configuring, Verifying, and Committing a Zone</olink>.</para><task id="z.inst.task-6"><title>(Optional) How to Verify a Configured Zone
Before It Is Installed</title><tasksummary><para>You
can verify a zone prior to installing it. One of the checks performed is a
check for sufficient disk size. If you skip this procedure, the verification
is performed automatically when you install the zone.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step id="z.inst.task-step-4"><para>Become superuser, or assume the Primary
Administrator role.</para><para>To create the role and assign the role to
a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.inst.task-step-5"><para>Verify a configured zone named <literal>my-zone</literal> by using the <option>z</option> option with the name of the zone
and the <command>verify</command> subcommand.</para><screen>global# <userinput>zoneadm -z my-zone verify</userinput></screen><para>This message regarding verification of the zone path will be displayed:</para><screen>Warning: /export/home/my-zone does not exist, so it cannot be verified.
When 'zoneadm install' is run, 'install' will try to create
/export/home1/my-zone, and 'verify' will be tried again,
but the 'verify' may fail if:
the parent directory of /export/home/my-zone is group- or other-writable
or
/export/home1/my-zone overlaps with any other installed zones.</screen><para>However, if an error message is displayed and the zone fails to verify,
make the corrections specified in the message and try the command again.</para><para>If no error messages are displayed, you can install the zone.</para>
</step>
</procedure>
</task><task id="z.inst.task-7"><title>How to Install a Configured Zone</title><tasksummary><para>This procedure is used
to install a configured non-global zone.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para><note><para>In Step 2, <emphasis>if</emphasis> the <literal>zonepath</literal> is
on ZFS, the <command>zoneadm</command> <literal>install</literal> command
automatically creates a ZFS file system (dataset) for the <literal>zonepath</literal> when
the zone is installed. You can block this action by including the <option>x</option> <literal>nodataset</literal> parameter.</para>
</note>
</tasksummary><procedure><step id="z.inst.task-step-9"><para>Become superuser, or assume the Primary
Administrator role.</para><para>To create the role and assign the role to
a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.inst.task-step-10"><para>Install the configured zone <literal>my-zone</literal> by using the <command>zoneadm</command> command with the <command>install</command> option.</para><stepalternatives><step><para>Install the zone, automatically creating a ZFS file system if
the <literal>zonepath</literal> is on ZFS.</para><screen>global# <userinput>zoneadm -z my-zone install</userinput></screen><para>The system will display:</para><screen>A ZFS file systm has been created for this zone.</screen>
</step><step><para>Install the zone that has a <literal>zonepath</literal> on ZFS,
but do <emphasis>not</emphasis> automatically create the ZFS file system.</para><screen>global# <userinput>zoneadm -z my-zone install -x nodataset</userinput></screen>
</step>
</stepalternatives><para>You will see various messages as the files and directories needed for
the zone's root file system are installed under the zone's root path.</para>
</step><step><para>(Optional) If an error message is displayed and the zone fails
to install, type the following to get the zone state:</para><screen>global# <userinput>zoneadm -z my-zone list -v</userinput></screen><itemizedlist><listitem><para>If the state is listed as configured, make the corrections
specified in the message and try the <command>zoneadm</command> <command>install</command> command
again.</para>
</listitem><listitem><para>If the state is listed as incomplete, first execute this command:</para><screen>global# <userinput>zoneadm -z my-zone uninstall</userinput></screen><para>Then make the corrections  specified in the message, and try the <command>zoneadm</command> <command>install</command> command again.</para>
</listitem>
</itemizedlist>
</step><step id="z.inst.task-step-11"><para>When the installation completes, use
the <command>list</command> subcommand with the <option>i</option> and <option>v</option> options
to list the installed zones and verify the status.</para><screen>global# <userinput>zoneadm list -iv</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 -  my-zone  installed    /export/home/my-zone           native     shared</screen>
</step>
</procedure><taskrelated role="troubleshooting"><para>If a zone installation is interrupted or fails, the zone is left in
the incomplete state. Use <command>uninstall</command> <option>F</option> to
reset the zone to the configured state.</para>
</taskrelated><taskrelated role="additional-action"><para>This zone was installed with the minimal network configuration described
in <olink targetdoc="sysadv1" targetptr="faauf" remap="external">Chapter 16, <citetitle remap="chapter">Managing Services (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink> by default.
You can switch to the open network configuration, or enable or disable individual
services, when you log in to the zone. See <olink targetptr="gdpau" remap="internal">Switching
the Non-Global Zone to a Different Networking Service Configuration</olink> for
details.</para>
</taskrelated>
</task><task id="gdhcr"><title>How to Obtain the UUID of an Installed Non-Global
Zone</title><tasksummary><para>A
universally unique identifier (UUID) is assigned to a zone when it is installed.
The UUID can be obtained by using <command>zoneadm</command> with the <literal>list</literal> subcommand and the <option>p</option> option. The UUID is the fifth
field of the display.</para>
</tasksummary><procedure remap="single-step"><step><para>View the UUIDs for zones that have been installed.</para><screen>global# <userinput>zoneadm list -p</userinput></screen><para>You will see a display similar to the following:</para><screen>0:global:running:/:native
6:my-zone:running:/export/home/my-zone:61901255-35cf-40d6-d501-f37dc84eb504:native</screen>
</step>
</procedure><example id="gdhzf"><title>How to Use the Zone UUID in a Command</title><screen>global# <userinput>zoneadm -z my-zone -u 61901255-35cf-40d6-d501-f37dc84eb504 list -v</userinput></screen><para>If both <option>u</option> <replaceable>uuid-match</replaceable> and <option>z</option> <replaceable>zonename</replaceable> are present, the match is done
based on the UUID first. If a zone with the specified UUID is found, that
zone is used, and the <option>z</option> parameter is ignored. If no zone
with the specified UUID is found, then the system searches by the zone name.</para>
</example><taskrelated-custom><title>About the UUID</title><para>Zones can be uninstalled and reinstalled under the same name with different
contents. Zones can also be renamed without the contents being changed. For
these reasons, the UUID is a more reliable handle than the zone name.</para>
</taskrelated-custom><taskrelated role="see-also"><para>For more information, see <olink targetdoc="refman" targetptr="zoneadm-1m" remap="external"><citerefentry><refentrytitle>zoneadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman" targetptr="libuuid-3lib" remap="external"><citerefentry><refentrytitle>libuuid</refentrytitle><manvolnum>3LIB</manvolnum></citerefentry></olink>.</para>
</taskrelated>
</task><task id="gdhda"><title>How to Mark an Installed Non-Global Zone Incomplete</title><tasksummary><para>If administrative changes
on the system have rendered a zone unusable or inconsistent, it is possible
to change the state of an installed zone to incomplete.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step id="gdhdr"><para>Become superuser, or assume the Primary Administrator
role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step><para>Mark the zone <literal>testzone</literal> incomplete.</para><screen>global# <userinput>zoneadm -z testzone mark incomplete</userinput></screen>
</step><step><para>Use the <command>list</command> subcommand with the <option>i</option> and <option>v</option> options to verify the status.</para><screen>global# <userinput>zoneadm list -iv</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 -  my-zone  installed    /export/home/my-zone           native     shared
 -  testzone incomplete   /export/home/testzone          native     shared</screen>
</step>
</procedure><taskrelated-custom><title>Marking a Zone Incomplete</title><para>The <option>R</option> <replaceable>root</replaceable> option can be
used with the <literal>mark</literal> and <literal>list</literal> subcommands
of <command>zoneadm</command> to specify an alternate boot environment. See <olink targetdoc="refman" targetptr="zoneadm-1m" remap="external"><citerefentry><refentrytitle>zoneadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> for more information.</para><note><para>Marking a zone incomplete is irreversible. The only action that
can be taken on a zone marked incomplete is to uninstall the zone and return
it to the configured state. See <olink targetptr="z.inst.task-36" remap="internal">How to Uninstall
a Zone</olink>.</para>
</note>
</taskrelated-custom>
</task><task id="z.inst.task-12"><title>(Optional) How to Transition the Installed
Zone to the Ready State</title><tasksummary><para>Transitioning
into the ready state prepares the virtual platform to begin running user processes.
Zones in the ready state do not have any user processes executing in them.</para><para>You can skip this procedure if you want to boot the zone and use it
immediately. The transition through the ready state is performed automatically
when you boot the zone.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.inst.task-step-15"><para>Use the <command>zoneadm</command> command
with the <option>z</option>  option, the name of the zone, which is <literal>my-zone</literal>, and the <command>ready</command> subcommand to transition the
zone to the ready state.</para><screen>global# <userinput>zoneadm -z my-zone ready</userinput></screen>
</step><step id="z.inst.task-step-16"><para>At the prompt, use the <command>zoneadm</command> <command>list</command> command with the <option>v</option> option to verify the status.</para><screen>global# <userinput>zoneadm list -v</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 1  my-zone  ready        /export/home/my-zone           native     shared</screen><para>Note that the unique zone ID <literal>1</literal> has been assigned
by the system.</para>
</step>
</procedure>
</task><task id="z.inst.task-13"><title>How to Boot a Zone</title><tasksummary><para>Booting
a zone places the zone in the running state. A zone can be booted from the
ready state or from the installed state. A zone in the installed state that
is booted transparently transitions through the ready state to the running
state. Zone login is allowed for zones in the running state.</para><tip><para>Note that you perform the internal zone configuration when you
initially log in to the zone. This is described in <olink targetptr="z.login.task-31" remap="internal">Performing the Initial Internal Zone Configuration</olink>.</para><para>If you plan to use an <filename>/etc/sysidcfg</filename> file
to perform initial zone configuration, as described in <olink targetptr="z.login.task-38" remap="internal">How to Use an /etc/sysidcfg File to Perform the
Initial Zone Configuration</olink>, create the <filename>sysidcfg</filename> file
and place it the zone's <filename>/etc</filename> directory before you boot
the zone.</para>
</tip><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step id="z.inst.task-step-18"><para>Become superuser, or assume the Primary
Administrator role.</para><para>To create the role and assign the role to
a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.inst.task-step-19"><para>Use the <command>zoneadm</command> command
with the <option>z</option> option, the name of the zone, which is <literal>my-zone</literal>, and the <command>boot</command> subcommand to boot the zone.</para><screen>global# <userinput>zoneadm -z my-zone boot</userinput></screen>
</step><step id="z.inst.task-step-20"><para>When the boot completes, use the <command>list</command> subcommand with the <option>v</option> option to verify the status.</para><screen>global# <userinput>zoneadm list -v</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 1  my-zone  running      /export/home/my-zone           native     shared</screen>
</step>
</procedure><example id="gdeod"><title>Specifying Boot Arguments for Zones</title><para>Boot
a zone using the <option>m</option> <literal>verbose</literal> option:</para><screen>global# <userinput>zoneadm -z my-zone boot -- -m verbose</userinput></screen><para>Reboot a zone using the <option>m</option> <literal>verbose</literal> boot
option:</para><screen>global# <userinput>zoneadm -z my-zone reboot -- -m verbose</userinput></screen><para>Zone administrator reboot of the zone <replaceable>my-zone</replaceable>,
using the <option>m</option> <literal>verbose</literal> option:</para><screen>my-zone# <userinput>reboot -- -m verbose</userinput></screen>
</example><taskrelated role="troubleshooting"><para>If a message indicating that the system was unable to find the netmask
to be used for the IP address specified in the zone's configuration displays,
see <olink targetptr="gdepn" remap="internal">netmasks Warning Displayed When Booting Zone</olink>.
Note that the message is only a warning and the command has succeeded.</para>
</taskrelated>
</task><task id="fnjyv"><title>How to Boot a Zone in Single-User Mode</title><tasksummary><para>You must be the global administrator in the global zone to perform
this procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step><para>Boot the zone in single-user mode.</para><screen>global# <userinput>zoneadm -z my-zone boot -- -s</userinput></screen>
</step>
</procedure>
</task><sect2 id="z.inst.task-42"><title>Where to Go From Here</title><para>To log in to the zone and perform the initial internal configuration,
see <olink targetptr="z.login.ov-1" remap="internal">Chapter&nbsp;21, Non-Global Zone Login
(Overview)</olink> and <olink targetptr="z.login.task-1" remap="internal">Chapter&nbsp;22,
Logging In to Non-Global Zones (Tasks)</olink>.</para>
</sect2>
</sect1><sect1 id="z.inst.task-53"><title>Halting, Rebooting, Uninstalling, Cloning,
and Deleting Non-Global Zones (Task Map)</title><informaltable frame="all"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Halt a zone.</para>
</entry><entry><para>The halt procedure is used to remove both the application environment
and the virtual platform for a zone. The procedure returns a zone in the ready
state to the installed state. To cleanly shut down a zone, see <olink targetptr="z.login.task-25" remap="internal">How to Use zlogin to Shut Down a Zone</olink>.</para>
</entry><entry><para><olink targetptr="z.inst.task-24" remap="internal">How to Halt a Zone</olink></para>
</entry>
</row><row><entry><para>Reboot a zone.</para>
</entry><entry><para>The reboot procedure halts the zone and then boots it again.</para>
</entry><entry><para><olink targetptr="z.inst.task-30" remap="internal">How to Reboot a Zone</olink></para>
</entry>
</row><row><entry><para>Uninstall a zone.</para>
</entry><entry><para>This procedure removes all of the files in the zone's root file system. <emphasis>Use this procedure with caution.</emphasis> The action is irreversible.</para>
</entry><entry><para><olink targetptr="z.inst.task-36" remap="internal">How to Uninstall a Zone</olink></para>
</entry>
</row><row><entry><para>Provision a new non-global zone based on the configuration of an existing
zone on the same system.</para>
</entry><entry><para>Cloning a zone is an alternate, faster method of installing a zone.
You must still configure the new zone before you can install it.</para>
</entry><entry><para><olink targetptr="gbwmc" remap="internal">Cloning a Non-Global Zone on the Same System</olink></para>
</entry>
</row><row><entry><para>Delete a non-global zone from the system.</para>
</entry><entry><para>This procedure completely removes a zone from a system.</para>
</entry><entry><para><olink targetptr="z.inst.task-50" remap="internal">Deleting a Non-Global Zone From the
System</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="z.inst.task-23"><title>Halting, Rebooting, and Uninstalling Zones</title><task id="z.inst.task-24"><title>How to Halt a Zone</title><tasksummary><para>The halt
procedure is used to remove both the application environment and the virtual
platform for a zone. To cleanly shut down a zone, see <olink targetptr="z.login.task-25" remap="internal">How to Use zlogin to Shut Down a Zone</olink>.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step id="z.inst.task-step-26"><para>Become superuser, or assume the Primary
Administrator role.</para><para>To create the role and assign the role to
a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.inst.task-step-29"><para>List the zones running on the system.</para><screen>global# <userinput>zoneadm list -v</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 1  my-zone  running      /export/home/my-zone           native     shared</screen>
</step><step id="z.inst.task-step-27"><para>Use the <command>zoneadm</command> command
with the <option>z</option> option, the name of the zone, for example, <literal>my-zone</literal>, and the <command>halt</command> subcommand to halt the given zone.</para><screen>global# <userinput>zoneadm -z my-zone halt</userinput></screen>
</step><step id="z.inst.task-step-28"><para>List the zones on the system again, to
verify that <literal>my-zone</literal> has been halted.</para><screen>global# <userinput>zoneadm list -iv</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 -  my-zone  installed    /export/home/my-zone           native     shared</screen>
</step><step id="z.inst.task-step-43"><para>Boot the zone if you want to restart
it.</para><screen>global# <userinput>zoneadm -z my-zone boot</userinput></screen>
</step>
</procedure><taskrelated role="troubleshooting"><para>If the zone does not halt properly, see <olink targetptr="gcrsr" remap="internal">Zone
Does Not Halt</olink> for troubleshooting tips.</para>
</taskrelated>
</task><task id="z.inst.task-30"><title>How to Reboot a Zone</title><tasksummary><para>You must
be the global administrator in the global zone to perform this procedure.</para>
</tasksummary><procedure><step id="z.inst.task-step-32"><para>Become superuser, or assume the Primary
Administrator role.</para><para>To create the role and assign the role to
a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.inst.task-step-33"><para>List the zones running on the system.</para><screen>global# <userinput>zoneadm list -v</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 1  my-zone  running      /export/home/my-zone           native     shared</screen>
</step><step id="z.inst.task-step-34"><para>Use the <command>zoneadm</command> command
with the <option>z</option> <command>reboot</command> option to reboot the
zone <literal>my-zone</literal>.</para><screen>global# <userinput>zoneadm -z my-zone reboot</userinput></screen>
</step><step id="z.inst.task-step-35"><para>List the zones on the system again to
verify that <literal>my-zone</literal> has been rebooted.</para><screen>global# <userinput>zoneadm list -v</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 2  my-zone  running      /export/home/my-zone           native     shared</screen><tip><para>Note that the zone ID for <literal>my-zone</literal> has changed.
The zone ID generally changes after a reboot.</para>
</tip>
</step>
</procedure>
</task><task id="z.inst.task-36"><title>How to Uninstall a Zone</title><tasksummary><caution><para>Use
this procedure with caution. The action of removing all of the files in the
zone's root file system is irreversible.</para>
</caution><para>The zone cannot be in the running state. The <command>uninstall</command> operation
is invalid for running zones.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step id="z.inst.task-step-38"><para>Become superuser, or assume the Primary
Administrator role.</para><para>To create the role and assign the role to
a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.inst.task-step-39"><para>List the zones on the system.</para><screen>global# <userinput>zoneadm list -v</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 -  my-zone  installed    /export/home/my-zone           native     shared</screen>
</step><step id="z.inst.task-step-40"><para>Use the <command>zoneadm</command> command
with the <option>z</option> <command>uninstall</command> option to remove
the zone <literal>my-zone</literal>.</para><para>You can also use the <option>F</option> option
to force the action. If this option is not specified, the system will prompt
for confirmation.</para><screen>global# <userinput>zoneadm -z my-zone uninstall -F</userinput></screen><para>Note that when you uninstall a zone that has its own ZFS file system
for the <literal>zonepath</literal>, the ZFS file system is destroyed.</para>
</step><step id="z.inst.task-step-41"><para>List the zones on the system again, to
verify that <literal>my-zone</literal> is no longer listed.</para><screen>global# <userinput>zoneadm list -iv</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared</screen>
</step>
</procedure><taskrelated role="troubleshooting"><para>If a zone uninstall is interrupted, the zone is left in the incomplete
state. Use the <command>zoneadm</command> <command>uninstall</command> command
to reset the zone to the configured state. </para><para>Use the <command>uninstall</command> command with caution because the
action is irreversible.</para>
</taskrelated>
</task>
</sect1><sect1 id="gbwmc"><title>Cloning a Non-Global Zone on the Same System</title><para>Cloning is used to provision a new zone
on a system by copying the data from a source <literal>zonepath</literal> to
a target <literal>zonepath</literal>. </para><para>When the source <literal>zonepath</literal> and the target <literal>zonepath</literal> both reside on ZFS and are in the same pool, the <command>zoneadm</command> <literal>clone</literal> command automatically uses ZFS to clone the zone. However,
you can specify that the ZFS <literal>zonepath</literal> be copied and not
ZFS cloned.</para><task id="gbwlp"><title>How to Clone a Zone</title><tasksummary><para>You must configure the new zone before you can install it. The parameter
passed to the <command>zoneadm</command> <literal>create</literal> subcommand
is the name of the zone to clone. This source zone must be halted.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step id="gbwll"><para>Become superuser, or assume the Primary Administrator
role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step><para>Halt the source zone to be cloned, which is <literal>my-zone</literal> in
this procedure.</para><screen>global# <userinput>zoneadm -z my-zone halt</userinput></screen>
</step><step><para>Start configuring the new zone by exporting the configuration
of the source zone <literal>my-zone</literal> to a file, for example, <literal>master</literal>.</para><screen>global# <userinput>zonecfg -z my-zone export -f /export/zones/master</userinput></screen><note><para>You can also create the new zone configuration using the procedure <olink targetptr="z.conf.start-29" remap="internal">How to Configure the Zone</olink> instead of modifying
an existing configuration. If you use this method, skip ahead to Step 6 after
you create the zone.</para>
</note>
</step><step><para>Edit the file <literal>master</literal>. Set different properties
and resources for the components that cannot be identical for different zones.
For example, you must set a new <literal>zonepath</literal>. 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 resources must be changed.</para>
</step><step><para>Create the new zone, <literal>zone1</literal>, by using the commands
in the file <replaceable>master</replaceable>.</para><screen>global# <userinput>zonecfg -z zone1 -f /export/zones/master</userinput></screen>
</step><step><para>Install the new zone, <literal>zone1</literal>, by cloning <literal>my-zone</literal>.</para><screen>global# <userinput>zoneadm -z zone1 clone my-zone</userinput></screen><para>The system displays:</para><screen>Cloning zonepath /export/home/my-zone...</screen><para>If the source <literal>zonepath</literal> is on a ZFS pool, for example, <literal>zeepool</literal>, the system displays:</para><screen>Cloning snapshot zeepool/zones/my-zone@SUNWzone1
Instead of copying, a ZFS clone has been created for this zone.</screen>
</step><step><para>List the zones on the system.</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 -  my-zone  installed    /export/home/my-zone           native     shared
 -  zone1    installed    /export/home/zone1             native     shared</screen>
</step>
</procedure><taskrelated-custom><title>When a Source <literal>zonepath</literal> on a
ZFS File System Is Cloned</title><para>When the <command>zoneadm</command> command clones a source <literal>zonepath</literal> that is on its own ZFS file system, the following actions are performed:</para><itemizedlist><listitem><para>The <command>zoneadm</command> command takes a software inventory.</para>
</listitem><listitem><para>The <command>zoneadm</command> command takes a ZFS snapshot
and names it <literal>SUNWzone</literal><replaceable>X</replaceable>, for
example, <literal>SUNWzone</literal><replaceable>1</replaceable>.</para>
</listitem><listitem><para>The <command>zoneadm</command> command uses ZFS clone to clone
the snapshot.</para>
</listitem>
</itemizedlist>
</taskrelated-custom>
</task><task id="gcsot"><title>How to Clone a Zone from an Existing Snapshot</title><tasksummary><para>You can clone a source zone multiple times from an existing snapshot
that was originally taken when you cloned a zone.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step><para>Configure the zone <literal>zone2</literal>.</para>
</step><step><para>Specify that an existing snapshot be used to create <literal>new-zone2</literal>.</para><screen>global# <userinput>zoneadm -z zone2 clone -s zeepool/zones/my-zone@SUNWzone1 my-zone</userinput></screen><para>The system displays:</para><screen>Cloning snapshot zeepool/zones/my-zone@SUNWzone1</screen><para>The <command>zoneadm</command> command validates the software from the
snapshot <literal>SUNWzone</literal><replaceable>1</replaceable>, and clones
the snapshot.</para>
</step><step><para>List the zones on the system.</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared
 -  my-zone  installed    /zeepool/zones/my-zone         native     shared
 -  zone1    installed    /zeepool/zones/zone1           native     shared
 -  zone2    installed    /zeepool/zones/zone2           native     shared</screen>
</step>
</procedure>
</task><task id="gcspf"><title>How to Use Copy Instead of ZFS Clone</title><tasksummary><para>Use this procedure to prevent the automatic cloning of a zone on a ZFS
file system by specifying that the <literal>zonepath</literal> should be copied
instead.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step><para>Specify that the <literal>zonepath</literal> on ZFS be copied
and not ZFS cloned.</para><screen>global# <userinput>zoneadm -z zone1 clone -m copy my-zone</userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="z.inst.task-50"><title>Deleting a Non-Global Zone From the System</title><para>The procedure
described in this section completely deletes a zone from a system.</para><task id="z.inst.task-44"><title>How to Remove a Non-Global Zone</title><procedure><step id="z.inst.task-step-46"><para>Shut down the zone <literal>my-zone</literal>.</para><screen>global# <userinput>zlogin my-zone shutdown</userinput>
my-zone</screen>
</step><step id="z.inst.task-step-47"><para>Remove the root file system for <literal>my-zone</literal>.</para><screen>global# <userinput>zoneadm -z my-zone uninstall -F</userinput></screen>
</step><step id="z.inst.task-step-48"><para>Delete the configuration for <literal>my-zone</literal>.</para><screen>global# <userinput>zonecfg -z my-zone delete -F</userinput></screen>
</step><step id="z.inst.task-step-49"><para>List the zones on the system, to verify
that <literal>my-zone</literal> is no longer listed.</para><screen>global# <userinput>zoneadm list -iv</userinput></screen><para>You will see a display that is similar to the following:</para><screen>ID  NAME     STATUS       PATH                           BRAND      IP
 0  global   running      /                              native     shared</screen>
</step>
</procedure>
</task>
</sect1>
</chapter>