Technical
Tip
|
QUESTION ANSWER Zones are a feature new in Solaris 10, and provide a useful mechanism to create a Solaris environment for testing, and containment (Apache server, etc.). No additional hardware is required for a zone, just some disk space. The impact of a zone on machine performance is minimal. as all zones use the same kernel, so some additional memory for extra processes is all that's required. Resource allocation to a zone can be closely controlled, and this includes processor shares, resource pools and resource capping with rcapd. Since update 4 of Solaris 10 (August 2007) dedicated network interfaces can be assigned to a zone; prior to this they have to be shared with the global zone. Also, you can now download additional software from Sun to allow you to run Solaris 8 and 9 within a zone. Here is an example of a Solaris 8 zone creation, but for a fuller picture consider attending our Solaris 10 Administration Part 2 course Firstly, if needed, install patch 127127-11 and reboot your system. (Check with showrev -p as it may already be installed) Now obtain and install the required software package from Sun - this is s8containers-bundle-solaris10-sparc.tar.gz which can be downloaded here. # gunzip s8containers-bundle-solaris10-sparc.tar.gz # tar xvf s8containers-bundle-solaris10-sparc.tar Create a suitable directory, to hold the zone copy of the OS:- # cd s8containers-bundle/1.0/Product Install all the packages in this directory with pkgadd:- # pkgadd -d . 1 SUNWs8brandr Solaris 8 Containers: solaris8 brand support (Root) (sparc) 11.10.0,REV=2007.10.08.16.51 2 SUNWs8brandu Solaris 8 Containers: solaris8 brand support (Usr) (sparc) 11.10.0,REV=2007.10.08.16.51 3 SUNWs8p2v Solaris 8 p2v Tool (sparc) 11.10.0,REV=2007.10.08.16.51 Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]: all etc etc.. Now the zone can be configured:- # mkdir -p /Zones/sol8 # zonecfg -z sol8 sol8: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:sol8> create -t SUNWsolaris8 zonecfg:sol8> set zonepath=/Zones/sol8 zonecfg:sol8> set autoboot=true zonecfg:sol8> add net zonecfg:sol8:net> set physical=eri0 zonecfg:sol8:net> set address=192.168.200.155 zonecfg:sol8:net> end zonecfg:sol8> add attr zonecfg:sol8:attr> set name=hostid zonecfg:sol8:attr> set type=string zonecfg:sol8:attr> set value=83685987 zonecfg:sol8:attr> end zonecfg:sol8> verify zonecfg:sol8> commit zonecfg:sol8> exit # The above add attr section adds a hostid to the zone. Now use zoneadm to install the zone:- # zoneadm -z sol8 install -u -a /root/containers/solaris8-image.flar -u causes the Solaris 8 zone to be installed in a sys-unconfig state, i.e. no hostname or name services configured. Use -p instead if you want to preserve the Solaris 8 system's original ID. -a /root/containers/solaris8-image.flar specifies the location of the flash archive to use. The installtion continues:- Log File: /var/tmp/sol8.install.27972.log Source: /root/containers/solaris8-image.flar Installing: This may take several minutes... Postprocessing: This may take several minutes... Result: Installation completed successfully. Log File: /Zones/sol8/root/var/log/sol8.install.27972.log # The zone can now be booted with zoneadm, but you may wish to install a sysidcfg file into the /etc directory of the zone before you do this; here is an example:- locale=C name_service=NONE system_locale=C network_interface=primary{protocol_ipv6=no hostname=sol8 netmask=255.255.255.0} timezone=GB terminal=xterm timeserver=localhost security_policy=none root_password=pvDVrMdPynYk2 (Make sure this is a genuine envrypted password - you can copy one from your /etc/shadow file) Now boot the new Solaris 8 zone:- # zoneadm -z sol8 boot # zlogin -C sol8 [Connected to zone 'sol8' console] Configuring network interface addresses: eri0. add default route: Not owner starting rpc services: rpcbind done. rebooting system due to change(s) in /etc/default/init Jan 9 08:54:44 rpcbind: rpcbind terminating on signal. [NOTICE: Zone rebooting] SunOS Release 5.8 Version Generic_Virtual 64-bit Copyright 1983-2000 Sun Microsystems, Inc. All rights reserved Hostname: sol8 The system is coming up. Please wait. starting rpc services: rpcbind done. syslog service starting. Print services started. Jan 9 16:55:09 sol8 sendmail[2353]: My unqualified host name (sol8) unknown; sleeping for retry The system is ready. sol8 console login: We have now created the Solaris 8 zone, installed it, rebooted and logged in. Use the usual commands to check things out (df, ifconfig, uname, etc). Tips: (But make sure your site security allows this) 1. Edit /etc/default/login and comment out the "CONSOLE=/dev/console" line to permit remote root logins. (password needed of course..) 2. Edit /etc/ssh/sshd_config and set PermitRootLogin=yes if you want to login as root via ssh. Restart sshd with "svcadm restart ssh" 3. Current zone implementation allows graphical login if the zone runs "dtlogin -daemon" by default. We hope this has been useful, see below for additional notes Mick Hosegood - First Alternative.
First Alternative course tutors can answer questions like this ... and are happy to do so. Look around our site for relevant courses in Linux -Unix - Perl - Solaris - FrameMaker |