How to enable Oracle Solaris containers resources Management and configurate Oracle Solaris 11 Zones
1.-Validate the state of the SMF Services
disabled 12:02:37 svc:/system/pools/dynamic:default
disabled 8:41:26 svc:/system/pools:default
2.-Enable the /system/poools:default
~# svcadm enable /system/pools
~# svcs -a | grep pool
disabled 12:02:37 svc:/system/pools/dynamic:default
online 8:41:26 svc:/system/pools:default
3.-Validate that are the resources are available to the pool
~# poolstat
pset
id pool size used load
0 pool_default 32 0.00 0.01
~#
4.-Enable your pools in your system for dinamic configuration
~# pooladm -s
5.-View the contents configuration file /etc/pooladm.conf
~#poolcfg -c info
system default
string system.comment
int system.version 1
boolean system.bind-default true
string system.poold.objectives wt-load
pool pool_default
int pool.sys_id 0
boolean pool.active true
boolean pool.default true
int pool.importance 1
string pool.comment
pset pset_default
pset pset_default
int pset.sys_id -1
boolean pset.default true
uint pset.min 1
uint pset.max 65536
string pset.policy minmax
string pset.restype cpu
string pset.reslist
string pset.units population
uint pset.load 15
uint pset.size 32
string pset.comment
.
.
.
6.- Commit the configuration /etc/pooladm.conf
~# pooladm -c
7.- Take a backup just in case
~# pooladm -s /tmp/poolbackup
9.-Create a processor set called pset_preprod minumun 2 and maximun to use 24
~# poolcfg -c 'create pset pset_preprod (uint pset.min = 2; uint pset.max = 24)'
10.-Create a Pool called "pool_preprod"
~# poolcfg -c 'create pool pool_preprod'
11.-Join the pool and processor set with an association
~# poolcfg -c 'associate pool pool_preprod (pset pset_preprod)'
12.-Validate the configuration that you will commit
~#poolcfg -c info
13.-Commit configuration
~#pooladm -c
13.-Validate the configuration commited
~#poolstat
Set the values in the /etc/system for zfs and tunning OS we have 128 GB RAM
set zfs:zfs_arc_max=10% of total memory
set autoup=5 * Total Memory
set fastscan=32768 * Total Memory
set handspreadpages=32768 * Total Memory
My configuration is currently
exclude: drv/ohci
set maxphys=0x800000
set maxpgio=65536
set fastscan=4194304
set handspreadpages=4194304
set autoup=640
set tune_t_fsflushr=1
* ZFS tuning
set zfs:zfs_immediate_write_sz=0x20000
set zfs:metaslab_df_free_pct=4
set zfs:zfs_nocacheflush=1
* Limit ARC 12 Gb
set zfs:zfs_arc_max=12884901888
set rlim_fd_max=65536
set rlim_fd_cur=65536
set ssd:ssd_max_throttle=0x20
set zfs:zfs_vdev_max_pending=20
Create Oracle Solaris 11 Zone and assign pool create "pool_preprod"
Create pool zonetest and assign mountpoint
root@test:~#zpool create zonetest c0t654757575756950959569d0
root@test:~#zfs set mountpoint=/zones/zonetest zonetest
Configure the zone, we do not use anet networking because we will use ip-type shared and not exclusive, in solaris 11 you can use vnic however we do not use that, for that reason remove anet and we are using add net.
root@test:~# zonecfg -z zonetest
Use 'create' to begin configuring a new zone.
zonecfg:zonetest> create
create: Using system default template 'SYSdefault'
zonecfg:zonetest> set zonepath=/zones/zonetest
zonecfg:zonetest> set pool=pool_preprod
zonecfg:zonetest> remove anet
zonecfg:zonetest> add net
zonecfg:zonetest:net> set physical=aggr1
zonecfg:zonetest:net> set address=192.168.1.200
zonecfg:zonetest:net> end
zonecfg:zonetest> set ip-type=shared
zonecfg:zonetest> add capped-memory
zonecfg:zonetest:capped-memory> set swap=48G
zonecfg:zonetest:capped-memory> set physical=32G
zonecfg:zonetest:capped-memory> end
zonecfg:zonetest> verify
zonecfg:zonetest> commit
zonecfg:zonetest> exit
root@sappreprod-d00:~# zoneadm list -civ
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
- zonetest configured /zones/zonetest solaris shared
Configuring proxy to install the zone with the oracle publisher (DOC ID 1433186.1)
root@test:# svccfg -s svc:/application/pkg/system-repository:default
svc:/application/pkg/system-repository:default> setprop config/http_proxy=astring: "http://182.128.2.20:8080"
svc:/application/pkg/system-repository:default> exit
root@test:# svcadm refresh svc:/application/pkg/system-repository:default
root@test:# svcadm restart svc:/application/pkg/system-repository:default
root@test:# svcs -a | grep /application/pkg/system-repository
online 8:50:11 svc:/application/pkg/system-repository:default
Export proxy variables to Environment, if you have user and password please add them
root@test:# export https_proxy=https://182.128.2.20:8080
root@test:# export http_proxy=http://182.128.2.20:8080
Configuring publisher with proxy option (release and support) you will need to download the key and certificate for moreinformation you can check my other post
http://unixaddiction.blogspot.com/2016/05/updating-solaris-11x-to-113-and-sru-to.html
root@test# pkg set-publisher --proxy http://192.168.78.50:8080 -g http://pkg.oracle.com/solaris/release/ solaris
Key and Certificate were uploaded on the path /var/pkg/ssl
root@test# ls -ltr /var/pkg/ssl
# ls -ltr
total 16
-rw-r--r-- 1 root root 1679 Sep 12 10:51 pkg.oracle.com.key.pem
-rw-r--r-- 1 root root 932 Sep 12 10:51 pkg.oracle.com.certificate.pem
root@test# pkg set-publisher --proxy http://192.168.78.50:8080 -k /var/pkg/ssl/pkg.oracle.com.key.pem -c /var/pkg/ssl/pkg.oracle.com.certificate.pem -g https://pkg.oracle.com/solaris/support/ solaris
root@test# pkg publisher
PUBLISHER TYPE STATUS P LOCATION
solaris origin online T http://pkg.oracle.com/solaris/release/
solaris origin online T https://pkg.oracle.com/solaris/support/
Zone Installation Solaris 11
root@test# zoneadm -z zonetest install
Progress being logged to /var/log/zones/zoneadm.20160916T120256Z.zonetest.install
Image: Preparing at /zones/zonetest/root.
Install Log: /system/volatile/install.6964/install_log
AI Manifest: /tmp/manifest.xml.61EqRb
SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
Zonename: zonetest
Installation: Starting ...
Creating IPS image
Retrieving catalog 1/1 solaris 28.98 MB
DOWNLOAD PKGS FILES XFER (MB)
Completed 167/167 32062/32062 175.8/175.8
PHASE ACTIONS
Install Phase 44311/44311
PHASE ITEMS
Package State Update Phase 167/167
Image State Update Phase 2/2
Installation: Succeeded
Note: Man pages can be obtained by installing pkg:/system/manual
done.
Done: Installation completed in 108.257 seconds.
Next Steps: Boot the zone, then log into the zone console (zlogin -C)
Boot the zone
root@test#zoneadm -z zonetest boot
root@test#zlogin -C zonetest
Follow the instructions and configurate the information asked by the console
root@global:~# zoneadm list -iv
ID NAME STATUS PATH BRAND IP
0 global running / solaris shared
1 zonetest running /zones/zonetest solaris shared
root@test#zlogin zonetest
#hostname
zonetest
Comments