root@e4k # zpool status
pool: superstore
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
superstore ONLINE 0 0 0
raidz2 ONLINE 0 0 0
c0t0d0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0
c0t2d0 ONLINE 0 0 0
c1t3d0 ONLINE 0 0 0
c0t4d0 ONLINE 0 0 0
c1t6d0 ONLINE 0 0 0
c0t16d0 ONLINE 0 0 0
c0t18d0 ONLINE 0 0 0
c0t20d0 ONLINE 0 0 0
c1t21d0 ONLINE 0 0 0
zpool create zones c0t0d0 c1t1d0 c0t2d0 c1t3d0 c0t4d0 c1t6d0 c0t16d0 c0t18d0 c0t20d0 c1t21d0
zoneadm list -vc
# removed old ones with
root@e4k # zonecfg -z webservices delete
Are you sure you want to delete zone webservices (y/[n])? y
root@e4k # zonecfg -z subversion delete
Are you sure you want to delete zone subversion (y/[n])? y
# create the zone config (either sparse or whole root)
# the zone xml files are in /etc/zones/*.xml
# sparse zone...
root@e4k # zonecfg -z rbs1
rbs1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:rbs1> create
zonecfg:rbs1> set zonepath=/zones/rbs1
zonecfg:rbs1> set autoboot=true
zonecfg:rbs1> add net
zonecfg:rbs1:net> set address=10.0.0.7
zonecfg:rbs1:net> set physical=hme0
zonecfg:rbs1:net> end
zonecfg:rbs1> verify
zonecfg:rbs1> exit
# share /root with the zones
root@e4k # zonecfg -z rbs5
zonecfg:rbs5> add fs
zonecfg:rbs5:fs> set dir=/root
zonecfg:rbs5:fs> set special=/root
zonecfg:rbs5:fs> set type=lofs
zonecfg:rbs5:fs> end
zonecfg:rbs5> verify
zonecfg:rbs5> exit
# whole root zone (the -b does the trick)
root@e4k # zonecfg -z rbs1
rbs1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:rbs1> create -b
zonecfg:rbs1> set zonepath=/zones/rbs1
zonecfg:rbs1> set autoboot=true
zonecfg:rbs1> add net
zonecfg:rbs1:net> set address=10.0.0.7
zonecfg:rbs1:net> set physical=hme0
zonecfg:rbs1:net> end
zonecfg:rbs1> verify
zonecfg:rbs1> exit
# install the zone
root@e4k # zoneadm -z rbs1 install
# boot the zone
root@e4k # zoneadm -z rbs1 boot
root@e4k # zlogin -C rbs1
[Connected to zone 'rbs1' console]
# back in the global zone
# enable poold
root@e4k # pooladm -e
# might need to start the pool service
root@e4k # svcadm enable svc:/system/pools
# setup the initial /etc/pooladm.conf
poolcfg -c 'create pset pset_z1 (uint pset.min = 1; uint pset.max = 4)'
# setup the fair share scheduler (why?)
poolcfg -c 'create pool pool_z1 (string pool.scheduler="FSS")'
# join the two
poolcfg -c 'associate pool pool_z1 (pset pset_z1)'
# view what's been done
poolcfg -c info
# save it
pooladm -c
# activate it for the zone
root@e4k # zonecfg -z rbs1 set pool=pool_z1
# reboot the zone
###############################First done...########################
Now: Create a 6 CPU pool for the global
Create another 3 8 CPU pools
Create another 3 zones
assign the pools
# create the global pool
POOL=global
P_MAXCPU=6
P_ZONE=global
poolcfg -c 'create pset 'pset_$POOL' (uint pset.min = 1; uint pset.max = '$POOL_MAXCPU' )'
poolcfg -c 'create pool 'pool_$POOL' (string pool.scheduler="FSS")'
poolcfg -c 'associate pool 'pool_$POOL' (pset 'pset_$POOL')'
poolcfg -c info
pooladm -c
zonecfg -z $P_ZONE set pool=pool_$POOL
# create the three 8 CPU pools (z2->z4 & rbs2->rbs4)
POOL=z5
POOL_MAXCPU=8
P_ZONE=rbs5
poolcfg -c 'create pset 'pset_$POOL' (uint pset.min = 1; uint pset.max = '$POOL_MAXCPU' )'
poolcfg -c 'create pool 'pool_$POOL' (string pool.scheduler="FSS")'
poolcfg -c 'associate pool 'pool_$POOL' (pset 'pset_$POOL')'
poolcfg -c info
pooladm -c
zonecfg -z $P_ZONE set pool=pool_$POOL
# check how many CPUs are in each
for a in 1 2 3 4 5; do echo rbs$a; zlogin rbs$a mpstat; done
for a in 1 2 3 4 5; do
POOL=z$a
zonecfg -z rbs$a remove pool=pool_$POOL
done
#### done it wrong!
# remove the pool association with the zones
for a in 1 2 3
do
zonecfg -z rbs$a clear pool
done
# remove the pools and psets
for a in 1 2 3 4 5
do
POOL=z$a
echo poolcfg -c \'destroy pset pset_$POOL\'
echo poolcfg -c \'destroy pool pool_$POOL\'
done
# try again.
# create a single 8 CPU pool for zones rbs1->rbs5
POOL=zones
POOL_MAXCPU=8
poolcfg -c 'create pset 'pset_$POOL' (uint pset.min = 1; uint pset.max = '$POOL_MAXCPU' )'
poolcfg -c 'create pool 'pool_$POOL' (string pool.scheduler="FSS")'
poolcfg -c 'associate pool 'pool_$POOL' (pset 'pset_$POOL')'
poolcfg -c info
pooladm -c
POOL=zones1
for a in 1 2 3 4 5
do
P_ZONE=rbs$a
echo zonecfg -z $P_ZONE set pool=pool_$POOL
done
# commit it
pooladm -c
# boot the zones
root@e4k # for a in 1 2 3 4 5
do
zoneadm -z rbs$a boot
done
POOL=zones
POOL_MAXCPU=4
poolcfg -c 'modify pset 'pset_$POOL' (uint pset.min = 1; uint pset.max = '$POOL_MAXCPU' )'
POOL=zones1
POOL_MAXCPU=8
poolcfg -c 'create pset 'pset_$POOL' (uint pset.min = 1; uint pset.max = '$POOL_MAXCPU' )'
poolcfg -c 'create pool 'pool_$POOL' (string pool.scheduler="FSS")'
poolcfg -c 'associate pool 'pool_$POOL' (pset 'pset_$POOL')'
poolcfg -c info
pooladm -c
POOL=zones1
for a in 1 2 3
do
P_ZONE=rbs$a
echo zonecfg -z $P_ZONE set pool=pool_$POOL
done
POOL=zones
for a in 4 5
do
P_ZONE=rbs$a
echo zonecfg -z $P_ZONE set pool=pool_$POOL
done
for a in 1 2 3 4 5
do
P_ZONE=rbs$a
echo $P_ZONE
zonecfg -z $P_ZONE info | grep -i pool
done
# boot the zones
for a in 1 2 3 4 5
do
zoneadm -z rbs$a boot
done
Monday, 18 August 2008
Sample pset and zone commands (Containers)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment