You are on page 1of 16

DECLARATION DE LA ZONE

(On utilise les options remove inherit-pkg-dir pour forcer la


copie des repertoires ciblés dans la zone locale)

# zonecfg -z udkserc2
udkserc2: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:udkserc2> create
zonecfg:udkserc2> remove inherit-pkg-dir dir=/sbin
zonecfg:udkserc2> remove inherit-pkg-dir dir=/usr
zonecfg:udkserc2> remove inherit-pkg-dir dir=/platform
zonecfg:udkserc2> remove inherit-pkg-dir dir=/lib
zonecfg:udkserc2> remove inherit-pkg-dir dir=/etc
remove inherit-pkg-dir: No such resource with that id
zonecfg:udkserc2> remove inherit-pkg-dir dir=/bin
remove inherit-pkg-dir: No such resource with that id
zonecfg:udkserc2> set autoboot=true
zonecfg:udkserc2> set zonepath=/export/zones/udkserc2
zonecfg:udkserc2> add net
zonecfg:udkserc2:net> set address=192.168.1.12
zonecfg:udkserc2:net> set physical=hme0
zonecfg:udkserc2:net> end
zonecfg:udkserc2> info
zonepath: /export/zones/udkserc2
autoboot: true
pool:
net:
address: 192.168.1.12
physical: hme0
zonecfg:udkserc2> verify
zonecfg:udkserc2> commit
zonecfg:udkserc2> exit

CREATION DU REPERTOIRE D’HEBERGEMENT DE LA ZONE LOCALE

# ls /export/zones
testfl_zone
# mkdir /export/zones/udkserc2
# chmod 700 /export/zones/udkserc2
# ls -al /export/zones
total 8
drwxr-xr-x 4 root root 512 Mar 5 14:36 .
drwxr-xr-x 4 root sys 512 Mar 2 15:10 ..
drwx------ 4 root root 512 Mar 2 11:55
testfl_zone
drwx------ 2 root root 512 Mar 5 14:36 udkserc2
INSTALLATION DE LA ZONE

# zoneadm -z udkserc2 verify


# zoneadm -z udkserc2 install (DEBUT :14h40)
Preparing to install zone <udkserc2>.
Creating list of files to copy from the global zone.
Copying <137416> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1183> packages on the zone.
Initialized <1183> packages on zone.
Zone <udkserc2> is initialized.
Installation of these packages generated errors: <SUNWgnome-
a11y-libs-share>
The file
</export/zones/udkserc2/root/var/sadm/system/logs/install_log>
contains a log of the zone installation.
FIN : 15h40

DEMARRAGE DE LA ZONE

# zoneadm -z udkserc2 boot


Mar 5 15:35:57 apollo in.routed[155]: route 192.168.1.12 -->
0.0.0.0 nexthop is
not directly connected

# ifconfig -a
lo0:
flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL>
mtu 8232 index
1
inet 127.0.0.1 netmask ff000000
lo0:1:
flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL>
mtu 8232 ind
ex 1
zone testfl_zone
inet 127.0.0.1 netmask ff000000
lo0:2:
flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL>
mtu 8232 ind
ex 1
zone udkserc2
inet 127.0.0.1 netmask ff000000
hme0: flags=1000803<UP,BROADCAST,MULTICAST,IPv4> mtu 1500 index
2
inet 192.168.1.10 netmask ffffff00 broadcast
192.168.1.255
ether 0:3:ba:37:d8:10
hme0:1: flags=1000803<UP,BROADCAST,MULTICAST,IPv4> mtu 1500
index 2
zone testfl_zone
inet 192.168.1.11 netmask ffffff00 broadcast
192.168.1.255
hme0:2: flags=1000803<UP,BROADCAST,MULTICAST,IPv4> mtu 1500
index 2
zone udkserc2
inet 192.168.1.12 netmask ffffff00 broadcast
192.168.1.255

FINALISATION DE L’INSTALLATION

# zlogin -C udkserc2

Select a Language

0. English
1. es
2. fr

Please make a choice (0 - 2), or press h or ? for help: 0

elect a Locale

0. English (C - 7-bit ASCII)


1. Canada (English) (UTF-8)
2. Canada-English (ISO8859-1)
3. U.S.A. (UTF-8)
4. U.S.A. (en_US.ISO8859-1)
5. U.S.A. (en_US.ISO8859-15)
6. Go Back to Previous Screen

Please make a choice (0 - 6), or press h or ? for help: 0

What type of terminal are you using?


