Virtual Guru's Blog – Home of Virtualization Workshops

January 8, 2010

OpenSolaris JeOS Prototype (Part 19: B130 JeOS First Touch – AI installation)

Filed under: jeos, opensolaris, virtualbox, Virtualization — natiku @ 3:19 am

OpenSolaris 1003 Dev B130 JeOS Prototype First Touch (Part Two)

This is a First Touch for JeOS like configuration on dev release targeting OpenSolaris 2010.03 release, this is not a final Prototype
and content of final OpenSolaris 2010.03 JeOS Prototype can change significantly. This instructions are published for development
and testing purposes only. Please, send your feed back, questions and suggestions to jeos-discuss@opensolaris.org

This entry is part of OpenSolaris CLI JeOS workshop

OpenSolaris 1003 Dev B130 JeOS Prototype First Touch (Part Two)
   B130 JeOS Protototype First Touch AI installation
      Create B130 JeOS Prototype First Touch AI manifest
      Install B130 JeOS Prototype First Touch AI manifest with AI on Media
      Evaluate AI installation of B130 JeOS Prototype First Touch
      Generate full pkgs simple list
      Generate full pkgs advanced list
      Evaluate install and distributions costs


B130 JeOS Prototype First Touch AI installation

We will use a AI on Media custom AI manifest installation AI on Media in B130 ,
feature which we prototype during 2009.06 installation with Bootable AI Live-CD

First look at AI documentation for how to write AI manifest AI documentation

Create B130 JeOS Prototype First Touch AI manifest

1. This is a AI Manifest head

cat /tmp/OSOL1003-JeOS-head-130.i386.xml
<!--
CDDL HEADER START
The contents of this file are subject to the terms of the
Common Development and Distribution License (the "License").
You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
or http://www.opensolaris.org/os/licensing.
See the License for the specific language governing permissions
and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each
file and include the License file at usr/src/OPENSOLARIS.LICENSE.
If applicable, add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your own identifying
information: Portions Copyright [yyyy] [name of copyright owner]
CDDL HEADER END
Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
This is sample AI manifest for OSOL 1003 JeOS Prototype First Touch
-->
<ai_criteria_manifest>
<ai_embedded_manifest>
<ai_manifest name="default">
<ai_pkg_repo_default_authority>
<main url="http://pkg.opensolaris.org/dev" authname="opensolaris.org"/>
<mirror url=""/>
</ai_pkg_repo_default_authority>
<ai_install_packages>

2. Create a Manifest body by wrapping packages from lists

cat  /tmp/OSOL1003-JeOS-pkgs-130.i386.lst /tmp/OSOL1003-JeOS-drvs-130.i386.lst| egrep -v "^#"| gawk '{ \
if ($1 !~ /^#/ ) { printf " <pkg name=\"%s\"/> <!-- ", $1;   \
for (i=2;i<=NF;i++) {printf " %s ",$(i)}; print "-->" }; }'  | tee /tmp/OSOL1003-JeOS-pkgs-130.i386.xml

3. This is AI Manifest tail

OSOL user password is justone1, root password is osol1003

cat /tmp/OSOL1003-JeOS-tail-130.i386.xml
</ai_install_packages>
<!-- Put ai_uninstall_packages here, can't be empty ?  -->
<ai_auto_reboot>
false
</ai_auto_reboot>
</ai_manifest>
</ai_embedded_manifest>
<sc_embedded_manifest name = "AI">
<!-- <?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="name">
<service name="ai_properties" version="1" type="service">
<instance name="default" enabled="true">
<property_group name="ai" type="application">
<propval name="username" type="astring" value="osol"/>
<propval name="userpass" type="astring" value="$5$QozYKGdc$40Bo8ychJEaBVvJN5uwAzIwO7xdyuZ2ZH49L6Gd/l3."/>
<propval name="description" type="astring" value="Default user for prototypes"/>
<propval name="rootpass" type="astring" value="$5$pyG8wqj6$0JHrPTDjJ5SxSacljUSTT4zAg.HQ21qxRkrJ3AZM0sD"/>
<propval name="timezone" type="astring" value="UTC"/>
<propval name="hostname" type="astring" value="osol-jeos"/>
</property_group>
</instance>
</service>
</service_bundle>
-->
</sc_embedded_manifest>
</ai_criteria_manifest>

