Zones (Solaris 10)

Zones will appear as a separate server when you log into them in most respects but there are a few things to be aware of.

The standard Solaris 10 build at C&W will be using the sparse root model in which some directories (namely  and   and  ) are actually mounted read only from the global zone. Therefore, no changes can be made from the zone to these filesystems.

Obviously no hardware stuff can be done in a non-global zone.

Config files can be found in  and are fairly easy to navigate (they are in xml though). They should not be edited manually.

The All Important Commands
There are three main commands pertaining to zones which can be used to administer and access non-global zones (despite sshing from the outside).


 * zonecfg - used to configure zones, this command can be used interactively configure zones
 * zoneadm - this command is likely to be the most used command. It can be used to boot and check the status of zones. Below are a few useful examples:-

zoneadm -z myzone boot (boots the specified zone)

zoneadm -z myzone halt (halts the specified zone)

zoneadm -z myzone reboot (any guesses?)

zoneadm list -cv (shows a list of installed zones and the status of them)


 * zlogin - this command will enable you to login into the specified zone. This command can be particularly useful if you require console access:-

zlogin -C myzone (will give you console access)

Zoneified Commands
Some commands have been zoneified to allow for new functionality:-


 * ps - has a -z option now which should show which zone the process is running in.

Patching/Packages Zones
As the standard CW build will use the sparse-root model (/usr/ and/sbin mounted read only from the global zone), this impacts patches and packages. If these filesystems are affected by the patch/package, then they will have to be installed from the global zone and will apply to all zones.

Installing Packages
If a patch is to be installed, it will by default be installed in all zones (even if they aren't

Stopping a zone autobooting
Do:-

zonecfg -z z1 set autoboot=false info commit exit

Info will confirm the current state of autoboot.

Changing a zones IP address
zonecfg -z zonename select net address=x.x.x.x  (where x.x.x.x is the current address) set address=y.y.y.y (where y.y.y.y is the new address) end verify commit exit

Mouinting a disk in a zone
you can mount a drive directly into a "live" zone


 * 1) mount /dev/md/dsk/d12 /zones/z1/root/mnt/tmp

To make this permanent you have to edit the "zone config"

zonecfg -z testzone zonecfg:testzone> add fs zonecfg:testzone:fs> set dir=/mnt/tmp zonecfg:testzone:fs> set special=/dev/md/dsk/d12 zonecfg:testzone:fs> set raw=/dev/md/rdsk/d12 zonecfg:testzone:fs> set type=ufs zonecfg:testzone:fs> end zonecfg:testzone> verify zonecfg:testzone> commit  # omit this line if you do not want to apply right away zonecfg:testzone> exit