#03-01 Solaris Zone Update ~ Solaris 11 で何が変わったのか? (2012-05-21)
-
Upload
solarisjpnight -
Category
Technology
-
view
1.814 -
download
6
description
Transcript of #03-01 Solaris Zone Update ~ Solaris 11 で何が変わったのか? (2012-05-21)
1 | © 2012 Oracle. All rights reserved.
2 | © 2012 Oracle. All rights reserved.
Solaris Zone Update
~ Solaris 11 で何が変わったのか?
システム事業統括 ソリューション統括本部
3 | © 2012 Oracle. All rights reserved.
以下の事項は、弊社の一般的な製品の方向性に関する概要を説明するものです。また、情報提供を唯一の目的とするものであり、いかなる契約にも組み込むことはできません。以下の事項は、マテリアルやコード、機能を提供することをコミットメント(確約)するものではないため、購買決定を行う際の判断材料になさらないで下さい。オラクル製品に関して記載されている機能の開発、リリースおよび時期については、弊社の裁量により決定されます。
OracleとJavaは、Oracle Corporation 及びその子会社、関連会社の米国及びその他の国における登録商標です。
文中の社名、商品名等は各社の商標または登録商標である場合があります。
4 | © 2012 Oracle. All rights reserved.
Agenda
• Solaris ゾーン
• Solaris リソース・マネージャ
• ゾーン管理
• 参考情報
5 | © 2012 Oracle. All rights reserved.
Solaris ゾーン
• 単一システム上に複数の隔離されたランタイム環境を提供する機能
• ゾーンは大きく 2 種類に区分
大域ゾーン (global zone)
• オペレーティングシステムの実体
非大域ゾーン (non-global zone)
• 大域ゾーン上で動作するアプリケーション実行環境
• 大域ゾーンとカーネルを共有
• 非大域ゾーン間は完全に隔離
• 最大 8192 個 (大域ゾーン含む) 作成可能
概要
6 | © 2012 Oracle. All rights reserved.
zone zone zone
Solaris ゾーン 概要
net0
:1
zcons
/usr
ゾーン管理 (zonecfg, zoneadm, zlogin, etc)
zoneadmd zoneadmd zoneadmd
net0
:2
/data
/usr
net1
/data
/usr
C C C C
Vir
tual
Pla
tfo
rm
Resource Manager
/data
zcons
zcons Global Zone
7 | © 2012 Oracle. All rights reserved.
疎ルートゾーン (Sparse Root Zone) 完全ルートゾーン (Whole Root Zone)
zone
/ /platform
/usr
/sbin
/lib …
global
Solaris ゾーン 非大域ゾーン種別
標準のファイルシステムタイプ
ファイルシステム継承なし
ファイルシステムの一部を大域ゾーンから読み取り専用で継承
/ /platform
/usr
/sbin
/lib …
継承
zone
/ /platform
/usr
/sbin
/lib …
global
/ /platform
/usr
/sbin
/lib …
8 | © 2012 Oracle. All rights reserved.
• 不変ゾーン (Immutable Zone)
読み取り専用のランタイム環境
file-mac-profile プロパティより設定
• none (defafult)
• strict
• fixed-configuration
• flexible-configuration
Solaris ゾーン 非大域ゾーン種別
global
# zonecfg –z zone02 info file-mac-profile
file-mac-profile: flexible-configuration
zone01 zone02
/ /platform
/usr
/sbin
/lib …
/ /platform
/usr
/sbin
/lib …
9 | © 2012 Oracle. All rights reserved.
Solaris ゾーン 非大域ゾーン種別
dedup=off
# zpool get dedup zones
NAME PROPERTY VALUE SOURCE
zones dedupratio 1.00x -
dedup=on
# zpool get dedup zones
NAME PROPERTY VALUE SOURCE
zones dedupratio 2.03x -
zone01 zone02
“代替” 疎ルートゾーン
+
Immutable Zone セキュリティ確保
ZFS 重複排除機能 ディスク使用量の軽減
/ /platform
/usr
/sbin
/lib …
/ /platform
/usr
/sbin
/lib …
10 | © 2012 Oracle. All rights reserved.
Solaris ゾーン
• ブランドゾーン (Branded Zone)
Solaris 11 ネイティブではないオペレーティング環境
を含む非大域ゾーン
Solaris 10
• native (SPARC/x86)
• solaris8 (SPARC)
• solaris9 (SPARC)
• lx (x86)
Solaris 11
• solaris (SPARC/x86, a.k.a. ipkg)
• solaris10 (SPARC/x86)
非大域ゾーン種別
s10z
Solaris 10 Solaris 10
s10z
11 | © 2012 Oracle. All rights reserved.
排他的 IP (Exclusive IP) ゾーン 共有 IP (Shared IP) ゾーン
Solaris ゾーン ネットワーク
zone01 zone02
net0
net0:1 net0:2
zone03
net1
net1
標準のネットワークタイプ
非大域ゾーンに物理/仮想インター
フェースを割り当て
大域ゾーンと物理ネットワークを共有
非大域ゾーンに論理インターフェース
を割り当て
zone01
net0
zone02
vnic1 vnic0
12 | © 2012 Oracle. All rights reserved.
Solaris ゾーン
• 仮想インターフェースの自動生成
非大域ゾーン起動時にテンポラリ仮想
インターフェースを自動生成
anet リソースより設定
ネットワーク
zone01
net0
zone02
# zoneadm –z zone01 boot
# dladm show-vnic
LINK OVER SPEED … zone01/net0 net0 1000 …
# zoneadm –z zone01 shutdown
# dladm show-vnic
LINK OVER SPEED …
13 | © 2012 Oracle. All rights reserved.
Solaris ゾーン
• anet リソース
linkname プロパティ
• 非大域ゾーンでのインターフェース名
lower-link プロパティ
• 非大域ゾーンのインターフェースを
紐づける大域ゾーンにおける物理
インターフェース名
allowed-address プロパティ*1
• 非大域ゾーンで利用可能な IP アドレス
configure-allowed-address プロパティ*1
• allowed-address の使用可否
ネットワーク global
# zonecfg -z zone01 info anet
anet:
linkname: net0
lower-link: auto
allowed-address not specified
configure-allowed-address: true
defrouter not specified
allowed-dhcp-cids not specified
link-protection: mac-nospoof
mac-address: random
auto-mac-address: 2:8:20:e2:77:d2
mac-prefix not specified
mac-slot not specified
vlan-id not specified
priority not specified
rxrings not specified
txrings not specified
mtu not specified
maxbw not specified
rxfanout not specified *1 : net リソースにも同様のプロパティが追加
14 | © 2012 Oracle. All rights reserved.
global
# zonecfg –z zone01 info fs
fs:
dir: /mnt
special: /dev/dsk/c3t3d0s0
raw: /dev/rdsk/c3t3d0s0
type: ufs
options: [ ]
zone01
Solaris ゾーン
• 非大域ゾーンにファイルシステムを
アサイン (ufs, zfs, lofs)
非大域ゾーン管理者はアサインされた
ファイルシステム (マウントポイント) に
ファイルやディレクトリを作成可能
ファイルシステム (fs)
s0
/mnt
zone01
# df –h /mnt
Filesystem Size …
/mnt 67G …
15 | © 2012 Oracle. All rights reserved.
global
# zonecfg –z zone01 info dataset
dataset:
name: zones/zfs01
alias: zfs01
zone01
Solaris ゾーン
• 非大域ゾーンに ZFS データセットを
アサイン
データセットは仮想 ZFS プールとして認識
非大域ゾーン管理者はアサインされた ZFS
データセットを管理
Quota は大域ゾーンから設定
データセット (dataset)
zfs
01
zpool
zfs01
zone01
# zpool status zfs01
pool: zfs01
state: ONLINE
scan: none requested
config:
NAME STATE …
zfs01 ONLINE …
errors: No known data errors
16 | © 2012 Oracle. All rights reserved.
Solaris ゾーン
• 非大域ゾーンに block/raw デバイス
をアサイン
allow-partition プロパティにより、非大域
ゾーン管理者が format (1M) によるディス
ク管理が可能
マウントする場合は fs-allowed プロパティ
に注意 (デフォルトは hsfs, nfs のみ許可)
デバイス (device)
zone01
c3t3d0
global
# zonecfg –z zone01 info device
device:
match: /dev/*dsk/c3t3d0*
allow-partition: true
allow-raw-io not specified
zone01
# ls /dev/dsk
c3t3d0p0 c3t3d0s0 …
c3t3d0p1 c3t3d0s1 …
c3t3d0p2 c3t3d0s10 …
c3t3d0p3 c3t3d0s11 …
17 | © 2012 Oracle. All rights reserved.
Solaris ゾーン
• セキュリティは特権 (privileges) によって管理
• 非大域ゾーンで以下の特権は使用禁止
dtrace_kernel
proc_zone
sys_config
sys_devices
sys_linkdir
sys_net_config
sys_res_config
sys_suser_compat
セキュリティ
zone01 zone02
P
P
P
P
P P
大域ゾーンは非大域ゾーンへのコンソール機能を提供
非大域ゾーン間、
大域ゾーンへの
侵入は不可
非大域ゾーンの障害は他に影響を与えない
18 | © 2012 Oracle. All rights reserved.
Agenda
• Solaris ゾーン
• Solaris リソース・マネージャ
• ゾーン管理
• 参考情報
19 | © 2012 Oracle. All rights reserved.
Solaris リソース・マネージャ
• 3 つの CPU 資源の管理方法
資源プール
• CPU 資源をグループ化して非大域ゾーンへ紐づける単位
• プロセッサセットとスケジューリングクラスから構成
capped-cpu 資源
• 非大域ゾーンで利用する CPU 使用率を指定
• 資源プールと併用可能
dedicated-cpu 資源
• CPU の一部を非大域ゾーン専用として割り当て
• 資源プール/capped-cpu 資源との併用は不可
CPU 資源
20 | © 2012 Oracle. All rights reserved.
Solaris リソース・マネージャ
• プロセッサ・セット
CPU *1の集合体
• スケジューリングクラス
FSS (Fair Share Scheduler)
• CPU シェア数 (cpu-shares) に基づき
資源プールを共有するゾーン間でリソ
ースを配分
TS (Time Sharing)
• Solaris 標準スケジューラ
• CPU 資源をプロセス毎に平等に配分
資源プール
pool_zone
pset_zone
pool_default
pset_default
C C C C
資源プール プロセッサ・セット
zone01 zone02 global
*1 : OS が認識可能な最小単位
21 | © 2012 Oracle. All rights reserved.
Solaris リソース・マネージャ 資源プール
• 複数の非大域ゾーンで資源プール
を共有
• 資源競合が発生しない限り、非大域
ゾーンはプール内の資源を最大限
利用可能
pool_zone
pset_zone
pool_default
pset_default
C C C C
zone01 zone02 global
zone01 でプロセス
を起動
zone02 でプロセス
を起動
100% 0%
80% 20%
cpu-shares : 20 cpu-shares : 80
22 | © 2012 Oracle. All rights reserved.
Solaris リソース・マネージャ capped-cpu 資源
• 1 CPU *1 を 100% として、非大域
ゾーンにおいて利用可能な CPU
使用率を指定 (小数点第二位まで
指定可能)
• 資源競合が発生しない状況下に
おいても指定された使用率に制限
• 資源プールと併用可能
pool_zone
pset_zone
pool_default
pset_default
C C C C
zone01 zone02 global
zone01 でプロセス
を起動 50%
ncpus : 1
資源プールの
ncpus / total cpu
を利用
*1 : OS が認識可能な最小単位
23 | © 2012 Oracle. All rights reserved.
Solaris リソース・マネージャ dedicated-cpu 資源
• 非大域ゾーンにおいて利用可能な
CPU 数を指定 (範囲指定する場合
は重要度も設定)
• 資源競合はなく全ての資源を利用
可能
• テンポラリ資源プールを利用
• 資源プール/capped-cpu 資源との
併用は不可
SUNWtmp_zone02
SUNWtmp_zone02
pool_default
pset_default
C C C C
zone01 zone02 global
zone01 でプロセス
を起動 100%
割り当てられた全
リソースを占有
ncpus : 2
非大域ゾーン起動時に資源が足りない場合は 起動不可
24 | © 2012 Oracle. All rights reserved.
Solaris リソース・マネージャ 動的資源プール
• CPU 資源を範囲で指定
• 負荷状況と資源プールの重要度に
応じて動的に資源を移動
• 資源プール/dedicated-cpu 資源で
利用可能
pool_zone
pset_zone
pool_default
pset_default
C C C C
zone01 zone02 global
37.5% 37.5%
cpu-shares : 50 cpu-shares : 50
C
25% 25% 50%
25%
負荷状況に応じて
動的にプール間で
資源移動
25 | © 2012 Oracle. All rights reserved.
Solaris リソース・マネージャ
• 非大域ゾーンに対してメモリ資源の上限値を指定
capped-memory 資源
• 物理メモリ (physical)
• スワップメモリ (swap)
• ロックメモリ (locked)
• 他のゾーンへ与える影響を最小限に抑える事が可能
メモリ資源
26 | © 2012 Oracle. All rights reserved.
Solaris リソース・マネージャ
• /etc/system に対するパラメータは大域ゾーンからのみ設定可能
• 非大域ゾーン単位に指定可能なパラメータ
max-shm-memory (旧 shmsys:shminfo_shmmax)
• 非大域ゾーンに許容される System V 共有メモリ
max-shm-ids (旧 shmsys:shminfo_shmmni)
• 非大域ゾーンに許容される System V 共有メモリ ID の最大数
max-sem-ids (旧 semsys:seminfo_semmni)
• 非大域ゾーンに許容されるセマフォ ID の最大数
max-msg-ids (旧 msgsys:msginfo_msgmni)
• 非大域ゾーンに許容されるメッセージキュー ID の最大数
System V IPC パラメータ
27 | © 2012 Oracle. All rights reserved.
Agenda
• Solaris ゾーン
• Solaris リソース・マネージャ
• ゾーン管理
• 参考情報
28 | © 2012 Oracle. All rights reserved.
global
# zoneadm –z zone01 shutdown
# zonecfg –z zone01 export –f ./zone01.cfg
# cp zone01.cfg zone02.cfg
# vi zone02.cfg
# zonecfg –z zone02 –f ./zone02.cfg
# zoneadm –z zone02 clone zone01
# zoneadm –z zone02 boot
ゾーン管理
• 同一サーバ内でゾーンの複製を作成可能
複製
zone01 zone02
2. 複製するゾーン
構成の作成
Master
Config
Clone
Config
1. マスターとなる
構成情報の取得
3. OS イメージの
コピー
29 | © 2012 Oracle. All rights reserved.
Solaris 10 Solaris 11
ゾーン管理
• 大域ゾーンとして動作する Solaris 10/11 を
非大域ゾーンとして集約可能
P2V マイグレーション
s10p2v s11p2v
global
# zonep2vchk
# zonep2vchk –cT S11 > s11p2v.cfg
# beadm create s11p2v
# beadm mount s11p2v /mnt
# cd /mnt
# find . | cpio –ocm > /root/s11p2v.cpio
global
# zonecfg –z s11p2v –f ./s11p2v.cfg
# zoneadm –z s11p2v install –a /root/s11p2v.cpio -u
# zoneadm –z s11p2v boot
3. 非大域ゾーンと
してデプロイ
2. OS イメージの
作成/コピー
1. 構成ファイルの
作成
30 | © 2012 Oracle. All rights reserved.
ゾーン管理
• サーバ間で非大域ゾーンを移動可能
V2V マイグレーション
zone01
zone01 zone02
global
# zoneadm –z zone01 shutdown
# zoneadm –z zone01 detach
# zfs snapshot zones/zone01@snap
# zfs send zones/zone01@snap > zone01.img
global
# zfs recv zones/zone01 < zone01.img
# zonecfg –z zone01 create –a /zones/zone01
# zoneadm –z zone01 attach
# zoneadm –z zone01 boot
1. 非大域ゾーンの
デタッチ
2. OS イメージの
コピー
3. 非大域ゾーンの
アタッチ
31 | © 2012 Oracle. All rights reserved.
ゾーン管理
• zonecfg (1M)
非大域ゾーン構成コマンド
• zoneadm (1M)
非大域ゾーン管理コマンド
• zonep2vchk (1M)
P2V チェックコマンド
• zonestat (1)
非大域ゾーン監視コマンド
• zlogin (1)
非大域ゾーンへのログイン
管理コマンド
31
ready
installed
incomplete
uninstall
mark
incomplete
uninstall install
boot
boot ready
halt ready
halt
shutdown
mark
incomplete
reboot
configured
No Zone
create delete
login
Zone
running
zo
necfg
zo
nead
m
zlo
gin
32 | © 2012 Oracle. All rights reserved.
ゾーン管理
• zonecfg (1M)
file-mac-profile
fs-allowed
net
• allowed-address
• configure-allowed-address
anet
device
• allow-partition
• allow-raw-io
dataset
• alias
admin
• user
• auths
管理コマンド
33 | © 2012 Oracle. All rights reserved.
ゾーン管理
• 特定のユーザ/ロールにゾーン管理の権限を委譲
Delegated Administration
global
# zonecfg -z zone01 info admin
admin:
user: guest
auths: login,manage
$ pfexec zoneadm -z zone01 boot
$ pfexec zlogin -C zone01
zone01 zone02 net0
:1
zcons
/usr
ゾーン管理 (zoneadm, zlogin)
zoneadmd zoneadmd
net0
:2
/data
/usr
/data
zcons
root
guest
34 | © 2012 Oracle. All rights reserved.
ゾーン管理
• zoneadm (1M)
shutdown
• zoneadm (1M) コマンドによる graceful shutdown が可能
• zonep2vchk (1M)
大域ゾーンで稼働する Solaris 10/11 環境の P2V 移行支援ユーティリティ
• 移行に関する問題点の検出
• 移行に必要となる構成ファイルの生成
• Solaris 10 で実行する場合には Oracle Solaris Zones Preflight System Checker
をインストール
管理コマンド
35 | © 2012 Oracle. All rights reserved.
ゾーン管理 zonep2vchk (1M)
global
# zonep2vchk
--Executing Version: 1.0.5-11-16135
- Source System: s11
Solaris Version: Oracle Solaris 11 11/11 X86
Solaris Kernel: 5.11 snv_175
Platform: i86pc i86pc
- Target System:
Solaris_Version: Solaris 11
Zone Brand: solaris (default)
IP type: exclusive
--Executing basic checks
protocol not installed: smb
- Dynamically assigned IP addresses are configured on the following
interfaces. These IP addresses could change as a result of MAC
address changes. You may need to modify this system's address
information on the DHCP server and on the DNS, LDAP, or NIS
name
servers:
Autoconfigured IPv6 addresses on net0
Basic checks compete, 1 issue(s) detected
--Total issue(s) detected: 1
36 | © 2012 Oracle. All rights reserved.
ゾーン管理 zonep2vchk (1M)
global
# zonep2vchk -cT S11
create -b
set zonepath=/zones/s11
add attr
set name="zonep2vchk-info"
set type=string
set value="p2v of host s11"
end
set ip-type=exclusive
# Uncomment the following to retain original host hostid:
# set hostid=00c82acc
# Max procs and lwps based on max_uproc/v_proc
set max-processes=20000
set max-lwps=40000
add attr
set name=num-cpus
set type=string
set value="original system had 2 cpus"
end
# Only one of dedicated or capped cpu can be used.
# Uncomment the following to use cpu caps:
# add capped-cpu
# set ncpus=2.0
# end
# Uncomment the following to use dedicated cpu:
# add dedicated-cpu
# set ncpus=2
# end
# Uncomment the following to use memory caps.
# Values based on physical memory plus swap devices:
# add capped-memory
# set physical=16256M
# set swap=20351M
# end
# Original net0 interface configuration:
# Statically defined 192.168.0.210/24 (s11)
# Autoconfigured fe80::214:4fff:fe28:382c/10
# Factory assigned MAC address 0:14:4f:28:38:2c
add anet
set linkname=net0
set lower-link=change-me
# Uncomment the following to retain original link configuration:
# set mac-address=0:14:4f:28:38:2c
end
exit
37 | © 2012 Oracle. All rights reserved.
Agenda
• Solaris ゾーン
• Solaris リソース・マネージャ
• ゾーン管理
• 参考情報
38 | © 2012 Oracle. All rights reserved.
参考資料
• Oracle Solaris のシステム管理 (Oracle Solaris ゾーン、Oracle Solaris
10 ゾーン、およびリソース管理) http://docs.oracle.com/cd/E26924_01/pdf/E25829.pdf
• Oracle Solaris Zones Preflight System Checker http://www.oracle.com/technetwork/server-storage/solaris10/downloads/index.html
39 | © 2012 Oracle. All rights reserved.
40 | © 2012 Oracle. All rights reserved.