4. Create a final manifest

cat /tmp/OSOL1003-JeOS-head-130.i386.xml /tmp/OSOL1003-JeOS-pkgs-130.i386.xml \
/tmp/OSOL1003-JeOS-tail-130.i386.xml > /tmp/OSOL1003-JeOS-AI-130.i386.xml

5. View resulted manifest

cat  /tmp/OSOL1003-JeOS-AI-130.i386.xml | more

Files are backup here:

Install B130 JeOS Prototype First Touch AI manifest with AI on Media

1. Download OpenSolairs 201003 B130 Dev x86 AI Install CD ISO image (from www.genunix.org)

  1. Use a relative powerfull host with latest VirtualBox (3.1.2) , I use Windows XP 64bit on our Quad-code Virtualization Workstations
  2. Create a OSOL 1003 B130 VM AI test
    1. If you can configure 1GB of RAM
    2. Create a 16GB growable disk on SCSI controler
    3. Attach OpenSolairs 201003 B130 Dev x86 AI Install CD ISO image to IDE secondary controller
  3. Install OSOL 1003 B130 from OpenSolairs 201003 B130 Dev x86 AI Install CD ISO image in Debug mode
    1. Boot into OpenSolairs 201003 B130 Dev x86 AI Install CD ISO image
    2. Select Custom stall (First default menu) and press ‘e’ twice to edit boot cmd line
      Change -B aimanixest=prompt to -B aimanixest=prompt,livessh=enable,install_debug=enable
      Press Enter and b for to boot customized menu
      See: 9. How do I Run Automated Installations in Debug Verbose Mode?
    3. On AI manifest prompt Enter thew URL for the AI manifest [HTTP,default]: type
      http://www.practicaltester.com/store/osoljeos/201003/OSOL1003-JeOS-AI-130.i386.xml
    4. Login with jack/jack
    5. Switch to root
      pfexec su – root
      Password: opensolaris
    6. Monitor installation
      tail -f /tmp/install_log

Note:

  • Installation will take some time, because it will download about 220MB.
  • After reboot AI log will be located on installed system at /var/sadm/system/logs/install_log

Install log is saved here: OSOL1003-JeOS-AI-130.i386.install.log

Reboot into installed system with “init 6″

Hint: During reboot you will see a fancy boot (picture), press Esc to remove it and see real text boot

Log as osol/justone1
Switch to root pfexec su -

Evaluate AI installation of B130 JeOS Prototype First Touch

Generate full pkgs simple list

1. Log into installed JeOS instance from network, so you can copy/paste commands and their outputs

ifconfig -a
e1000g0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2
inet 129.157.xx.xx netmask fffffe00 broadcast 129.157.19.255
ether 8:0:27:ca:48:3f
ssh osol@129.157.xx.xx
The authenticity of host '129.157.19.237 (129.157.x.xx)' can't be established.
RSA key fingerprint is 2d:b1:db:00:a7:1a:c1:b8:22:50:d9:31:a0:84:79:86.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '129.157.xx.xx' (RSA) to the list of known hosts.
Password:
Last login: Fri Jan  8 09:37:50 2010
Sun Microsystems Inc.   SunOS 5.11      snv_130 November 2008
osol@osol-jeos:~$ pfexec su -
pfexec su -
Sun Microsystems Inc.   SunOS 5.11      snv_130 November 2008
root@osol-jeos:~#

Full List is saved as OSOL1003-JeOS-AI-130.i386.fullpkgs.lst

Hint: if you want to see full frmi you can use command

  pkg list -vH | awk '{print $1}' | sort

2. Simple list of all installed packages

pkg list -sH | sort | tee /tmp/pkgs.lst
SUNWDTraceToolkit              SUNWDTraceToolkit
SUNWPython                     The Python interpreter, libraries and utilities
...
consolidation/sic_team/sic_team-incorporation sic_team consolidation incorporation
consolidation/solaris_re/solaris_re-incorporation solaris_re consolidation incorporation
consolidation/sunpro/sunpro-incorporation sunpro consolidation incorporation
consolidation/ub_javavm/ub_javavm-incorporation ub_javavm consolidation incorporation
consolidation/vpanels/vpanels-incorporation vpanels consolidation incorporation
entire                         incorporation to lock all system packages to same build

