Solaris10的Containers/zone技术可以支持这个,即在同一个Solaris实例
中建立许多单个的运行环境,就像很多独立的系统一样。
一下用一个实例来介绍 zone的配置:
1.检查Solaris 主机网络配置和现有zone:
# showrev
Hostname: qf1kvms10
Hostid: 352f4afe
Release: 5.10
Kernel architecture: i86pc
Application architecture: i386
Hardware provider:
Domain:
Kernel version: SunOS 5.10 Generic_120012-14
#
# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
vmxnet0: flags=1000843 mtu 1500 index 2
inet 192.168.7.7 netmask ffffff00 broadcast 192.168.7.255
ether 0:c:29:f7:d0:92
# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
2. 建立一个名为vboxzone虚拟主机(vboxzone, ip 10.1.1.16):
zonecfg -z vboxzone
vboxzone:没有配置此区域
使用'create'开始配置新区域。
zonecfg:vboxzone>create
zonecfg:vboxzone> set zonepath=/u01/vboxzone
zonecfg:vboxzone> set autoboot=true
zonecfg:vboxzone> add net
zonecfg:vboxzone:net> set physical=vmxnet0
zonecfg:vboxzone:net> set address=192.168.7.247
zonecfg:vboxzone:net> end
zonecfg:vboxzone> commit
zonecfg:vboxzone> export
create -b
set zonepath=/u01/vboxzone
set autoboot=true
set ip-type=shared
add inherit-pkg-dir
set dir=/lib
end
add inherit-pkg-dir
set dir=/platform
end
add inherit-pkg-dir
set dir=/sbin
end
add inherit-pkg-dir
set dir=/usr
end
add net
set address=192.168.7.247
set physical=vmxnet0
end
zonecfg:vboxzone> exit
安装和启动zone—— vboxzone:
# zoneadm -z vboxzone install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize packages on the zone.
Initializing package of : percent complete: 20%
//等待Initializing package完成
Initialized packages on zone.
Zone is initialized.
Installation of these packages generated warnings:
The file contains a log of the zone installation.
install zone完成后:
# zoneadm -z vboxzone ready
# zoneadm -z vboxzone boot
3.检查vboxzone是否运行
QHOVMS10# zoneadm list -cv
ID NAME STATUS PATH
0 global running /
1 vboxzone running /u01/vboxzone
4.登录vboxzone,再象装系统一样安装vboxzone,直到装完重新启动:
# zlogin -C vboxzone
Select a Language
0. English
1. Simplified Chinese
Please make a choice (0 - 1), or press h or ? for help: 1
...
System identification is completed.
...
rebooting system due to change(s) in /etc/default/init
[NOTICE: Zone rebooting]
SunOS Release 5.10 Version s10_74 64-bit
Copyright 1983-2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: vboxzone
vboxzone console login: root
Password:
Dec 16 19:48:19 vboxzonej login: ROOT LOGIN /dev/console
Sun Microsystems Inc. SunOS 5.10 s10_74 December 2004
[ 本帖最后由 云杉上的蝴蝶 于 2008-6-2 23:29 编辑 ]