Tags

 

  1. Create Zone Paths and assign permissions

bash#mkdir /zones/

bash#cd /zones

bash#mkdir /zones/bb2

bash#chmod 700 /zones/bb2/

bash#chown root:root /zones/bb2/

  1. Use following command to create zones.

bash# zonecfg -z bb2

bb2: No such zone configured

Use ‘create’ to begin configuring a new zone.

zonecfg:bb2> create

  1.  Assign zonepath that you determined in step 1

zonecfg:bb2> set zonepath=/zones/bb2

  1. Add network adapter for the zone. You can add more network adapters by repeating add net command

zonecfg:bb2> add net

zonecfg:bb2:net>set physical=<pyhsical network adapter of global zone e.g eth0, bge0 etc.>

zonecfg:bb2:net> set address=10.1.12.16

zonecfg:bb2:net> set defrouter=10.1.12.1

zonecfg:bb2:net> end

  1. set system boot parameter

zonecfg:bb2> set autoboot=true

  1. You can assign physical cpu values to zones statically by using following command set

zonecfg:bb2> add dedicated-cpu

zonecfg:bb2:dedicated-cpu> set ncpus=4-8

zonecfg:bb2:dedicated-cpu> end

  1. You can assign pyhsical memory to zones by using the following command set

zonecfg:bb2> add capped-memory

zonecfg:bb2:capped-memory> set physical=19g

zonecfg:bb2:capped-memory> end

  1. In order to assign physical partitions of hard disks following commands are used. Select the disks in the global zone by using format utility and assign them by using following commands. (In the example 3rd slice of disk c6t600508B4001063C600012000063B0000d0 is assigned to zone)

zonecfg:bb2> add device

zonecfg:bb2:device> set match=/dev/rdsk/c6t600508B4001063C600012000063B0000d0s3

zonecfg:bb2:device> set match=/dev/rdsk/c6t600508B4001063C600012000063B0000d0s3

zonecfg:bb2:device> end

zonecfg:bb2> add device

zonecfg:bb2:device> set match=/dev/rdsk/c1t3d0s3

zonecfg:bb2:device> end

  1. In order to add a file system to zone follwing command set are used. In this example a 20 gb software mirrored partition is created and named m35 assigned to zone. ( if you did not create a partition before use bash# newfs /dev/md/rdsk/d35 command to create a file system otherwise during the boot sequence of zone an error occur )
  • onecfg:bb2> add fs

zonecfg:bb2:fs> set dir=/oraapp

zonecfg:bb2:fs> set special=/dev/md/dsk/d35

zonecfg:bb2:fs> set raw=/dev/md/rdsk/d35

zonecfg:bb2:fs> set type=ufs

zonecfg:bb2:fs> end

10. You can check your zone configuration by using info command. After successfull completion of zone configuration use commit and verify commands to complete procedure

zonecfg:bb2> info

zonename: bb2

zonepath: /zones/bb2

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

fs:

        dir: /oraapp

        special: /dev/md/dsk/d35

        raw: /dev/md/rdsk/d35

        type: ufs

        options: []

net:

        address: 172.16.250.16

        physical: aggr22

        defrouter: 172.16.250.1

net:

        address: 10.1.12.16

        physical: aggr21

        defrouter: 10.1.12.1

device

        match: /dev/rdsk/c6t600508B4001063C600012000063B0000d0s3

device

        match: /dev/rdsk/c6t600508B4001063C600012000066D0000d0s3

device

        match: /dev/rdsk/c6t600508B4001063C60001200006360000d0s3

device

        match: /dev/rdsk/c6t600508B4001063C60001200006700000d0s3

device

        match: /dev/rdsk/c6t600508B4001063C60001200006330000d0s3

device

        match: /dev/rdsk/c1t3d0s3

dedicated-cpu:

        ncpus: 4-8

capped-memory:

        physical: 19G

zonecfg:bb2>commit

zonecfg:bb2>verify

zonecfg:bb2>exit

11. Use following commands on global zone to enable dynamic cpu allocation which is done at step 6.otherwise system generates error and do not assign cpus to zone

bash #svcadm enable svc:/system/pools:default

bash #svcadm enable svc:/system/pools/dynamic:default

  1. 12.  Install the zone using the following command

root@bpcbprddb2 # zoneadm -z bb2 install

Preparing to install zone <bb2>.

Checking <ufs> file system on device </dev/md/rdsk/d35> to be mounted at </zones/bb2/root>

Creating list of files to copy from the global zone.

Copying <2996> files to the zone.

Initializing zone product registry.

Determining zone package initialization order.

Preparing to initialize <1227> packages on the zone.

Initialized <1227> packages on zone.                                

Zone <bb2> is initialized.

Installation of <2> packages was skipped.

The file </zones/bb2/root/var/sadm/system/logs/install_log> contains a log of the zone installation.

root@bpcbprddb2 # zoneadm -z bb2 boot

zoneadm: zone ‘bb2’: WARNING: aggr22:1: no matching subnet found in netmasks(4) for 172.16.250.16; using default of 255.255.0.0.

13. Connect the zone by using the following command and assign system initialization parameters which are common in solaris installation

bash#zlogin C bb2

14. You can start using your zones after reboot

http://hub.opensolaris.org/bin/view/Community+Group+zones/faq

http://www.camelrichard.org/topics/Solaris/Creating_a_Zone_in_Solaris_10

 

 

Advertisements