Generate full pkgs advanced list

2. Getting installed packages install size and download size, ratio, package name , category and description

5775 pkg should provide parseable output access to size and csize

cat >/tmp/sizes.bash << EOF
#!/usr/bin/bash
pkg contents -H -t file,license,set -o "pkg.name,action.raw" \$1 | sed -e "s/variant.arch=i386//g" | sed \
-e "s/[\\":=]/ /g" | gawk 'BEGIN {CSUM=0;SUM=0;DESC="";CAT=""}
{ NAME = \$1; ++FSUM; \
for (i=1;i<NF;i++) if ( \$i ~ /^pkg.csize$/ ) { CSUM += \$(i+1)}
for (i=1;i<NF;i++) if( \$i ~ /^pkg.size$/ ) { SUM += \$(i+1)}
for (i=1;i<NF;i++) if ( \$i ~ /^org.opensolaris.category.2008$/ )  { for (a=(i+1);a<=NF;a++) {CAT = CAT" "\$(a) }} \
for (i=1;i<NF;i++) if ( \$i ~ /^description$/ )  { for (a=(i+2);a<=NF;a++) {DESC = DESC" "\$(a) }} \
}
END { RATIO=((CSUM/(SUM+1))*100);printf "%10d %2d %10d %10d %-30s '%-40s' %s\n", SUM,RATIO,CSUM,FSUM, NAME,CAT,DESC }'
EOF
chmod 0777 /tmp/sizes.bash
pkg  list -H | awk '{print $1}' | xargs  -n 1 /tmp/sizes.bash  | tee /tmp/allsized.lst

After some time I get file /tmp/allsizes.lst , sort them by install size to able find most sized ones:

cat /tmp/allsized.lst | sort -n -r  | tee /tmp/allsizedsorted.lst
49269943 43   21318773        367 SUNWcsl            System/Core                       Core Solaris, (Shared Libs)
45013791 30   13588336       2822 SUNWPython26 Development/Python           The Python interpreter, libraries and utilities
42992536 37   16266710        504 SUNWckr           System/Core                       Core Solaris Kernel
35566933 35   12716620      12779 SUNWman        System/Text Tools              On-Line Manual Pages
32438732 34   11111949       2682 SUNWuiu8         System/Internationalization Iconv modules for UTF-8 Locale
28093293 32    9235899       2066 SUNWPython      Development/Python          The Python interpreter, libraries and utilities
26559704 38   10300197       1625 SUNWcs            System/Core                       Core Solaris
19898860 31    6199449        866 SUNWperl584usr Development/Perl               Perl 5.8.4 (non-core)
18825596 69   13069582        208 SUNWmdb         Development/System          Modular Debugger
16621828 31    5199619        463 SUNWxwplt        System/X11                       X Window System platform software
...

All sizes file is saved as OSOL1003-JeOS-AI-130.i386.fullpkgssizes.lst
and 5775 Add to PKG easy way, so I can see pkg size and compressed size

Evaluate install and distributions costs

What is installed, what disk space is used, how big will be a 7Z and OVF (ZIP) based images ?

1. What is installed

root@osol-jeos:~# zfs list
NAME                     USED  AVAIL  REFER  MOUNTPOINT
rpool                   2.17G  13.5G    80K  /rpool
rpool/ROOT              1.17G  13.5G    21K  legacy
rpool/ROOT/opensolaris  1.17G  13.5G  1.16G  /
rpool/dump               511M  13.5G   511M  -
rpool/export            67.5K  13.5G    22K  /export
rpool/export/home       45.5K  13.5G    22K  /export/home
rpool/export/home/osol  23.5K  13.5G  23.5K  /export/home/osol
rpool/swap               512M  14.0G    16K  -
root@osol-jeos:~# df  -h
Filesystem            Size  Used Avail Use% Mounted on
rpool/ROOT/opensolaris
15G  1.2G   14G   8% /
swap                 1009M  292K 1009M   1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap2.so.1
15G  1.2G   14G   8% /lib/libc.so.1
swap                 1009M   88K 1009M   1% /tmp
swap                 1009M   36K 1009M   1% /var/run
rpool/export           14G   22K   14G   1% /export
rpool/export/home      14G   22K   14G   1% /export/home
rpool/export/home/osol
14G   24K   14G   1% /export/home/osol
rpool                  14G   80K   14G   1% /rpool
/export/home/osol      14G   24K   14G   1% /home/osol