1) ANSI Standard CRT
2) DEC VT52
3) DEC VT100
4) Heathkit 19
5) Lear Siegler ADM31
6) PC Console
7) Sun Command Tool
8) Sun Workstation
9) Televideo 910
10) Televideo 925
11) Wyse Model 50
12) X Terminal Emulator (xterms)
13) CDE Terminal Emulator (dtterm)
14) Other
Type the number of your choice and press Return: 14

> Specify a valid terminal type exactly as it is listed in the


terminfo
database, including capitalization and punctuation.

Terminal type: vt100


Creating new rsa public/private host key pair
Creating new dsa public/private host key pair

Host Name for hme0:2


qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

Enter the host name which identifies this system on the


network. The name
must be unique within your domain; creating a duplicate host
name will cause
problems on the network after you install Solaris.

A host name must have at least one character; it can contain


letters,
digits, and minus signs (-).

Host name for hme0:2 udkserc2

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
F2_Continue F6_Help

Confirm Information for hme0:2


qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
> Confirm the following information. If it is correct, press
F2;
to change any information, press F4.

Host name: udkserc2

Configure Security Policy:


qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

Specify Yes if the system will use the Kerberos security


mechanism.

Specify No if this system will use standard UNIX security.

Configure Kerberos Security


qqqqqqqqqqqqqqqqqqqqqqqqqqq
[ ] Yes
[X] No

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-6_Help

Confirm Information
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

> Confirm the following information. If it is correct, press


F2;
to change any information, press F4.

Configure Kerberos Security: No


qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-4_Change Esc-6_Help

Name Service
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qq

On this screen you must provide name service information.


Select the name
service that will be used by this system, or None if your
system will either
not use a name service at all, or if it will use a name
service not listed
here.

> To make a selection, use the arrow keys to highlight the


option
and press Return to mark it [X].

Name service
qqqqqqqqqqqq
[ ] NIS+
[ ] NIS
[ ] DNS
[ ] LDAP
[X] None

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-6_Help

Confirm Information
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
> Confirm the following information. If it is correct, press
F2;
to change any information, press F4.

Name service: None

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-4_Change Esc-6_Help

ime Zone
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqq

On this screen you must specify your default time zone. You
can specify a
time zone in three ways: select one of the continents or
oceans from the
list, select other - offset from GMT, or other - specify time
zone file.

> To make a selection, use the arrow keys to highlight the


option and
press Return to mark it [X].

Continents and Oceans


qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
- [ ] Africa
x [ ] Americas
x [ ] Antarctica
x [ ] Arctic Ocean
x [ ] Asia
x [ ] Atlantic Ocean
x [ ] Australia
x [X] Europe
v [ ] Indian Ocean

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-6_Help

Country or Region
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

> To make a selection, use the arrow keys to highlight the


option and
press Return to mark it [X].

Countries and Regions


qqqqqqqqqqqqqqqqqqqqqqqqq
^ [ ] Bulgaria
x [ ] Croatia
x [ ] Czech Republic
x [ ] Denmark
x [ ] Estonia
x [X] Europe - Central
x [ ] Europe - Eastern
x [ ] Europe - Western
x [ ] Finland
x [ ] France
x [ ] Germany
x [ ] Gibraltar
v [ ] Greece

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-6_Help

Confirm Information
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

> Confirm the following information. If it is correct, press


F2;
to change any information, press F4.

Time zone: MET


qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-4_Change Esc-6_Help

Root Password
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
q

Please enter the root password for this system.

The root password may contain alphanumeric and special


characters. For
security, the password will not be displayed on the screen as
you type it.

> If you do not want a root password, leave both entries


blank.

Root password: ******


Root password: ******

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
Esc-2_Continue Esc-6_Help

rebooting system due to change(s) in /etc/default/init

[NOTICE: Zone rebooting]


SunOS Release 5.10 Version Generic_118833-17 64-bit
Copyright 1983-2005 Sun Microsystems, Inc. All rights
reserved.
Use is subject to license terms.
Hostname: udkserc2

RECUPERATION DES INFORMATIONS DE LA ZONE

Depuis la zone globale :


# zonecfg -z udkserc2 info
zonepath: /export/zones/udkserc2
autoboot: true
pool:
net:
address: 192.168.1.12
physical: hme0

CREATION DE FILESYSTEME ZFS POUR LA ZONE LOCALE

Creation du storage pool :


# zpool create -f DU1SES c0t10d0

# zpool list DU1SES


