Virtual Guru's Blog – Home of Virtualization Workshops

December 14, 2009

JeOS like Zones in OpenSolaris JeOS Prototype

Filed under: cloud, jeos, opensolaris, virtualbox, Virtualization — natiku @ 4:18 am

OpenSolaris 200906 JeOS Prototype is PURE CLI enviroment, so its small true command line only enviroment, as such is ideal install BASE for experimenting with system features like are Container based Virtualizations (Zones) or new Virtualized network stack (CROSSBOW) .

In this example I will demonstrate creating JeOS zones tepmlate for Zones clonning based on PKG OpenSolaris 200906 repository OpenSolaris 200906 JeOS Prototype.

In OpenSolaris 200906 a sample zone can be created on ZFS system and after it can be cloned after to working zones, this way we can play can always clean zone, for example as SW porting enviroment, see more in Personal SourceJuicer in OpenSolaris JeOS Prototype

To play in JeOS with iPKG ZFS based zones look into Al Blog Automating Zone creation in OpenSolaris 2009.06

To play in JeOS with network configurations with CROSSBOW look into Jerome Blog Crossbow & NAT to share DHCP WiFi interface between zones


General Information – JeOS Prototype OpenSolaris project

Download OpenSolaris 200906 JeOS Prototype VM for one 10+ most popular Virtualization Formats:

JeOS: Just enough OS Project Homepage

OpenSolaris 2009.06 JeOS Prototype VM Images Download

OpenSolaris 2009.06 JeOS Prototype 10 Simple Usage Samples

Discussion jeos-discuss@opensolaris.org (Main page)

Discussion jeos-discuss@opensolaris.org (Archives)

Part 1: Check JeOS readiness as user root

1. Switch to root

pfexec su - root

2a. Check, if PKG will clean download cache on SUCCESS

root@osol-jeos:~# pkg property flush-content-cache-on-success
PROPERTY                       VALUE
flush-content-cache-on-success True

2b. Check, then we increase PKG download patience for slowest networks

root@osol-jeos:~# set | grep PKG
PKG_CLIENT_TIMEOUT=120
PKG_TIMEOUT_MAX=16

2c. Check, then we use right main repository for opensolaris.org

root@osol-jeos:~# pkg publisher
PUBLISHER                             TYPE     STATUS   URI
opensolaris.org          (preferred)  origin   online   http://pkg.opensolaris.org/release/
contrib                               origin   online   http://pkg.opensolaris.org/contrib/

2d. Check, then we can access these repositories

root@osol-jeos:~# pkg refresh --full

2e. Check, opensolaris.org download speed of whole repository catalog

root@osol-jeos:~# curl pkg.opensolaris.org/release/catalog/0 >/dev/null
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100 1333k  100 1333k    0     0  93491      0  0:00:14  0:00:14 --:--:--  126k

2f. Check, if we have enough memory and activated swap (I recommend if possible to have VM with 768MB-1GB RAM configured)

root@osol-jeos:~# top | grep Memory
Memory: 1024M phys mem, 525M free mem, 512M total swap, 512M free swap

2g. Check, if you have enough disk space in host, in case then you use a growing Virtual disk Format

At least 2GB of disk space is needed.

Part2: Creating JeOS like template zone on OpenSolaris JeOS Prototype

Here is a diff from OpenSolaris 200906 zones creation testing during JeOS prototye development:

