Information Technology Reference
In-Depth Information
6.2.5 Virtualization Management Features
Life-cycle management of Containers involves very few commands. You have al-
ready seen the two commands used to create, boot, and halt a Container. One of
them, zoneadm , is also used to move a Container's root directory within the same
system, and to move the Container to a different system.
In addition to the zoneadm subcommands discussed earlier, three other subcom-
mands can be used to simplify and accelerate the provisioning of Containers. These
subcommands, which are not necessary for basic management of Containers, are
discussed in the next two sections.
6.2.5.1 Cloning Containers
Installing a Container takes time, and it always results in a Container that is ready
to be customized. Not surprisingly, if you are creating many similar Containers, it
is easier to perform those customizations just once. The command zoneadm has a
subcommand clone to do just that.
The original Container should be configured, installed, and then tailored for the
needs of the application. Doing so might require setting up application configura-
tion files, adding resource controls with zonecfg , and testing the application.
Once the original Container can successfully run the application, the Container
must be stopped before cloning it. At that point, the following commands can be
used. The export subcommand to zonecfg includes resource controls.
GZ# cd /zones/configs
GZ# zonecfg -z web01 export -f web01.cfg
GZ# cp web01.cfg web02.cfg
{ edit web02.cfg , changing the zonepath and other properties such as the IP address }
GZ# zonecg -z web02 -f web02.cfg
GZ# zoneadm -z web02 clone web01
Copying /zones/roots/web01...
After cloning is complete, the new Container is almost ready to boot. First,
though, you must deal with the fact that the sys-unconfig (1M) command has been
run on it, removing information such as its host name. You can use zlogin -C as
before to answer the prompts, providing this information, but the goal of cloning
is streamlining and automating the process of creating multiple Containers. All
of the answers to those prompts can be found in the Container's /etc/sysidcfg
file. As mentioned in the section “Installing and Booting the Container,” if you are
in the global zone the full path name is <zonepath>/root/etc/sysidcfg .
The next example shows an /etc/sysidcfg file and its placement in a Container,
followed by its first boot. Note that the statement network_interface=NONE
does not imply that there are no network interfaces.
 
 
Search WWH ::




Custom Search