NAME SIZE USED AVAIL CAP HEALTH
ALTROOT
DU1SES 8.38G 166K 8.37G 0% ONLINE
-
#
#
# zpool iostat -v DU1SES
capacity operations bandwidth
pool used avail read write read write
---------- ----- ----- ----- ----- ----- -----
DU1SES 166K 8.37G 0 1 309 4.03K
c0t10d0 166K 8.37G 0 1 309 4.03K
---------- ----- ----- ----- ----- ----- -----

Création des filesyste zfs :


# zfs create DU1SES/data
# zfs create DU1SES/index
# zfs create DU1SES/oracle
# zfs set quota=3G DU1SES/data
# zfs set quota=3G DU1SES/index
# zfs set quota=2G DU1SES/oracle

# zfs list
NAME USED AVAIL REFER MOUNTPOINT
DU1SES 167K 8.24G 28.5K /DU1SES
DU1SES/data 24.5K 3.00G 24.5K /DU1SES/data
DU1SES/index 24.5K 3.00G 24.5K /DU1SES/index
DU1SES/oracle 24.5K 2.00G 24.5K /DU1SES/oracle

Affectation des filesysteme à la zone locale :


# zonecfg -z udkserc2
zonecfg:udkserc2> add dataset
zonecfg:udkserc2:dataset> set name=DU1SES/data
zonecfg:udkserc2:dataset> end
zonecfg:udkserc2> verify
zonecfg:udkserc2> commit
zonecfg:udkserc2> add dataset
zonecfg:udkserc2:dataset> set name=DU1SES/index
zonecfg:udkserc2:dataset> end
zonecfg:udkserc2> verify
zonecfg:udkserc2> commit
zonecfg:udkserc2> add dataset
zonecfg:udkserc2:dataset> set name=DU1SES/oracle
zonecfg:udkserc2:dataset> end
zonecfg:udkserc2> verify
zonecfg:udkserc2> commit
zonecfg:udkserc2> exit

# zonecfg -z udkserc2 info


zonepath: /export/zones/udkserc2
autoboot: true
pool:
net:
address: 192.168.1.12
physical: hme0
dataset:
name: DU1SES/data
dataset:
name: DU1SES/index
dataset:
name: DU1SES/oracle

VISUALISATION DES PARAMETRES DES ZFS :

# zfs get all DU1SES/data


NAME PROPERTY VALUE
SOURCE
DU1SES/data type filesystem -
DU1SES/data creation Mon Mar 5 16:06 2007 -
DU1SES/data used 24.5K -
DU1SES/data available 3.00G -
DU1SES/data referenced 24.5K -
DU1SES/data compressratio 1.00x -
DU1SES/data mounted yes -
DU1SES/data quota 3G
local
DU1SES/data reservation none
default
DU1SES/data recordsize 128K
default
DU1SES/data mountpoint /DU1SES/data
default
DU1SES/data sharenfs off
default
DU1SES/data checksum on
default
DU1SES/data compression off
default
DU1SES/data atime on
default
DU1SES/data devices off
temporary
DU1SES/data exec on
default
DU1SES/data setuid on
default
DU1SES/data readonly off
default
DU1SES/data zoned on
local
DU1SES/data snapdir hidden
default
DU1SES/data aclmode groupmask
default
DU1SES/data aclinherit secure
default

 On vérifie que le paramètre « zoned » est à on (cela permet


de monter un fs zfs dans les zones locales)
REBOOT DE LA ZONE LOCALE :
# zoneadm -z udkserc2 reboot

ON VERIFIE QUE LES ZFS SONT BIEN MONTE DANS LA ZONE LOCALE :

zlogin udkserc2
[Connected to zone 'udkserc2' pts/1]
Last login: Mon Mar 5 16:12:27 on pts/1
Sun Microsystems Inc. SunOS 5.10 Generic January 2005

# #
#
# df -k
Filesystem kbytes used avail capacity Mounted
on
/ 16381122 7360864 8856447 46% /
/dev 16381122 7360864 8856447 46% /dev
proc 0 0 0 0% /proc
ctfs 0 0 0 0%
/system/contract
swap 1362472 168 1362304 1%
/etc/svc/volatile
mnttab 0 0 0 0%
/etc/mnttab
fd 0 0 0 0% /dev/fd
swap 1362304 0 1362304 0% /tmp
swap 1362312 8 1362304 1% /var/run
DU1SES/data 3145728 24 3145703 1%
/DU1SES/data
DU1SES/index 3145728 24 3145703 1%
/DU1SES/index
DU1SES/oracle 2097152 24 2097127 1%
/DU1SES/oracle
#
#
# uname -a
SunOS udkserc2 5.10 Generic_118833-17 sun4u sparc SUNW,Ultra-
250

