Справочник Пользователя для Sun Microsystems 10

Скачать
Страница из 121
Version 3.1-en
  Solaris 10 Container Guide - 3.1   4. Best Practices 
Effective: 30/11/2009
As a general rule, some guidelines are specified locally, for example:
Which file systems are to be inherited from the global zone (
i n h e r i t - p k g - d i r
).
File systems with software that is to be able to be used by each zone.
Shared directories from the global zone.
Whether the zone is to be automatically started when the computer is rebooted.
The resource pool and other resource settings for the zone.
These   standard   settings   can   be   stored   with   a   template   zone   and   used   again.   However,   the   IP 
address and the zone directory have to be always be configured with zonecfg; also, the computer 
name (/etc/nodename), the time zone and the name service must be configured when the zone 
is booted for the first time. For the automated creation of zones, the N1 Service Provisioning System 
(N1SPS) can be used.
4.3.7. Automatic configuration of zones by script
[dd]   Zones  can be  created  and configured  automatically  by  a  shell  script.   The  creation  of  zones 
follows previously specified policies. The following steps must be performed in the script:
The  
z o n e c f g
  command is called by a script that sets the IP address, zone directory,  file 
systems, resource pool according to policies (Cookbook), for example according to:
IP address is the address of the IP name of z-<zone>
The zone directory is set e.g. to /export/zone2/<zone> for this class of zones.
The settings  requested by the zone  immediately after  booting can  be carried out with  a file 
named  
s y s i d c f g
  which is placed into the  /etc  directory of the zone prior to booting the 
zone (
< z o n e p a t h > / r o o t / e t c
). See the Cookbook for more details.
4.3.8. Automated provisioning of services
[dd] With the automatic configuration of zones per script and the stipulation of applying exactly one 
service per zone, the process of service provisioning can be automated as well. The N1 Service 
Provisioning System (N1SPS)
http://www.sun.com/software/products/service_provisioning/index.xml
 
or   a 
separate script can be used. If provisioning of the service is well automated, this type of service can 
be applied to many zones very quickly. The following steps are required:
Software installation
Creation or copying of application data
Modification of the zone in order to cover the software requirements
User accounts, environmental settings, log files
Organize start of service
 Install SMF service or rc* scripts
Corresponding steps with respect to exporting the service and the service data must be provided to 
remove or to move a service into another zone.
4.3.9. Installation and administration of a branded zone
[ug] Branded zones are supported since Solaris 10 8/07. Solaris for x86 contains the brand lx which 
allows a Linux environment to be made available in a zone. This type of zone can be created as 
follows:
Zone configuration:
Just like other zones, the zone must be configured with zonecfg. However, the brand must 
be set to lx. This can be done by using the template SUNWlx or by setting up the zone 
manually from the blank zone (create -b) and setting the attribute brand to lx.
During installation, the file tree of a suitable Linux system which is copied to the corresponding 
location in zone path can be used directly in the zone.
It is also possible to install the zone directly from the supported distributions (CD/DVD).
The migration of Linux zones (zoneadm   detach/attach) is simplified since the package and 
patch status for branded zones are not examined.
Duplication (zoneadm   ...   clone) of Linux zones located on ZFS is accelerated considerably 
by the automatic use of zfs clone.
51