最近刚刚发布的 Solaris 10 操作系统,号称Sun公司的真正意义上的里程碑式操作系统,带
来了诸多突破性技术,如 Solaris Containers、动态跟踪 (DTrace)、预测性自我修复和ZFS动态
文档系统等。
比较感兴趣的是Solaris Container,也就是N1 Grid Container--网格?!现在似乎比较
流行这个,Oracle 10g 也是Grid的意思。。。。
这个Solaris Container号称能够让每个 Solaris 10 创建多达 8192 个的安全、无故障软件
分区,相对于SunFire 3800/4800/6800/4900/6900/12K/15K/25K的硬件分区似乎更夸张一点,感觉
有点像PC上的VMware。IBM最近的P5系列也是,似乎现在各大厂商都热衷于这个,叫什么server
virtualization

开始上手:

root@b1000:/# uname -a
SunOS b1000 5.10 s10_63 sun4u sparc SUNW,Sun-Blade-1000

刚装完的系统,只有一个global zone
root@b1000:/# zoneadm list -vc
ID NAME STATUS PATH
0 global running /

首先创建一个目录,用来存放新的soft zone的文档。
root@b1000:/# mkdir -p /zone/zone1
root@b1000:/# ls -ld /zone/zone1
drwxr-xr-x 2 root other 512 Dec 4 14:42 /zone/zone1

创建一个zone1的软分区:
root@b1000:/# zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set zonepath=/zone/zone1
zonecfg:zone1> set autoboot=true
zonecfg:zone1> add net
zonecfg:zone1:net> set address=192.168.0.101
zonecfg:zone1:net> set physical=eri0
zonecfg:zone1:net> end
zonecfg:zone1> info
zonepath: /zone/zone1
autoboot: true
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 192.168.0.101
physical: eri0
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> ^D
root@b1000:/#

创建完成,查看zone1的信息:
root@b1000:/# zonecfg -z zone1 info
zonepath: /zone/zone1
autoboot: true
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 192.168.0.101
physical: eri0
root@b1000:/# zoneadm list -vc
ID NAME STATUS PATH
0 global running /
- zone1 configured /zone/zone1

安装操作系统文档刚刚配置完成的zone1:
root@b1000:/# zoneadm -z zone1 install
/zone/zone1 must not be group readable.
/zone/zone1 must not be group executable.
/zone/zone1 must not be world readable.
/zone/zone1 must not be world executable.
could not verify zonepath /zone/zone1 because of the above errors.
zoneadm: zone zone1 failed to verify
root@b1000:/# ls -ld /zone/zone1
drwxr-xr-x 2 root other 512 Dec 4 14:42 /zone/zone1
root@b1000:/# chmod 0700 /zone/zone1
root@b1000:/# ls -ld /zone/zone1
drwx------ 2 root other 512 Dec 4 14:42 /zone/zone1
root@b1000:/# zoneadm -z zone1 install
Preparing to install zone .
Copying <2365> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <994> packages on the zone.
Initializing package <57> of <994>: percent complete: 5%
......
.....
...
这里大约需要二十分钟左右
Initialized <994> packages on zone.
Zone is initialized.
Installation of these packages generated errors:
Installation of these packages generated warnings: SUNWmga SUNWdclnt SUNWlvma SUNWlvmg SUNWrmui SUNWpmgr>
The file contains a log of the zone installation.
root@b1000:/# zoneadm list -vc
ID NAME STATUS PATH
0 global running /
- zone1 installed /zone/zone1

启动这个zone:
root@b1000:/# zoneadm -z zone1 boot

进入zone1的Console:
root@b1000:/# zlogin -C zone1
[Connected to zone 'zone1' console]
[NOTICE: Zone booting up]

SunOS Release 5.10 Version s10_63 64-bit
Copyright 1983-2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: zone1
The system is coming up. Please wait.




Select a Language

0. English
1. Simplified Chinese
2. Traditional Chinese

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

接下来的和平时安装系统相同,配置主机名,时区,域名解析方式等等,