CREATION DES FS UFS /var et /app POUR LA ZONE LOCALE:

# newfs /dev/dsk/c0t8d0s0
newfs: /dev/rdsk/c0t8d0s0 last mounted as
/export/zones/testfl_zone/root/var
newfs: construct a new file system /dev/rdsk/c0t8d0s0: (y/n)? y
Warning: 4096 sector(s) in last cylinder unallocated
/dev/rdsk/c0t8d0s0: 8388608 sectors in 1366 cylinders of 48
tracks, 128 sect
ors
4096.0MB in 86 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056,
787488, 885920,
7472672, 7571104, 7669536, 7767968, 7866400, 7964832, 8063264,
8161696,
8260128, 8358560
# newfs /dev/dsk/c0t8d0s1
newfs: /dev/rdsk/c0t8d0s1 last mounted as
/export/zones/testfl_zone/root/app
newfs: construct a new file system /dev/rdsk/c0t8d0s1: (y/n)? y
Warning: 4096 sector(s) in last cylinder unallocated
/dev/rdsk/c0t8d0s1: 8388608 sectors in 1366 cylinders of 48
tracks, 128 sect
ors
4096.0MB in 86 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056,
787488, 885920,
7472672, 7571104, 7669536, 7767968, 7866400, 7964832, 8063264,
8161696,
8260128, 8358560

Arrêt de la zone :

# zoneadm -z udkserc2 halt


# zoneadm list
global

On copie /export/zones/udkserc2/root/var dans le filesystem


c0t8d0s0

# zonecfg -z udkserc2
zonecfg:udkserc2> add fs
zonecfg:udkserc2:fs> set dir=/var
zonecfg:udkserc2:fs> set special=/dev/dsk/c0t8d0s0
zonecfg:udkserc2:fs> set raw=/dev/rdsk/c0t8d0s0
zonecfg:udkserc2:fs> set type=ufs
zonecfg:udkserc2:fs> set options=logging
zonecfg:udkserc2:fs> end
zonecfg:udkserc2> verify
zonecfg:udkserc2> commit
zonecfg:udkserc2> exit

# zonecfg -z udkserc2
zonecfg:udkserc2> add fs
zonecfg:udkserc2:fs> set dir=/app
zonecfg:udkserc2:fs> set special=/dev/dsk/c0t8d0s1
zonecfg:udkserc2:fs> set raw=/dev/rdsk/c0t8d0s1
zonecfg:udkserc2:fs> set type=ufs
zonecfg:udkserc2:fs> set options=logging
zonecfg:udkserc2:fs> end
zonecfg:udkserc2> verify
zonecfg:udkserc2> commit
zonecfg:udkserc2> exit

# zonecfg -z udkserc2 info


zonepath: /export/zones/udkserc2
autoboot: true
pool:
fs:
dir: /var
special: /dev/dsk/c0t8d0s0
raw: /dev/rdsk/c0t8d0s0
type: ufs
options: [logging]
fs:
dir: /app
special: /dev/dsk/c0t8d0s1
raw: /dev/rdsk/c0t8d0s1
type: ufs
options: [logging]
net:
address: 192.168.1.12
physical: hme0
dataset:
name: DU1SES/data
dataset:
name: DU1SES/index
dataset:
name: DU1SES/oracle

On reboot la zone:
# zoneadm -z udkserc2 boot

On vérifie :
# zlogin udkserc2
[Connected to zone 'udkserc2' pts/1]
Last login: Mon Mar 5 16:14:38 on pts/1
Sun Microsystems Inc. SunOS 5.10 Generic January 2005

# #

# # df -k
Filesystem kbytes used avail capacity Mounted
on
/ 16381122 7280851 8936460 45% /
/app 4130302 4113 4084886 1% /app
/dev 16381122 7280851 8936460 45% /dev
/var 4130302 39509 4049490 1% /var
proc 0 0 0 0% /proc
ctfs 0 0 0 0%
/system/contract
swap 1408736 192 1408544 1%
/etc/svc/volatile
mnttab 0 0 0 0%
/etc/mnttab
fd 0 0 0 0% /dev/fd
swap 1408544 0 1408544 0% /tmp
swap 1408544 0 1408544 0% /var/run

You might also like