2. Check what we will get if we clean PKG catalog and download caches

root@osol-jeos:~# du -s -h /var/pkg/download/
264M    /var/pkg/download/
root@osol-jeos:~# du -s -h /var/pkg/publisher/opensolaris.org/catalog/
45M     /var/pkg/publisher/opensolaris.org/catalog/
root@osol-jeos:~#

Note: I already file a bug so PKG cache can be on separate FS 6353 PKG must allow to have PKG download cache in Memory (TMP fs)

3. Remove it PKG cache stuff (including ZFS snapshot !!!)

root@osol-jeos:~# rm -r /var/pkg/download/*
root@osol-jeos:~# rm -r /var/pkg/publisher/opensolaris.org/catalog/*
root@osol-jeos:~# zfs list -t all
NAME                             USED  AVAIL  REFER  MOUNTPOINT
rpool                           2.16G  13.5G    80K  /rpool
rpool/ROOT                      1.16G  13.5G    21K  legacy
rpool/ROOT/opensolaris          1.16G  13.5G   884M  /
rpool/ROOT/opensolaris@install   304M      -  1.15G  -
rpool/dump                       511M  13.5G   511M  -
rpool/export                    67.5K  13.5G    22K  /export
rpool/export/home               45.5K  13.5G    22K  /export/home
rpool/export/home/osol          23.5K  13.5G  23.5K  /export/home/osol
rpool/swap                       512M  14.0G    16K  -
root@osol-jeos:~# zfs destroy -R rpool/ROOT/opensolaris@install

4. Check install sizes now

root@osol-jeos:~# zfs list -t all
NAME                     USED  AVAIL  REFER  MOUNTPOINT
rpool                   1.86G  13.8G    80K  /rpool
rpool/ROOT               884M  13.8G    21K  legacy
rpool/ROOT/opensolaris   884M  13.8G   884M  /
rpool/dump               511M  13.8G   511M  -
rpool/export            67.5K  13.8G    22K  /export
rpool/export/home       45.5K  13.8G    22K  /export/home
rpool/export/home/osol  23.5K  13.8G  23.5K  /export/home/osol
rpool/swap               512M  14.3G    16K  -
root@osol-jeos:~# df  -h
Filesystem            Size  Used Avail Use% Mounted on
rpool/ROOT/opensolaris
15G  885M   14G   7% /
swap                  914M  292K  914M   1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap2.so.1
15G  885M   14G   7% /lib/libc.so.1
swap                  914M   88K  914M   1% /tmp
swap                  914M   36K  914M   1% /var/run
rpool/export           14G   22K   14G   1% /export
rpool/export/home      14G   22K   14G   1% /export/home
rpool/export/home/osol
14G   24K   14G   1% /export/home/osol
rpool                  14G   80K   14G   1% /rpool
/export/home/osol      14G   24K   14G   1% /home/osol

5. Check install disk size (Assuming then virtual disk is growable type)

init 0

Install Virtual Disk size is 4676MB, 7Z utra compression crete 571MB file, ZIP best give 981MB file.

Well, this is not a sizes for OS JeOS downloads and pity is then when you will install additional SW , image will mostly grow, due to ZFS copy-on-write feature, see example in Glassfish based VM Template DEMO.

Best way to shrink disk is to use a ZFS send/ZFS receive procedure, similar to one I describe it here 5993 Document procedure how to Srink VDisk with ZFS send/recevie for P2V or V2V .

I will demonstrate simple script for this procedures later in Glassfish based VM Template DEMO.

About these ads

2 Comments »

  1. [...] OpenSolaris 1003 Dev B130 JeOS Prototype First Touch (Part Two) [...]

    Pingback by OpenSolaris JeOS (Main Page) « Virtual Guru's Blog – Home of Virtualization Workshops — February 7, 2010 @ 3:51 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

The Shocking Blue Green Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: