<chapter id="gdduh"><title>Installing, Booting, Halting, Uninstalling
and Cloning <literal>lx</literal> Branded Zones (Tasks)</title><highlights><para>This chapter describes how to install and boot an <literal>lx</literal> branded
zone. The following other tasks are also addressed:</para><itemizedlist><listitem><para>Using clone to install a zone on the same system</para>
</listitem><listitem><para>Halting, rebooting, and uninstalling zones</para>
</listitem><listitem><para>Removing a zone from a system</para>
</listitem>
</itemizedlist>
</highlights><sect1 id="gdqtk"><title><literal>lx</literal> Branded 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>Obtain the Linux achives.</para>
</entry><entry><para>Before you can install the <literal>lx</literal> branded zone, you must
first obtain the Linux archives.</para>
</entry><entry><para><olink targetptr="gdegc" remap="internal">How to Obtain the Linux Archives</olink></para>
</entry>
</row><row><entry><para>Install a configured <literal>lx</literal> branded zone.</para>
</entry><entry><para>Install a zone that is in the configured state.</para>
</entry><entry><para><olink targetptr="gddwf" remap="internal">How to Install an lx Branded Zone</olink></para>
</entry>
</row><row><entry><para>(Optional) Install a subset of the available packages.</para>
</entry><entry><para>When installing from CD or ISO images, you can install a subset of the
packages on the install media.</para>
</entry><entry><para><olink targetptr="gdeja" remap="internal">How to Install a Subset of the Packages</olink></para>
</entry>
</row><row><entry><para>(Optional) Enable networking in the zone.</para>
</entry><entry><para>Networking is disabled by default and must be enabled if you want this
functionality.</para>
</entry><entry><para><olink targetptr="gdlhu" remap="internal">How to Enable Networking in an lx Branded 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="gdqsq" remap="internal">How to Obtain the UUID of an Installed Branded
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="gdelv" remap="internal">(Optional) Placing an Installed lxBranded Zone
in the Ready State</olink></para>
</entry>
</row><row><entry><para>Boot an <literal>lx</literal> branded 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. </para>
</entry><entry><para><olink targetptr="gdekk" remap="internal">How to Boot an lx Branded Zone</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="gdbhu"><title>Installing and Booting <literal>lx</literal> Branded
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.</para><task id="gdegc"><title>How to Obtain the Linux Archives</title><tasksummary><para>Before you can
install the <literal>lx</literal> branded zone, you must first obtain the
Linux archives. The archives are distributed in the following forms:</para><itemizedlist><listitem><para>A compressed <command>tar</command> archive (a <emphasis>tarball</emphasis>)</para>
</listitem><listitem><para>A set of CD-ROM or DVD discs</para>
</listitem><listitem><para>A group of ISO images</para>
</listitem>
</itemizedlist>
</tasksummary><procedure remap="single-step"><step><para>Obtain the Linux distribution using one of the following methods:</para><itemizedlist><listitem><para>To download a tarball, go to <ulink url="http://opensolaris.org/os/community/brandz/downloads" type="url">http://opensolaris.org/os/community/brandz/downloads</ulink>. Follow the instructions on the downloads site.</para>
</listitem><listitem><para>To obtain a set of CD-ROM or DVD discs, go to the CentOS site
at <ulink url="http://www.centos.org" type="url">http://www.centos.org</ulink> or
the Red Hat site at <ulink url="http://www.redhat.com" type="url">http://www.redhat.com</ulink>. </para>
</listitem><listitem><para>To obtain an ISO image, go to the CentOS site at <ulink url="http://www.centos.org" type="url">http://www.centos.org</ulink> or the
Red Hat site at <ulink url="http://www.redhat.com" type="url">http://www.redhat.com</ulink>. </para>
</listitem>
</itemizedlist>
</step>
</procedure>
</task><task id="gddwf"><title>How to Install an <literal>lx</literal> Branded Zone</title><tasksummary><para>This procedure is used to install
a configured <literal>lx</literal> branded zone. Once the zone is installed,
all software configuration and management has to be done by the zone administrator
using Linux tools from inside the zone.</para><para>See <olink targetptr="gdekz" remap="internal">Example&nbsp;33&ndash;1</olink>, <olink targetptr="gdelj" remap="internal">Example&nbsp;33&ndash;2</olink>, and <olink targetptr="gdelc" remap="internal">Example&nbsp;33&ndash;3</olink> for examples of zone installation command lines
using the different distribution paths. If you install from discs or from
an ISO image, you must specify Sun package cluster categories. See <olink targetptr="gdlxb" remap="internal">lx Branded Zone Installation Methods</olink> for information
on package cluster categories.</para><para>Note that you can verify a zone prior to installing it. If you skip
this procedure, the verification is performed automatically when you install
the zone. The procedure is documented in <olink targetptr="z.inst.task-6" remap="internal">(Optional)
How to Verify a Configured Zone Before It Is Installed</olink>.</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="gddwa"><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>(Optional) If you intend to install from DVD or CD, enable <literal>volfs</literal> on your system and verify that it is running.</para><screen>global# <userinput>svcadm enable svc:/system/filesystem/volfs:default</userinput></screen><screen>global# <userinput>svcs | grep volfs</userinput></screen><para> You will see a display similar to the following:</para><screen>online  17:30 svc:/system/filesystem/volfs:default</screen>
</step><step id="gddvt"><para>Install the configured zone <literal>lx-zone</literal> by
using the <command>zoneadm</command> command with the <command>install</command> option
and the path to the archive.</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 lx-zone install -d archive_path</userinput></screen><para>The system will display:</para><screen>A ZFS file system 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 lx-zone install -x nodataset -d archive_path</userinput></screen>
</step>
</stepalternatives><para>You will see various messages as the files and directories needed for
the zone's root file system, as well as the package files, are installed under
the zone's root path.</para><note><para>If you do not specify <literal>archive_path</literal>, the default
is <literal>CD</literal>.</para>
</note>
</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 lx-zone list -iv</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 lx-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="gddwi"><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
 -  lx-zone  installed    /export/home/lx-zone           lx         shared</screen>