cat /tmp/JeOS-zones.diff
--- OSOL0906-default-ipkg-zone.i386.lst 2009-09-14 16:23:14.422776929 +0200
+++ OSOL0906-JeOS-fullpkgs.lst  2009-09-14 16:16:17.779504408 +0200
@@ -1,59 +1,163 @@
+SUNWDTraceToolkit              SUNWDTraceToolkit
SUNWPython                     The Python 2.4 interpreter, libraries and utilities
+SUNWPython-extra               Supplemental Python libraries and utilities
SUNWTcl                        Tcl - Tool Command Language
SUNWTk                         Tk - TCL GUI Toolkit
+SUNWacc                        System Accounting
SUNWadmap                      System administration applications
SUNWadmlib-sysid               System and Network identification libraries
SUNWadmr                       System & Network Administration Root
+SUNWahci                       Advanced Host Controller Interface (AHCI) SATA HBA Driver
SUNWatfs                       AutoFS
+SUNWaudd                       Audio Drivers
SUNWbash                       GNU Bourne-Again shell (bash)
+SUNWbeadm                      beadm application
+SUNWbind                       BIND DNS Name server and tools
SUNWbip                        Basic IP commands
+SUNWbtool                      CCS tools bundled with SunOS
SUNWbzip                       The bzip compression utility
+SUNWcakr                       Core Solaris Kernel Architecture
+SUNWcakrx                      Core Kernel Architecture i86xpv
+SUNWcakrx                      Core Kernel Architecture i86xpv
+SUNWcar                        Core Architecture
+SUNWcarx                       Core Architecture i86xpv
+SUNWcarx                       Core Architecture i86xpv
+SUNWcfcl                       Common Fibre Channel HBA API Library
+SUNWcfpl                       fp cfgadm plug-in library
+SUNWckr                        Core Solaris Kernel
SUNWckr                        Core Solaris Kernel
SUNWcnetr                      Core Solaris Network Infrastructure
+SUNWcpc                        CPU Performance Counter driver
+SUNWcpcu                       CPU Performance Counter libraries and utilities
+SUNWcpp                        Solaris cpp
SUNWcs                         Core Solaris
SUNWcsd                        Core Solaris Devices
SUNWcsl                        Core Solaris, (Shared Libs)
+SUNWcurl                       The C-URL Wrappers Library
+SUNWdistro-license-copyright   OpenSolaris licensing
SUNWdoc                        Documentation Tools
SUNWdtrc                       DTrace Clients
+SUNWdtrp                       DTrace Providers
SUNWesu                        Extended System Utilities
+SUNWexpect                     Expect For better automations
+SUNWfchba                      Sun Fibre Channel Host Bus Adapter Library
+SUNWfmd                        Fault Management Daemon and Utilities
+SUNWfss                        Fair Share Scheduler
+SUNWftp                        FTP Server
+SUNWgawk                       gawk - GNU awk
+SUNWgccruntime                 GCC Runtime libraries
+SUNWgcmn                       gcmn - Common GNU package
+SUNWggrp                       ggrep - GNU grep utilities
+SUNWgnu-coreutils              coreutils - GNU core utilities
+SUNWgnu-diffutils              GNU diffutils
+SUNWgnu-findutils              GNU utilities find and xargs
+SUNWgnu-idn                    The Internationalized Domains Library
+SUNWgnu-nano                   GUN nano editor (Full version, no nano-tiny)
+SUNWgnu-which                  GNU which
+SUNWgnutls                     GNU transport layer security library
+SUNWgpch                       The GNU Patch utility
+SUNWgrub                       GNU GRUB - GNU GRand Unified Bootloader
+SUNWgsed                       gsed - GNU sed
SUNWgss                        GSSAPI V2
+SUNWgtar                       gtar - GNU tar
SUNWgzip                       The GNU Zip (gzip) compression utility
+SUNWhwdata                     Hardware data files
+SUNWidnl                       Internationalized Domain Name Support Library Files
+SUNWinstall                    System install libraries and commands
SUNWinstall-libs               System install libraries
+SUNWintgige                    Intel(R) PRO/1000 Server Adapter Driver
+SUNWipc                        Interprocess Communications
+SUNWipf                        IP Filter utilities
SUNWipkg                       Image Packaging System
+SUNWipkg-brand                 ipkg brand
+SUNWjss                        Network Security Services for Java (JSS)
+SUNWkey                        Keyboard configuration tables
SUNWkrb                        Kerberos version 5 support
+SUNWkvm                        Core Architecture, (Kvm)
+SUNWlang-common                language support common components
+SUNWlang-enUS                  English (U.S.A.) language support
SUNWless                       The GNU pager (less)
SUNWlexpt                      libexpat - XML parser library
SUNWlibC                       Sun Workshop Compilers Bundled libC
+SUNWlibgcrypt                  libgcrypt - cryptographic library
+SUNWlibgpg-error               Common error codes for GnuPG, libgcrypt
SUNWlibms                      Math & Microtasking Libraries
+SUNWlibpopt                    Command line parsing library
SUNWlibsasl                    SASL v2
-SUNWlldap                      LDAP Libraries
+SUNWlibsmbclient               A library that permits applications to manipulate CIFS/SMB network resources
+SUNWlibtasn1                   Tiny ASN.1 library
+SUNWlinks                      WWW - text browser
SUNWloc                        System Localization
SUNWlxml                       The XML library
+SUNWlxsl                       The XSLT library
+SUNWman                        On-Line Manual Pages
SUNWmd                         Solaris Volume Manager
+SUNWmdb                        Modular Debugger
+SUNWmkcd                       CD creation utilities
+SUNWncft                       NcFTP - client application implementing FTP
SUNWnfsc                       Network File System (NFS) client support
-SUNWnis                        Network Information System
+SUNWnfsckr                     Network File System (NFS) client kernel support
+SUNWntp                        NTP
SUNWopenssl                    OpenSSL Commands
+SUNWos86r                      Platform Support, OS Functionality
+SUNWos86r                      Platform Support, OS Functionality
+SUNWp7zip                      The p7zip compression and archiving utility
+SUNWpcre                       Perl-Compatible Regular Expressions
SUNWperl584core                Perl 5.8.4 (core)
+SUNWperl584usr                 Perl 5.8.4 (non-core)
SUNWpicl                       PICL Libraries, and Plugin Modules
+SUNWpkgcmds                    SVr4 packaging commands
+SUNWpm                         Power Management binaries
+SUNWpng                        Portable Network Graphics library
SUNWpool                       Resource Pools
+SUNWpostrun                    Delayed execution environment for procedural package scripts
SUNWpr                         Netscape Portable Runtime
+SUNWpsdcr                      Platform Support, Bus-independent Device Drivers
+SUNWpsdir                      Platform Support, ISA Bus Device Drivers
SUNWpython-cherrypy            CherryPy
SUNWpython-mako                Mako
SUNWpython-ply                 Ply
SUNWpython-pyopenssl           pyOpenSSL - Python interface to the OpenSSL library
SUNWpython24-simplejson        JSON (Java Script Object Notation) encoder/decoder for Python 2.4
-SUNWrcmdc                      Remote Network Client Commands
+SUNWrmodr                      Realmode Modules
+SUNWrmodu                      Realmode Modules
+SUNWroute                      Network Routing daemons/commands
+SUNWrtls                       REALTEK Fast NIC
+SUNWscreen                     GNU screen
+SUNWsfman                      GNU and open source man pages
+SUNWsmagt                      System Management Agent files and libraries
SUNWsmapi                      Storage Management APIs
+SUNWsmbfs                      SMB/CIFS File System client support
+SUNWsmbfskr                    SMB/CIFS File System client support (Kernel)
+SUNWsndm                       Sendmail
+SUNWsolnm                      Solaris Naming Enabler
+SUNWsprot                      Solaris Bundled tools
SUNWssh                        SSH Client and utilities
SUNWsshcu                      SSH Common
SUNWsshd                       SSH Server
+SUNWstosreg                    OpenSolaris Registration
+SUNWsudo                       sudo (most Linux users don't like pfexec)
+SUNWswmt                       Install and Patch Utilities
SUNWtecla                      Tecla command-line editing library
+SUNWter                        Terminal Information
+SUNWtexi                       GNU texinfo - Texinfo utilities (texinfo)
SUNWtls                        Network Security Services
SUNWtoo                        Programming Tools
-SUNWvim                        Vi IMproved
+SUNWtop                        top - for moitoring processes
+SUNWtree                       tree - GNU tree
+SUNWuiu8                       Iconv modules for UTF-8 Locale
+SUNWunzip                      The Info-Zip (unzip) compression utility
+SUNWusb                        USB Device Drivers
+SUNWusbs                       USB generic serial module
SUNWwbsup                      WAN boot support
+SUNWwget                       wget - GNU wget
+SUNWwsr2                       Solaris Product Registry & Web Start runtime support
+SUNWxcu4                       XCU4 Utilities
+SUNWxvmpv                      xVM Paravirtualized Drivers
SUNWxwrtl                      X Window System & Graphics Runtime Library Links in /usr/lib
SUNWzfs                        ZFS
+SUNWzfskr                      ZFS Kernel
+SUNWzip                        The Info-Zip (zip) compression utility
SUNWzlib                       The Zip compression library
SUNWzone                       Solaris Zones
-entire                         entire incorporation
+entire at 0.5.11-0.111            entire incorporation (Locked for 200906 release)

1. Lets filter first packages which can be installed only in Global zone

Packages can limit files to be installed only in global zone with filtering out packages which deliver files only to “zone=global”

1a. Filter out packages not installed in default ZONE

root@osol-jeos:/usr/lib/brand/ipkg# cat /tmp/JeOS-zones.diff | egrep -v "\+\+\+|^\+entire" | grep "^+" | awk '{print $1}'  | tee /tmp/iPKGzones.sh
+SUNWDTraceToolkit
+SUNWPython-extra
+SUNWacc
+SUNWahci
+SUNWaudd
+SUNWbeadm
+SUNWbind
....
+SUNWwget
+SUNWwsr2
+SUNWxcu4
+SUNWxvmpv
+SUNWzfskr
+SUNWzip

1b. We filer out 108 packages

root@osol-jeos:/usr/lib/brand/ipkg# cat /tmp/JeOS-zones.diff | egrep -v "\+\+\+|^\+entire" | grep "^+" | awk '{print $1}'  | wc -l
108

1c. Create a scrit which will filter out GLOBAL zone only packages

cat >/tmp/zoned.sh
!/usr/bin/bash
echo -n "$1 "
pkg contents -m $1 | grep file | grep -v zone=global | wc -l
Ctrl-d
chmod 0700 /tmp/zoned.sh
gsed -i 's/+//g' /tmp/iPKGzones.sh

1d. Apply the filer script

root@osol-jeos:/usr/lib/brand/ipkg# cat /tmp/iPKGzones.sh | xargs -n1 /tmp/zoned.sh | tee /tmp/iPKGzonesAppPKGs.lst
SUNWDTraceToolkit 776
SUNWPython-extra 1120
SUNWacc 65
SUNWahci 0
SUNWaudd 0
...
SUNWwsr2 9
SUNWxcu4 78
SUNWxvmpv 0
SUNWzfskr 0
SUNWzip 8

1e. List of skipped packages:

root@osol-jeos:/usr/lib/brand/ipkg# cat /tmp/iPKGzonesAppPKGs.lst | grep " 0$"| sort | awk '{print $1}'|xargs -n1 pkg list -sH
SUNWahci                       Advanced Host Controller Interface (AHCI) SATA HBA Driver
SUNWaudd                       Audio Drivers
SUNWcakr                       Core Solaris Kernel Architecture
SUNWcakrx
SUNWcakrx
SUNWcarx
SUNWcarx
SUNWcpc                        CPU Performance Counter driver
SUNWdistro-license-copyright   OpenSolaris licensing
SUNWdtrp                       DTrace Providers
SUNWgcmn                       gcmn - Common GNU package
SUNWintgige                    Intel(R) PRO/1000 Server Adapter Driver
SUNWipkg-brand                 ipkg brand
SUNWnfsckr                     Network File System (NFS) client kernel support
SUNWos86r                      Platform Support, OS Functionality
SUNWos86r                      Platform Support, OS Functionality
SUNWpsdir                      Platform Support, ISA Bus Device Drivers
SUNWrtls                       REALTEK Fast NIC
SUNWsmbfskr
SUNWswmt
SUNWusb                        USB Device Drivers
SUNWusbs                       USB generic serial module
SUNWxvmpv                      xVM Paravirtualized Drivers
SUNWzfskr                      ZFS Kernel

2. Get list of packages we need to add to zone install time

2a. Get list on packages to be installed in addition to zone to get JeOS like zone template (Wrapped manually)

root@osol-jeos:/usr/lib/brand/ipkg# cat /tmp/iPKGzonesAppPKGs.lst | grep -v " 0$"| sort | awk '{print $1}'| xargs echo
SUNWDTraceToolkit SUNWPython-extra SUNWacc SUNWbeadm SUNWbind SUNWbtool SUNWcar SUNWcfcl SUNWcfpl SUNWckr \
SUNWcpcu SUNWcpp SUNWcurl SUNWexpect SUNWfchba SUNWfmd SUNWfss SUNWftp SUNWgawk SUNWgccruntime SUNWggrp \
SUNWgnu-coreutils SUNWgnu-diffutils SUNWgnu-findutils SUNWgnu-idn SUNWgnu-nano SUNWgnu-which SUNWgnutls SUNWgpch \
SUNWgrub SUNWgsed SUNWgtar SUNWhwdata SUNWidnl SUNWinstall SUNWipc SUNWipf SUNWjss SUNWkey SUNWkvm \
SUNWlang-common SUNWlang-enUS SUNWlibgcrypt SUNWlibgpg-error SUNWlibpopt SUNWlibsmbclient SUNWlibtasn1 SUNWlinks \
SUNWlxsl SUNWman SUNWmdb SUNWmkcd SUNWncft SUNWntp SUNWp7zip SUNWpcre SUNWperl584usr SUNWpkgcmds SUNWpm \
SUNWpng SUNWpostrun SUNWpsdcr SUNWrmodr SUNWrmodu SUNWroute SUNWscreen SUNWsfman SUNWsmagt SUNWsmbfs \
SUNWsndm SUNWsolnm SUNWsprot SUNWstosreg SUNWsudo SUNWter SUNWtexi SUNWtop SUNWtree \
SUNWuiu8 SUNWunzip SUNWwget SUNWwsr2 SUNWxcu4 SUNWzip\'"

2b. There is a limit of ~950 chars on zoneamd install CMD line, see mote at:

13318 zoneadm error ‘Install command line too long’ if extra packages have more then ~950 chars

Lets count how much we will use (Yes, we are on close to limit !!!):

root@osol-jeos:/# cat /tmp/iPKGzonesAppPKGs.lst | grep -v " 0$"| wc -l
84
root@osol-jeos:/usr/lib/brand/ipkg# cat /tmp/iPKGzonesAppPKGs.lst | grep -v " 0$"| sort | awk '{print $1}'| xargs echo  | wc -c
878

3 . Investigate how we can install aditional packages in zone, ideally in zoneadm install time

3a. Zones are installed with SUNWipkg-brand packages

root@osol-jeos:~# pkg info SUNWipkg-brand
Name: SUNWipkg-brand
Summary: ipkg brand
Category: System/Packaging
State: Installed
Publisher: opensolaris.org
Size: 77.14 kB
FMRI: pkg:/SUNWipkg-brand@0.5.11,5.11-0.111:20090508T161021Z

3b. SUNWipkg-brand package deliver this files

root@osol-jeos:~# pkg contents -m SUNWipkg-brand | grep file | awk '{print $8}' |sort
path=etc/zones/SUNWipkg.xml
path=usr/lib/brand/ipkg/attach
path=usr/lib/brand/ipkg/clone
path=usr/lib/brand/ipkg/common.ksh
path=usr/lib/brand/ipkg/config.xml
path=usr/lib/brand/ipkg/detach
path=usr/lib/brand/ipkg/fmri_compare
path=usr/lib/brand/ipkg/pkgcreatezone
path=usr/lib/brand/ipkg/platform.xml
path=usr/lib/brand/ipkg/poststate
path=usr/lib/brand/ipkg/prestate
path=usr/lib/brand/ipkg/query
path=usr/lib/brand/ipkg/uninstall

3c. See how we can specify aditional packages

root@osol-jeos:/usr/lib/brand/ipkg# zoneadm -? | grep "^install"
install [-x nodataset] [brand-specific args]
root@osol-jeos:~# cd /usr/lib/brand/ipkg/
root@osol-jeos:/usr/lib/brand/ipkg# cat config.xml | egrep "\<install"
<install>/usr/lib/brand/ipkg/pkgcreatezone -z %z -R %R</install>
<installopts>a:P:e:c:k:h</installopts>
root@osol-jeos:/usr/lib/brand/ipkg# cat pkgcreatezone | grep extrapkg
m_usage=$(gettext    "$0: [-h] [-P publisher=uri] [-e extrapkg [...]]")
$PKG image-create -f --zone --full -p "$pub_and_url" $secinfo $zoneroot || fail_incomplete "$f_img"
....
$PKG install -q --no-refresh --no-index $entire_fmri || fail_fatal "$f_pkg"
$PKG install -q --no-refresh --no-index SUNWcsd || fail_fatal "$f_pkg"
$PKG install --no-refresh --no-index SUNWcs || fail_fatal "$f_pkg"
pkglist=""
pkglist="$pkglist SUNWcnetr SUNWesu SUNWadmr SUNWadmap SUNWbzip SUNWgzip"
# Workaround: For now, SUNWipkg has no dependency on python, so we supply it.
pkglist="$pkglist SUNWPython SUNWipkg"
# Get some diagnostic tools, truss, dtrace, etc.
pkglist="$pkglist SUNWtoo SUNWdtrc SUNWrcmdc SUNWbip"
# Get at least one sensible shell, and vi
pkglist="$pkglist SUNWbash SUNWvim"
# Get ssh and sshd.
pkglist="$pkglist SUNWsshcu SUNWssh SUNWsshd"
# Get some name services.
pkglist="$pkglist SUNWnis SUNWlldap"
# Get nfs client and autofs; it's a pain not to have them.
pkglist="$pkglist SUNWnfsc SUNWatfs"
# Get man(1) but not the man pages
pkglist="$pkglist SUNWdoc"
# Add in any extra packages requested by the user.
pkglist="$pkglist $extra_packages"
# Do the install; we just refreshed on image-create, so skip that.  We
# also skip indexing here, as that is also what the LiveCD does.
$PKG install --no-index --no-refresh $pkglist || fail_fatal "$f_pkg"

4. Create a JeOS Zone like template

4a. Backup original /usr/lib/brand/ipkg/pkgcreatezone

root@osol-jeos:/# cp /usr/lib/brand/ipkg/pkgcreatezone /usr/lib/brand/ipkg/pkgcreatezone.orig

4b. Create template zone

root@osol-jeos:/# zfs create rpool/zones
root@osol-jeos:/# zfs set mountpoint=/zones rpool/zones
root@osol-jeos:/# zfs create rpool/zones/jeostemplate
root@osol-jeos:/# chmod 0700 /zones/jeostemplate
root@osol-jeos:/# REAL_IF=$(ifconfig -a | grep -v lo0 | grep flags | awk '{print $1}' | sed -e 's/://g' | uniq)
root@osol-jeos:/# echo $REAL_IF
e1000g0
root@osol-jeos:/# dladm show-ether
LINK            PTYPE    STATE    AUTO  SPEED-DUPLEX                    PAUSE
e1000g0         current  up       yes   1G-f                            bi
root@osol-jeos:/# REAL_IF=$(dladm show-ether -o LINK| grep -v LINK)
root@osol-jeos:/# echo $REAL_IF
e1000g0
root@osol-jeos:/# dladm create-vnic -l $REAL_IF vnic0
root@osol-jeos:/# dladm show-vnic
LINK         OVER         SPEED  MACADDRESS           MACADDRTYPE         VID
vnic0        e1000g0      1000   2:8:20:73:77:ce      random              0
root@osol-jeos:/#  zonecfg -z jeostemplate
jeostemplate: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:jeostempalte> create
zonecfg:jeostempalte> set zonepath=/zones/jeostemplate
zonecfg:jeostempalte> set ip-type=exclusive
zonecfg:jeostempalte> add net
zonecfg:jeostempalte:net> set physical=vnic0
zonecfg:jeostempalte:net> end
zonecfg:jeostempalte> exit
root@osol-jeos:/# zoneadm list -cv
ID NAME             STATUS     PATH                           BRAND    IP
0 global           running    /                              native   shared
- jeostemplate     configured /zones/jeostemplate            ipkg     excl

3c. Check first how zone install process looks like

root@osol-jeos:/# zoneadm -z jeostemplate install
A ZFS file system has been created for this zone.
Publisher: Using opensolaris.org (http://pkg.opensolaris.org/release/).
Image: Preparing at /zones/jeostemplate/root.
Sanity Check: Looking for 'entire' incorporation.
Installing: Core System (output follows)
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                  20/20   3021/3021   42.55/42.55
PHASE                                        ACTIONS
Install Phase                              5747/5747
Installing: Additional Packages (output follows)
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                  37/37   5598/5598   32.52/32.52
PHASE                                        ACTIONS
Install Phase                              7329/7329
Note: Man pages can be obtained by installing SUNWman
Postinstall: Copying SMF seed repository ... done.
Postinstall: Applying workarounds.
Done: Installation completed in 625.847 seconds.
root@osol-jeos:/# zfs list | grep jeostemplate | grep zbe
rpool/zones/jeostemplate/ROOT/zbe   336M  5.67G   336M  legacy
root@osol-jeos:/# zoneadm -z jeostemplate uninstall -F

3d. Add debug info to pkgrecate script and install JeOS template zone

root@osol-jeos:/# diff -u /usr/lib/brand/ipkg/pkgcreatezone.orig /usr/lib/brand/ipkg/pkgcreatezone
--- /usr/lib/brand/ipkg/pkgcreatezone.orig      2009-12-11 17:24:57.148141986 +0000
+++ /usr/lib/brand/ipkg/pkgcreatezone   2009-12-11 17:32:56.516050373 +0000
@@ -95,6 +95,8 @@
KEYDIR=/var/pkg/ssl
PKG=/usr/bin/pkg
+printf "\nDEBUG: pkgcreatezone receive this params:\n$*\n\n"
+
#
# Just in case.  This should probably be removed later.
#
@@ -391,6 +393,8 @@
#
pkglist="$pkglist $extra_packages"
+printf "\nDEBUG: This list of packages will be installed:\n$pkglist\n\n"
+
#
# Do the install; we just refreshed on image-create, so skip that.  We
# also skip indexing here, as that is also what the LiveCD does.

Keep in mind: 13318 zoneadm error ‘Install command line too long’ if extra packages have more then ~950 chars

root@osol-jeos:/# zoneadm -z jeostemplate install -e "'\
SUNWDTraceToolkit SUNWPython-extra SUNWacc SUNWbeadm SUNWbind SUNWbtool SUNWcar SUNWcfcl SUNWcfpl SUNWckr \
SUNWcpcu SUNWcpp SUNWcurl SUNWexpect SUNWfchba SUNWfmd SUNWfss SUNWftp SUNWgawk SUNWgccruntime SUNWggrp \
SUNWgnu-coreutils SUNWgnu-diffutils SUNWgnu-findutils SUNWgnu-idn SUNWgnu-nano SUNWgnu-which SUNWgnutls SUNWgpch \
SUNWgrub SUNWgsed SUNWgtar SUNWhwdata SUNWidnl SUNWinstall SUNWipc SUNWipf SUNWjss SUNWkey SUNWkvm \
SUNWlang-common SUNWlang-enUS SUNWlibgcrypt SUNWlibgpg-error SUNWlibpopt SUNWlibsmbclient SUNWlibtasn1 SUNWlinks \
SUNWlxsl SUNWman SUNWmdb SUNWmkcd SUNWncft SUNWntp SUNWp7zip SUNWpcre SUNWperl584usr SUNWpkgcmds SUNWpm \
SUNWpng SUNWpostrun SUNWpsdcr SUNWrmodr SUNWrmodu SUNWroute SUNWscreen SUNWsfman SUNWsmagt SUNWsmbfs \
SUNWsndm SUNWsolnm SUNWsprot SUNWstosreg SUNWsudo SUNWter SUNWtexi SUNWtop SUNWtree \
SUNWuiu8 SUNWunzip SUNWwget SUNWwsr2 SUNWxcu4 SUNWzip\'"
A ZFS file system has been created for this zone.
DEBUG: pkgcreatezone receive this params:
-z jeostemplate -R /zones/jeostemplate -e  SUNWDTraceToolkit SUNWPython-extra SUNWacc SUNWbeadm SUNWbind SUNWbtool SUNWcar
..............................
SUNWsudo SUNWter SUNWtexi SUNWtop SUNWtree SUNWuiu8 SUNWunzip SUNWwget SUNWwsr2 SUNWxcu4 SUNWzip
Publisher: Using opensolaris.org (http://pkg.opensolaris.org/release/).
Image: Preparing at /zones/jeostemplate/root.
Sanity Check: Looking for 'entire' incorporation.
Installing: Core System (output follows)
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                  20/20   3021/3021   42.55/42.55
PHASE                                        ACTIONS
Install Phase                              5747/5747
Installing: Additional Packages (output follows)
DEBUG: This list of packages will be installed:
SUNWcnetr SUNWesu SUNWadmr SUNWadmap SUNWbzip SUNWgzip SUNWPython .... SUNWdoc  SUNWDTraceToolkit SUNWPython-extra
........
SUNWsndm SUNWsolnm SUNWsprot SUNWstosreg SUNWsudo SUNWter SUNWtexi SUNWtop SUNWtree  SUNWuiu8 SUNWunzip SUNWwget SUNWwsr2 SUNWxcu4 SUNWzip
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                120/120 26721/26721 108.73/108.73
PHASE                                        ACTIONS
Install Phase                            32560/32560
Note: Man pages can be obtained by installing SUNWman
Postinstall: Copying SMF seed repository ... done.
Postinstall: Applying workarounds.
Done: Installation completed in 1284.811 seconds.

3e. Another way how to display debug information is to add pipe (tee) to pkg cmd line, this will change output to list mode

root@osol-jeos:/# diff -u /usr/lib/brand/ipkg/pkgcreatezone.orig /usr/lib/brand/ipkg/pkgcreatezone
--- /usr/lib/brand/ipkg/pkgcreatezone.orig      2009-12-11 17:24:57.148141986 +0000
+++ /usr/lib/brand/ipkg/pkgcreatezone   2009-12-11 18:45:48.363802331 +0000
@@ -24,6 +24,9 @@
# Use is subject to license terms.
#
+# Hope pipefail is fixed in KSH version included in OpenSolaris
+set -o pipefail
+
#
# Resetting GZ_IMAGE to something besides slash allows for simplified
# debugging of various global zone image configurations-- simply make
@@ -330,8 +333,8 @@
# arrive.
#
$PKG install -q --no-refresh --no-index $entire_fmri || fail_fatal "$f_pkg"
-$PKG install -q --no-refresh --no-index SUNWcsd || fail_fatal "$f_pkg"
-$PKG install --no-refresh --no-index SUNWcs || fail_fatal "$f_pkg"
+$PKG install -q --no-refresh --no-index SUNWcsd | tee /dev/null || fail_fatal "$f_pkg"
+$PKG install --no-refresh --no-index SUNWcs | tee /dev/null || fail_fatal "$f_pkg"
printf "$m_more\n"
pkglist=""
@@ -395,7 +398,7 @@
# Do the install; we just refreshed on image-create, so skip that.  We
# also skip indexing here, as that is also what the LiveCD does.
#
-$PKG install --no-index --no-refresh $pkglist || fail_fatal "$f_pkg"
+$PKG install --no-index --no-refresh $pkglist | tee /dev/null || fail_fatal "$f_pkg"
printf "\n$m_mannote\n"

Keep in mind: 13318 zoneadm error ‘Install command line too long’ if extra packages have more then ~950 chars

root@osol-jeos:/# zoneadm -z jeostemplate install -e "'\
SUNWDTraceToolkit SUNWPython-extra SUNWacc SUNWbeadm SUNWbind SUNWbtool SUNWcar SUNWcfcl SUNWcfpl SUNWckr \
SUNWcpcu SUNWcpp SUNWcurl SUNWexpect SUNWfchba SUNWfmd SUNWfss SUNWftp SUNWgawk SUNWgccruntime SUNWggrp \
SUNWgnu-coreutils SUNWgnu-diffutils SUNWgnu-findutils SUNWgnu-idn SUNWgnu-nano SUNWgnu-which SUNWgnutls SUNWgpch \
SUNWgrub SUNWgsed SUNWgtar SUNWhwdata SUNWidnl SUNWinstall SUNWipc SUNWipf SUNWjss SUNWkey SUNWkvm \
SUNWlang-common SUNWlang-enUS SUNWlibgcrypt SUNWlibgpg-error SUNWlibpopt SUNWlibsmbclient SUNWlibtasn1 SUNWlinks \
SUNWlxsl SUNWman SUNWmdb SUNWmkcd SUNWncft SUNWntp SUNWp7zip SUNWpcre SUNWperl584usr SUNWpkgcmds SUNWpm \
SUNWpng SUNWpostrun SUNWpsdcr SUNWrmodr SUNWrmodu SUNWroute SUNWscreen SUNWsfman SUNWsmagt SUNWsmbfs \
SUNWsndm SUNWsolnm SUNWsprot SUNWstosreg SUNWsudo SUNWter SUNWtexi SUNWtop SUNWtree \
SUNWuiu8 SUNWunzip SUNWwget SUNWwsr2 SUNWxcu4 SUNWzip\'"
A ZFS file system has been created for this zone.
Publisher: Using opensolaris.org (http://pkg.opensolaris.org/release/).
Image: Preparing at /zones/jeostemplate/root.
Sanity Check: Looking for 'entire' incorporation.
Installing: Core System (output follows)
Download: SUNWcs ...  Done
Download: SUNWcsl ...  Done
Download: SUNWlibsasl ...  Done
Download: SUNWlibms ...  Done
Download: SUNWpr ...  Done
Download: SUNWtls ...  Done
Download: SUNWlxml ...  Done
Download: SUNWzlib ...  Done
Download: SUNWopenssl ...  Done
Download: SUNWpool ...  Done
Download: SUNWckr ...  Done
Download: SUNWzone ...  Done
Download: SUNWzfs ...  Done
Download: SUNWsmapi ...  Done
Download: SUNWtecla ...  Done
Download: SUNWperl584core ...  Done
Download: SUNWmd ...  Done
Download: SUNWinstall-libs ...  Done
Download: SUNWwbsup ...  Done
Download: SUNWpicl ...  Done
Install Phase ...  Done
Installing: Additional Packages (output follows)
Download: SUNWcnetr ...  Done
Download: SUNWesu ...  Done
Download: SUNWadmr ...  Done
Download: SUNWadmap ...  Done
Download: SUNWbzip ...  Done
Download: SUNWgzip ...  Done
Download: SUNWPython ...  Done
Download: SUNWipkg ...  Done
Download: SUNWtoo ...  Done
Download: SUNWdtrc ...  Done
Download: SUNWrcmdc ...  Done
Download: SUNWbip ...  Done
Download: SUNWbash ...  Done
Download: SUNWvim ...  Done
Download: SUNWsshcu ...  Done
Download: SUNWssh ...  Done
Download: SUNWsshd ...  Done
Download: SUNWnis ...  Done
Download: SUNWlldap ...  Done
Download: SUNWnfsc ...  Done
Download: SUNWatfs ...  Done
Download: SUNWdoc ...  Done
Download: SUNWDTraceToolkit ...  Done
Download: SUNWPython-extra ...  Done
Download: SUNWacc ...  Done
Download: SUNWbeadm ...  Done
Download: SUNWbind ...  Done
Download: SUNWbtool ...  Done
Download: SUNWcar ...  Done
Download: SUNWcfcl ...  Done
Download: SUNWcfpl ...  Done
Download: SUNWcpcu ...  Done
Download: SUNWcpp ...  Done
Download: SUNWcurl ...  Done
Download: SUNWexpect ...  Done
Download: SUNWfchba ...  Done
Download: SUNWfmd ...  Done
Download: SUNWfss ...  Done
Download: SUNWftp ...  Done
Download: SUNWgawk ...  Done
Download: SUNWgccruntime ...  Done
Download: SUNWggrp ...  Done
Download: SUNWgnu-coreutils ...  Done
Download: SUNWgnu-diffutils ...  Done
Download: SUNWgnu-findutils ...  Done
Download: SUNWgnu-idn ...  Done
Download: SUNWgnu-nano ...  Done
Download: SUNWgnu-which ...  Done
Download: SUNWgnutls ...  Done
Download: SUNWgpch ...  Done
Download: SUNWgrub ...  Done
Download: SUNWgsed ...  Done
Download: SUNWgtar ...  Done
Download: SUNWhwdata ...  Done
Download: SUNWidnl ...  Done
Download: SUNWinstall ...  Done
Download: SUNWipc ...  Done
Download: SUNWipf ...  Done
Download: SUNWjss ...  Done
Download: SUNWkey ...  Done
Download: SUNWkvm ...  Done
Download: SUNWlang-common ...  Done
Download: SUNWlang-enUS ...  Done
Download: SUNWlibgcrypt ...  Done
Download: SUNWlibgpg-error ...  Done
Download: SUNWlibpopt ...  Done
Download: SUNWlibsmbclient ...  Done
Download: SUNWlibtasn1 ...  Done
Download: SUNWlinks ...  Done
Download: SUNWlxsl ...  Done
Download: SUNWman ...  Done
Download: SUNWmdb ...  Done
Download: SUNWmkcd ...  Done
Download: SUNWncft ...  Done
Download: SUNWntp ...  Done
Download: SUNWp7zip ...  Done
Download: SUNWpcre ...  Done
Download: SUNWperl584usr ...  Done
Download: SUNWpkgcmds ...  Done
Download: SUNWpm ...  Done
Download: SUNWpng ...  Done
Download: SUNWpostrun ...  Done
Download: SUNWpsdcr ...  Done
Download: SUNWrmodr ...  Done
Download: SUNWrmodu ...  Done
Download: SUNWroute ...  Done
Download: SUNWscreen ...  Done
Download: SUNWsfman ...  Done
Download: SUNWsmagt ...  Done
Download: SUNWsmbfs ...  Done
Download: SUNWsndm ...  Done
Download: SUNWsolnm ...  Done
Download: SUNWsprot ...  Done
Download: SUNWstosreg ...  Done
Download: SUNWsudo ...  Done
Download: SUNWter ...  Done
Download: SUNWtexi ...  Done
Download: SUNWtop ...  Done
Download: SUNWtree ...  Done
Download: SUNWuiu8 ...  Done
Download: SUNWunzip ...  Done
Download: SUNWwget ...  Done
Download: SUNWwsr2 ...  Done
Download: SUNWxcu4 ...  Done
Download: SUNWzip ...  Done
Download: SUNWadmlib-sysid ...  Done
Download: SUNWlexpt ...  Done
Download: SUNWxwrtl ...  Done
Download: SUNWTcl ...  Done
Download: SUNWTk ...  Done
Download: SUNWpython-cherrypy ...  Done
Download: SUNWpython-mako ...  Done
Download: SUNWpython-ply ...  Done
Download: SUNWpython-pyopenssl ...  Done
Download: SUNWpython24-simplejson ...  Done
Download: SUNWkrb ...  Done
Download: SUNWgss ...  Done
Download: SUNWloc ...  Done
Download: SUNWlibC ...  Done
Download: SUNWless ...  Done
Install Phase ...  Done
Note: Man pages can be obtained by installing SUNWman
Postinstall: Copying SMF seed repository ... done.
Postinstall: Applying workarounds.
Done: Installation completed in 1310.391 seconds.

Get installed size info fro JeOS zone template

root@osol-jeos:/# zfs list | grep jeostemplate | grep zbe
rpool/zones/jeostemplate/ROOT/zbe   699M  5.31G   699M  legacy

Part 3: Create a JeOS like Sone from pre-prepared JeOS zones template

Get Al’s script for zones, update there your primary network interface and optionally a ROOT password, create a working zones from jeostemplate zone

Automating Zone creation in OpenSolaris 2009.06

Advertisements

1 Comment »

  1. […] JeOS like Zones in OpenSolaris JeOS Prototype […]

    Pingback by OpenSolaris JeOS (Main Page) « Virtual Guru's Blog – Home of Virtualization Workshops — February 7, 2010 @ 3:49 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: