This chapter describes how to install and boot an lx branded zone. The following other tasks are also addressed:
Using clone to install a zone on the same system
Halting, rebooting, and uninstalling zones
Removing a zone from a system
Task |
Description |
For Instructions |
---|---|---|
Obtain the Linux achives. |
Before you can install the lx branded zone, you must first obtain the Linux archives. | |
Install a configured lx branded zone. |
Install a zone that is in the configured state. | |
(Optional) Install a subset of the available packages. |
When installing from CD or ISO images, you can install a subset of the packages on the install media. | |
(Optional) Enable networking in the zone. |
Networking is disabled by default and must be enabled if you want this functionality. | |
Obtain the universally unique identifier (UUID) for the zone. |
This separate identifier, assigned when the zone is installed, is an alternate way to identify a zone. | |
(Optional) Transition an installed zone to the ready state. |
You can skip this procedure if you want to boot the zone and use it immediately. |
(Optional) Placing an Installed lxBranded Zone in the Ready State |
Boot an lx branded zone. |
Booting a zone places the zone in the running state. A zone can be booted from the ready state or from the installed state. | |
Boot a zone in single-user mode. |
Boots only to milestone svc:/milestone/single-user:default. This milestone is equivalent to init level s. See the init(1M) and svc.startd(1M) man pages. |
Use the zoneadm command described in the zoneadm(1M) man page to perform installation tasks for a non-global zone.
Before you can install the lx branded zone, you must first obtain the Linux archives. The archives are distributed in the following forms:
A compressed tar archive (a tarball)
A set of CD-ROM or DVD discs
A group of ISO images
Obtain the Linux distribution using one of the following methods:
To download a tarball, go to http://hub.opensolaris.org/bin/view/Community+Group+brandz/applications. Follow the instructions on the downloads site.
To obtain a set of CD-ROM or DVD discs, go to the CentOS site at http://www.centos.org or the Red Hat site at http://www.redhat.com.
To obtain an ISO image, go to the CentOS site at http://www.centos.org or the Red Hat site at http://www.redhat.com.
This procedure is used to install a configured lx 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.
See Example 35–1, Example 35–2, and Example 35–3 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 lx Branded Zone Installation Methods for information on package cluster categories.
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 (Optional) How to Verify a Configured Zone Before It Is Installed.
You must be the global administrator in the global zone to perform this procedure.
In Step 3, if the zonepath is on ZFS, the zoneadm install command automatically creates a ZFS file system (dataset) for the zonepath when the zone is installed. You can block this action by including the -x nodataset parameter.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
(Optional) If you intend to install from DVD or CD, enable volfs on your system and verify that it is running.
global# svcadm enable svc:/system/filesystem/volfs:default |
global# svcs | grep volfs |
You will see a display similar to the following:
online 17:30 svc:/system/filesystem/volfs:default |
Install the configured zone lx-zone by using the zoneadm command with the install option and the path to the archive.
Install the zone, automatically creating a ZFS file system if the zonepath is on ZFS.
global# zoneadm -z lx-zone install -d archive_path |
The system will display:
A ZFS file system has been created for this zone. |
Install the zone that has a zonepath on ZFS, but do not automatically create the ZFS file system.
global# zoneadm -z lx-zone install -x nodataset -d archive_path |
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.
If you do not specify archive_path, the default is CD.
(Optional) If an error message is displayed and the zone fails to install, type the following to get the zone state:
global# zoneadm -z lx-zone list -iv |
If the state is listed as configured, make the corrections specified in the message and try the zoneadm install command again.
If the state is listed as incomplete, first execute this command:
global# zoneadm -z lx-zone uninstall |
Then make the corrections specified in the message, and try the zoneadm install command again.
When the installation completes, use the list subcommand with the -i and -v options to list the installed zones and verify the status.
global# zoneadm list -iv |
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND IP 0 global running / native shared - lx-zone installed /export/home/lx-zone lx shared |
global# zoneadm -z lx-zone install -d /export/centos_fs_image.tar.bz2 |
For CD or DVD installation, volfs must be enabled on your system. You must specify a software cluster package. For example, use development to install a full environment, or type the names of particular clusters. If you do not specify a cluster package, desktop is installed by default. The CD device is /cdrom/cdrom0.
global# zoneadm -z lx-zone install -d /cdrom/cdrom0 development |
You must specify a software cluster package. Use development to install a full environment, or specify particular clusters. If you do not specify a cluster package, desktop is installed by default. The CentOS ISO images reside in the directory /export/centos_3.7.
global# zoneadm -z lx-zone install -d /export/centos_3.7 development |
For more information on datasets, see Oracle Solaris ZFS Administration Guide
If a zone installation is interrupted or fails, the zone is left in the incomplete state. Use uninstall -F to reset the zone to the configured state.
When installing from CD or ISO images, you can install a subset of the packages on the install media. The available subsets are core, server, desktop, developer, and all.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
Install only the server package:
global# zoneadm -z lx-zone install -d archive_path server |
When you install an lx branded zone, networking is disabled. Use a procedure such as this one to enable networking.
You must be the zone administrator to perform this procedure.
Edit the /etc/sysconfig/network file in the zone.
NETWORKING=yes HOSTNAME=your.hostname |
To set up a NIS domain, add a line similar to the following:
NISDOMAIN=domain.Sun.COM |
For more information on configuring networking or naming services, consult the documentation for your Linux distribution.
A universally unique identifier (UUID) is assigned to a zone when it is installed. The UUID can be obtained by using zoneadm with the list subcommand and the -p option. The UUID is the fifth field of the display.
View the UUIDs for zones that have been installed.
global# zoneadm list -p |
You will see a display similar to the following:
0:global:running:/::native 1:centos38:running:/zones/centos38:27fabdc8-d8ce-e8aa-9921-ad1ea23ab063:lx |
global# zoneadm -z lx-zone -u 61901255-35cf-40d6-d501-f37dc84eb504 list -v |
If both -u uuid-match and -z zonename 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 -z parameter is ignored. If no zone with the specified UUID is found, then the system searches by the zone name.
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.
For more information, see zoneadm(1M) and libuuid(3LIB).
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.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
Mark the zone testzone incomplete.
global# zoneadm -z testzone mark incomplete |
Use the list subcommand with the -i and -v options to verify the status.
global# zoneadm list -iv |
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND IP 0 global running / native shared - testzone incomplete /export/home/testzone lx shared |
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 How to Uninstall a Branded Zone.
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.
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.
See (Optional) How to Transition the Installed Zone to the Ready State.
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.
You must be the global administrator in the global zone to perform this procedure.
Note that you cannot boot a branded zone on a Trusted Solaris system that has labels enabled.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
Use the zoneadm command with the -z option, the name of the zone, which is lx-zone, and the boot subcommand to boot the zone.
global# zoneadm -z lx-zone boot |
When the boot completes, use the list subcommand with the -v option to verify the status.
global# zoneadm list -v |
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND IP 0 global running / native shared 1 lx-zone running /export/home/lx-zone lx shared |
Boot a zone using the -i altinit option:
global# zoneadm -z lx-zone boot -- -i /path/to/process |
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 netmasksWarning Displayed When Booting Zone. Note that the message is only a warning and the command has succeeded.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
Boot the zone in single-user mode.
global# zoneadm -z lx-zone boot -- -s |
To log in to the zone, see configuration, see Logging In to an lx Branded Zone.
Task |
Description |
For Instructions |
---|---|---|
Halt a zone. |
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 How to Use zlogin to Shut Down an lx Branded Zone. | |
Reboot a zone. |
The reboot procedure halts the zone and then boots it again. | |
Uninstall a zone. |
This procedure removes all of the files in the zone's root file system. Use this procedure with caution. The action is irreversible. | |
Provision a new non-global zone based on the configuration of an existing zone on the same system. |
Cloning a zone is an alternate, faster method of installing a zone. You must still configure the new zone before you can install it. | |
Delete a non-global zone from the system. |
This procedure completely removes a zone from a system. |
The halt procedure is used to remove both the application environment and the virtual platform for an lx branded zone. To cleanly shut down a zone, see How to Use zlogin to Shut Down an lx Branded Zone.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
List the zones running on the system.
global# zoneadm list -v |
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND IP 0 global running / native shared 1 lx-zone running /export/home/lx-zone lx shared |
Use the zoneadm command with the -z option, the name of the zone, for example, lx-zone, and the halt subcommand to halt the given zone.
global# zoneadm -z lx-zone halt |
List the zones on the system again, to verify that lx-zone has been halted.
global# zoneadm list -iv |
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND IP 0 global running / native shared - lx-zone installed /export/home/lx-zone lx shared |
Boot the zone if you want to restart it.
global# zoneadm -z lx-zone boot |
If the zone does not halt properly, see Zone Does not Halt for troubleshooting tips.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
List the zones running on the system.
global# zoneadm list -v |
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND IP 0 global running / native shared 1 lx-zone running /export/home/lx-zone lx shared |
Use the zoneadm command with the -z reboot option to reboot the zone lx-zone.
global# zoneadm -z lx-zone reboot |
List the zones on the system again to verify that lx-zone has been rebooted.
global# zoneadm list -v |
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND IP 0 global running / native shared 2 lx-zone running /export/home/lx-zone lx shared |
Note that the zone ID for lx-zone has changed. The zone ID generally changes after a reboot.
This procedure removes all of the files in the zone's root file system. The action is irreversible.
The zone cannot be in the running state. The uninstall operation is invalid for running zones.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
List the zones on the system.
global# zoneadm list -v |
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND IP 0 global running / native shared - lx-zone installed /export/home/lx-zone lx shared |
Use the zoneadm command with the -z uninstall option to remove the zone lx-zone.
You can also use the -F option to force the action. If this option is not specified, the system will prompt for confirmation.
global# zoneadm -z lx-zone uninstall -F |
Note that when you uninstall a zone that has its own ZFS file system for the zonepath, the ZFS file system is destroyed.
List the zones on the system again, to verify that lx-zone is no longer listed.
global# zoneadm list -v |
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND IP 0 global running / native shared |
If a zone uninstall is interrupted, the zone is left in the incomplete state. Use the zoneadm uninstall command to reset the zone to the configured state.
Use the uninstall command with caution because the action is irreversible.
Cloning is used to provision a new zone on a system by copying the data from a source zonepath to a target zonepath.
You must configure the new zone before you can install it. The parameter passed to the zoneadm create subcommand is the name of the zone to clone. This source zone must be halted.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
Halt the source zone to be cloned, which is lx-zone in this procedure.
global# zoneadm -z lx-zone halt |
Start configuring the new zone by exporting the configuration of the source zone lx-zone to a file, for example, master.
global# zonecfg -z lx-zone export -f /export/zones/master |
You can also create the new zone configuration using the procedure How to Configure the Zone instead of modifying an existing configuration. If you use this method, skip ahead to Step 6 after you create the zone.
Edit the file master. At a minimum, you must set a different zonepath and IP address for the new zone.
Create the new zone, zone1, by using the commands in the file master.
global# zonecfg -z zone1 -f /export/zones/master |
Install the new zone, zone1, by cloning lx-zone.
global# zoneadm -z zone1 clone lx-zone |
The system displays:
Cloning zonepath /export/home/lx-zone... |
List the zones on the system.
global# zoneadm list -iv 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 |
You can clone a source zone multiple times from an existing snapshot that was originally taken when you cloned a zone.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
Configure the zone zone2.
Specify that an existing snapshot be used to create new-zone2.
global# zoneadm -z zone2 clone -s zeepool/zones/lx-zone@SUNWzone1 lx-zone |
The system displays:
Cloning snapshot zeepool/zones/lx-zone@SUNWzone1 |
The zoneadm command validates the software from the snapshot SUNWzone1, and clones the snapshot.
List the zones on the system.
global# zoneadm list -iv 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 |
Use this procedure to prevent the automatic cloning of a zone on a ZFS file system by specifying that the zonepath should be copied instead.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.
Specify that the zonepath on ZFS be copied and not ZFS cloned.
global# zoneadm -z zone1 clone -m copy lx-zone |
The procedure described in this section completely deletes a zone from a system.
Shut down the zone lx-zone.
global# zlogin lx-zone shutdown -y -g0 -i0 |
Remove the root file system for lx-zone.
global# zoneadm -z lx-zone uninstall -F |
Delete the configuration for lx-zone.
global# zonecfg -z lx-zone delete -F |
List the zones on the system, to verify that lx-zone is no longer listed.
global# zoneadm list -iv |
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND IP 0 global running / native shared |