</step>
</procedure><example id="gdekz"><title>Install Command Using a CentOS Compressed <command>tar</command> Archive</title><screen>global# <userinput>zoneadm -z lx-zone install -d /export/centos_fs_image.tar.bz2</userinput></screen>
</example><example id="gdelj"><title>Install Command Using CentOS CDs</title><para>For CD or DVD installation, <literal>volfs</literal> must be enabled
on your system. You must specify a software cluster package. For example,
use <literal>development</literal> to install a full environment, or type
the names of particular clusters. If you do not specify a cluster package, <literal>desktop</literal> is installed by default. The CD device is <literal>/cdrom/cdrom0</literal>.</para><screen>global# <userinput>zoneadm -z lx-zone install -d /cdrom/cdrom0 development</userinput></screen>
</example><example id="gdelc"><title>Install Command Using CentOS ISO Images</title><para>You must specify a software cluster package. Use <literal>development</literal> to
install a full environment, or specify particular clusters. If you do not
specify a cluster package, <literal>desktop</literal> is installed by default.
The CentOS ISO images  reside in the directory <literal>/export/centos_3.7</literal>.</para><screen>global# <userinput>zoneadm -z lx-zone install -d /export/centos_3.7 development</userinput></screen>
</example><taskrelated role="see-also"><para>For more information on datasets, see <olink targetdoc="zfsadmin" remap="external"><citetitle remap="book">Solaris ZFS Administration Guide</citetitle></olink></para>
</taskrelated><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>
</task><task id="gdeja"><title>How to Install a Subset of the Packages</title><tasksummary><para>When installing from CD or ISO images, you can install a subset of the
packages on the install media. The available subsets are <literal>core</literal>, <literal>server</literal>, <literal>desktop</literal>, <literal>developer</literal>,
and <literal>all</literal>.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step id="gdeiu"><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>Install only the server package:</para><screen>global# <userinput>zoneadm -z lx-zone install -d archive_path server</userinput></screen>
</step>
</procedure>
</task><task id="gdlhu"><title>How to Enable Networking in an <literal>lx</literal> Branded
Zone</title><tasksummary><para>When you install an <literal>lx</literal> branded zone, networking is disabled. Use a procedure such as
this one to enable networking.</para><para>You must be the zone administrator to perform this procedure.</para>
</tasksummary><procedure><step><para>Edit the <literal>/etc/sysconfig/network</literal> file in the
zone.</para><screen>NETWORKING=yes
HOSTNAME=your.hostname</screen>
</step><step><para>To set up a NIS domain, add a line similar to the following:</para><screen>NISDOMAIN=domain.Sun.COM</screen>
</step>
</procedure><taskrelated-custom><title>Configuring Networking and Naming Services</title><para>For more information on configuring networking or naming services, consult
the documentation for your Linux distribution.</para>
</taskrelated-custom>
</task><task id="gdqsq"><title>How to Obtain the UUID of an Installed Branded 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
    1:centos38:running:/zones/centos38:27fabdc8-d8ce-e8aa-9921-ad1ea23ab063:lx</screen>
