Posts Tagged ‘Zone’

zone migration

Monday, January 25th, 2010

Procedure to do a zone migration.
——————————————-

Actions on nodeA

create a pool called pool1 with some disk in it on NodeA

NodeA# zpool import pool1
NodeA# zfs create zones/labzone3 /zones/labzone3
NodeA# chmod 700 /zones/labzone3
NodeA# zonecfg -z labzone3
>create
>set zonepath /labzone3
>set autoboot=true
>set pool=pool_default
>add net
net:set physical=eri0
net:set address=10.45.13.202
net:end
>verify
>commit
>exit
NodeA# zoneadm -z labzone3 intall ( this takes about 20 Minutes)
NodeA# zoneadm -z labzone3 ready
NodeA# zoneadm -z labzone3 boot
NodeA# zlogin -C labzone3
labzone3# df -k
labzone3# init 0
NodeA# zonecfg -z labzone3 export -f /tmp/labzone3.cfg
NodeA# umount /zones/labzone3
NodeA# zpool export pool1

Actions on nodeB

NodeB# mkdir -p -m 700 /zones/labzone3
NodeB# zpool import pool1
….successfull
NodeB# zpool iostat
NodeB# zpool ls
NodeB# mount -F zfs pool1/labzone3 /zones/labzone3
NodeB# scp NodeA:/tmp/labzone3.cfg /tmp/labzone3.cfg
NodeB# zonecfgadm -z labzone3 -f /tmp/labzone3.cfg

NodeB# vi /etc/zones/index
change here configured into installed
NodeB#zoneadm -list -i
NodeB#ftp NodeA
get> /etc/zones/labzone3.xml
to> /etc/zones/labzone3.xml
NodeB#zoneadm -z labzone3 boot

zone boot successfullly on NodeB

Zone Configuration in step

Monday, January 25th, 2010

Here is a short guide to creating zones with Solaris Containers technology, with examples using Solaris Volume Manager and an Oracle database. It’s easy to modify these steps and add more file systems into the script.

Notes: In this example, I make only one instance or zone, called zone1. I used Solaris Volume Manager in Steps 2 and 3, and I tested this on Oracle 10.1 and 10.2.

1. Format the hard disk into slice 0.

2. Make the meta devices. For example, I have three SAN disks, and I want to make a meta device with the three disks concatenated. (Note: Please type the command all on one line.)

# metainit d60 3 1 c2t50060E800456EE02d0s0 1 c2t50060E800456EE02d1s0
1 c2t50060E800456EE02d2s0
d60: Concat/Stripe is setup
3. Make the soft partitions:

# metainit d61 -p d60 6g
d61: Soft Partition is setup
# metainit d62 -p d60 10g
d62: Soft Partition is setup
# metainit d63 -p d60 30g
d63: Soft Partition is setup
#
4. Create the file systems:

# newfs /dev/md/rdsk/d61
newfs: construct a new file system /dev/md/rdsk/d61: (y/n)? y
# newfs /dev/md/rdsk/d62
newfs: construct a new file system /dev/md/rdsk/d62: (y/n)? y
# newfs /dev/md/rdsk/d63
newfs: construct a new file system /dev/md/rdsk/d63: (y/n)? y
#
5. Create the mount point for the root file system (/ fs) and /u00 and /u01 for the Oracle database.

mkdir -p /export/zone1
mkdir /u00
mkdir /u01
mount /export/zone1
6. Execute the following script, which is shown in its entirety after Step 11.

zonecfg -z zone1 -f /usr/scripts/make.zone1.ksh

# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
– zone1 configured /export/zone1
# chmod 700 /export/zone1
7. Install zone1:

# zoneadm -z zone1 install
Preparing to install zone .
Checking file system on device
to be mounted at
Checking file system on device
to be mounted at
Creating list of files to copy from the global zone.
Copying <124550> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1021> packages on the zone.
Initializing package <49> of <1021>: percent complete: 4%
8. Run the following command to get the zone state:

# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
– zone1 installed /export/zone1
9. Transition the zone to the ready state by running the following command:

# zoneadm -z zone1 ready
10. Use the following command to get the zone state:

# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
1 zone1 ready /export/zone1
11. Boot the zone:

# zoneadm -z zone1 boot
The script to be executed is /usr/scripts/make.zone1.ksh, and here are the details:

create -b
set zonepath=/export/zone1
set autoboot=true
add fs
set dir=/u00
set special=/dev/md/dsk/d62
set raw=/dev/md/rdsk/d62
set type=ufs
end
add fs
set dir=/u01
set special=/dev/md/dsk/d63
set raw=/dev/md/rdsk/d63
set type=ufs
end
add net
set address=10.11.33.144
set physical=ce2
end