Thursday, July 5, 2012

Solaris Zone configuration

Configure zone, verify zone configuration, Export zone configuration, install zone.

Configure new zone.

-bash-3.2#chmod 700 /rpool/test
-bash-3.2# zonecfg -z oracle-cluster01
oracle-cluster01: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:oracle-cluster01> create
zonecfg:oracle-cluster01> set zonepath=/rpool/test
zonecfg:oracle-cluster01> set autoboot=true
zonecfg:oracle-cluster01> add net
zonecfg:oracle-cluster01:net> set address=10.203.121.37
zonecfg:oracle-cluster01:net> set physical=e1000g0
zonecfg:oracle-cluster01:net> end
zonecfg:oracle-cluster01> info
zonename: oracle-cluster01
zonepath: /rpool/test
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 10.203.121.37
physical: e1000g0
defrouter not specified
zonecfg:oracle-cluster01> verify
zonecfg:oracle-cluster01> commit
zonecfg:oracle-cluster01> exit
-bash-3.2# zoneadm list -vc
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- indigo installed /upromise/zone native shared
- oracle-cluster01 configured /rpool/test native shared
-bash-3.2#
-bash-3.2# zoneadm -z oracle-cluster01 verify

-bash-3.2# zoneadm -z oracle-cluster01 install
cannot create ZFS dataset rpool/test: dataset already exists
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <2893> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1116> packages on the zone.
Initialized <1116> packages on zone.
Zone is initialized.
The file contains a log of the zone installation.
-bash-3.2#
-bash-3.2# zoneadm -z oracle-cluster01 boot

-bash-3.2# zlogin -C oracle-cluster01 (~. to come out of console)

Select 0. for English and 13 for CDE desktop enviornment.

globalzone# zlogin -S oracle-cluster01 (For login to zone)


Deamons for Zone

zoneadmd and
zsched

The zones administration daemon, zoneadmd, is the primary process for managing the zone's virtual platform. The daemon is also responsible for managing zone booting and shutting down. There is one zoneadmd process running for each active (ready, running, or shutting down) zone on the system.

The zoneadmd daemon sets up the zone as specified in the zone configuration. This process includes the following actions:

  • Allocating the zone ID and starting the zsched system process

  • Setting zone-wide resource controls

  • Preparing the zone's devices as specified in the zone configuration

  • Setting up network interfaces

  • Mounting loopback and conventional file systems

  • Instantiating and initializing the zone console device

Unless the zoneadmd daemon is already running, it is automatically started by zoneadm. Thus, if the daemon is not running for any reason, any invocation of zoneadm to administer the zone will restart zoneadmd.


How to rename a zone

global#zonecfg -z test

zonecfg:indigoap> set zonename=testapp

zonecfg:indigoap>verify

zonecfg:indigoap>commit

Move a zone

global# zoneadm -z testapp move /rpool/testmove

A ZFS file system has been created for this zone.
Moving across file-systems; copying zonepath /test/zone...
Cleaning up zonepath /test/zone...
-bash-3.2#