</step>
</procedure><example id="gdqsi"><title>How to Use the UUID in a Command</title><screen>global# <userinput>zoneadm -z lx-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="gdqrx"><title>How to Mark an Installed <literal>lx</literal> Branded
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><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
-   testzone   incomplete    /export/home/testzone   lx         shared</screen>
</step>
</procedure><taskrelated-custom><title>Marking a Zone Incomplete</title><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="gdgbg" remap="internal">How to Uninstall
a Branded Zone</olink>.</para>
</note>
</taskrelated-custom>
</task><sect2 id="gdelv"><title>(Optional) Placing an Installed <literal>lx</literal>Branded
Zone in the Ready State</title><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>See <olink targetptr="z.inst.task-12" remap="internal">(Optional) How to Transition the
Installed Zone to the Ready State</olink></para>
</sect2><task id="gdekk"><title>How to Boot an <literal>lx</literal> Branded 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><para>You must be the global administrator in the global zone to perform this
procedure.</para><tip><para>Note that you cannot boot a branded zone on a Trusted Solaris system
that has labels enabled.</para>
</tip>
</tasksummary><procedure><step id="gdemd"><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="gdekw"><para>Use the <command>zoneadm</command> command with the <option>z</option> option, the name of the zone, which is <literal>lx-zone</literal>,
and the <command>boot</command> subcommand to boot the zone.</para><screen>global# <userinput>zoneadm -z lx-zone boot</userinput></screen>
</step><step id="gdekt"><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  lx-zone  running      /export/home/lx-zone  lx         shared</screen>
</step>
</procedure><example id="gdfsr"><title>Specifying Boot Arguments for Zones</title><para>Boot
a zone using the <option>i</option> <literal>altinit</literal> option:</para><screen>global# <userinput>zoneadm -z lx-zone boot -- -i /path/to/process</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="gdfrz"><title>How to Boot an <literal>lx</literal> Branded 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 lx-zone boot -- -s</userinput></screen>
</step>
</procedure>
</task><sect2 id="gdfsb"><title>Where to Go From Here</title><para>To log in to the zone , see configuration, see <olink targetptr="gdghs" remap="internal">Logging
In to an lx Branded Zone</olink>.</para>
</sect2>
</sect1><sect1 id="gdfte"><title>Halting, Rebooting, Uninstalling, Cloning, and Deleting <literal>lx</literal> Branded 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="gdgjn" remap="internal">How to Use zlogin to Shut Down an lx Branded Zone</olink>.</para>
</entry><entry><para><olink targetptr="gdgat" remap="internal">How to Halt an lx Branded 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="gdgba" remap="internal">How to Reboot an lx Branded  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="gdgbg" remap="internal">How to Uninstall a Branded 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="gdgbp" remap="internal">Cloning an lx Branded 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="gdgbm" remap="internal">Deleting an lx Branded Zone From the System</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><sect2 id="gdgbn"><title>Halting, Rebooting, and Uninstalling <literal>lx</literal> Branded
Zones</title><task id="gdgat"><title>How to Halt an <literal>lx</literal> Branded Zone</title><tasksummary><para>The halt procedure is used
to remove both the application environment and the virtual platform for an <literal>lx</literal> branded zone. To cleanly shut down a zone, see How to Use <command>zlogin</command> to Shut Down an <literal>lx</literal> Branded Zone.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step id="gdgal"><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="gdgbk"><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  lx-zone  running      /export/home/lx-zone  lx         shared</screen>
</step><step id="gdgas"><para>Use the <command>zoneadm</command> command with the <option>z</option> option, the name of the zone, for example, <literal>lx-zone</literal>,
and the <command>halt</command> subcommand to halt the given zone.</para><screen>global# <userinput>zoneadm -z lx-zone halt</userinput></screen>
</step><step id="gdgac"><para>List the zones on the system again, to verify that <literal>lx-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
-  lx-zone    installed     /export/home/lx-zone  lx         shared</screen>
</step><step id="gdgbj"><para>Boot the zone if you want to restart it.</para><screen>global# <userinput>zoneadm -z lx-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="gdgba"><title>How to Reboot an <literal>lx</literal> Branded  Zone</title><tasksummary><para>You must be the global administrator
in the global zone to perform this procedure.</para>
</tasksummary><procedure><step id="gdgam"><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="gdgav"><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  lx-zone  running      /export/home/lx-zone  lx         shared</screen>
</step><step id="gdgah"><para>Use the <command>zoneadm</command> command with the <option>z</option> <command>reboot</command> option to reboot the zone <literal>lx-zone</literal>.</para><screen>global# <userinput>zoneadm -z lx-zone reboot</userinput></screen>
</step><step id="gdgae"><para>List the zones on the system again to verify that <literal>lx-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  lx-zone  running      /export/home/lx-zone  lx         shared</screen><tip><para>Note that the zone ID for <literal>lx-zone</literal> has changed.
The zone ID generally changes after a reboot.</para>
</tip>
</step>
</procedure>
</task><task id="gdgbg"><title>How to Uninstall a Branded Zone</title><tasksummary><caution><para>This procedure removes all of the files in the zone's root file
system. The action 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="gdgaw"><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="gdgbi"><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
-  lx-zone    installed     /export/home/lx-zone  lx         shared</screen>
</step><step id="gdgan"><para>Use the <command>zoneadm</command> command with the <option>z</option> <command>uninstall</command> option to remove the zone <literal>lx-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 lx-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="gdgbl"><para>List the zones on the system again, to verify that <literal>lx-zone</literal> is no longer listed.</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</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>
</sect2>
</sect1><sect1 id="gdgbp"><title>Cloning an <literal>lx</literal> Branded 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="gdgak"><title>How to Clone an <literal>lx</literal> Branded 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="gdgau"><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>lx-zone</literal> in
this procedure.</para><screen>global# <userinput>zoneadm -z lx-zone halt</userinput></screen>
</step><step><para>Start configuring the new zone by exporting the configuration
of the source zone <literal>lx-zone</literal> to a file, for example, <literal>master</literal>.</para><screen>global# <userinput>zonecfg -z lx-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>.  At a minimum, you must
set a different <literal>zonepath</literal> and IP address for the new zone.</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>lx-zone</literal>.</para><screen>global# <userinput>zoneadm -z zone1 clone lx-zone</userinput></screen><para>The system displays:</para><screen>Cloning zonepath /export/home/lx-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/lx-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>global# <userinput>zoneadm list -iv</userinput>
  ID  NAME          STATUS          PATH                   BRAND      IP
   0  global        running         /                      native     shared
   -  lx-zone       installed       /export/home/lx-zone   lx         shared
   -  zone1         installed       /export/home/zone1     lx         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="gdgbo"><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/lx-zone@SUNWzone1 lx-zone</userinput></screen><para>The system displays:</para><screen>Cloning snapshot zeepool/zones/lx-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>global# <userinput>zoneadm list -iv</userinput>
  ID NAME             STATUS         PATH                    BRAND      IP
   0 global           running        /                       native     shared
   - lx-zone          installed      /zeepool/zones/lx-zone  lx         shared
   - zone1            installed      /zeepool/zones/zone1    lx         shared
   - zone2            installed      /zeepool/zones/zone1    lx         shared</screen>
</step>
</procedure>
</task><task id="gdgao"><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 lx-zone</userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="gdgbm"><title>Deleting an <literal>lx</literal> Branded Zone From
the System</title><para>The procedure
described in this section completely deletes a zone from a system.</para><task id="gdgaq"><title>How to Remove an <literal>lx</literal> Branded Zone</title><procedure><step id="gdgaz"><para>Shut down the zone <literal>lx-zone</literal>.</para><screen>global# <userinput>zlogin lx-zone shutdown</userinput></screen>
</step><step id="gdgay"><para>Remove the root file system for <literal>lx-zone</literal>.</para><screen>global# <userinput>zoneadm -z lx-zone uninstall -F</userinput></screen>
</step><step id="gdgdk"><para>Delete the configuration for <literal>lx-zone</literal>.</para><screen>global# <userinput>zonecfg -z lx-zone delete -F</userinput></screen>
</step><step id="gdgda"><para>List the zones on the system, to verify that <literal>lx-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>