Sunteți pe pagina 1din 3

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 <zone1>.
Checking <ufs> file system on device </dev/md/rdsk/d62>
to be mounted at </export/zone1/root>
Checking <ufs> file system on device </dev/md/rdsk/d63>
to be mounted at </export/zone1/root>
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

S-ar putea să vă placă și