r17 - 24 Sep 2008 - 10:26:10 - StephenQYou are here: Wiki >  AppLogic24 Web > CatGenericOsolCid
ALERT! AppLogic 2.4 Documentation The latest production release is AppLogic 3.0.30

OSOL64 - Solaris Server based on OpenSolaris build 2008.05 - Implementation Design

Base Class

The Solaris Server is based on OpenSolaris build 2008.05. It is created from an image of the OpenSolaris install dvd.

Class Volume

The Solaris Server has a single volume:

  • boot volume: 3 GB, mounted as "/", read-write

Packages

None.

Contents of the release directory

Exported appliance image

  • osol64-1.0.0-1.tar.bz2

Appliance sources

  • osol64-1.0.0-1-src.tar.bz2: tar of all the files used to recreate the appliance

Tests

  • osol64-tst-app.tar.bz2: test harness

Re-install Procedure

Here are the steps to create an OSOL64 appliance on an AppLogic grid (ALERT!This requires maintainer access to the grid):

Preparation

  • Copy and uncompress osol64-1.0.0-1-src.tar.bz2 on the impex volume of the grid controller. The archive extracts its contents into the directory work_OSOL64.
  • Include the current Solaris APK in this directory. Edit the file setenv.sh to use current version settings.
  • On dom0 of srv1 create a directory /var/applogic/osol64_build. From /vol/_impex/work_OSOL64 on the controller, scp the archive osol64_dom0.tar.gz to this directory and unpack it. The archive contains configuration files for xm create.
  • Download os.200805.iso from http://www.opensolaris.org to the impex volume, and then push it using scp to the dom0 working directory.

Create an installed ZFS image

On dom0, in /var/applogic/osol64_build:

  • Get the kernel and ramdisk used to boot the cd image onto the local filesystem:
    • mkdir tmp
    • mount -o loop os200805.iso tmp
    • cp tmp/platform/i86xpv/kernel/amd64/unix .
    • cp tmp/boot/x86.microoot .
    • umount tmp
    • rmdir tmp
  • dd if=/dev/zero of=disk-image bs=1k seek=3071k count=1k
  • losetup /dev/loop0 disk-image
  • xm create -c osol-2008.05-install
  • patch the kernel at the kmdb prompt:
                     Welcome to kmdb
                     Loaded modules: [ unix krtld genunix ]
                     [0]> gnttab_init+0xce/W 403
                     gnttab_init+0xce: 0x3 = 0x403
                     [0]> :c
    
  • Login as user jack with password jack and start a vnc server:
    • mkdir .vnc;cp .Xclients .vnc/xstartup
    • vncserver
  • Use ifconfig xnf0 to get the IP address of the VM and point a vnc client at IP:5901. (you can obtain TightVNC viewer at http://www.tightvnc.com/)
  • Perform the install. Set a root password. Do not create an additional user. Do NOT reboot. Open a root terminal session and make the kernel patch on the installed image:
                     # mdb -w /a/platform/i86xpv/kernel/amd64/unix
                     > gnttab_init+0xce?W 403
                     unix`gnttab_init+0xce: 0x403 = 0x403
                     > $q
    
  • Copy the patched kernel and ramdisk to a remote location:
                     /usr/bin/scp -S /usr/bin/ssh /a/platform/i86xpv/kernel/amd64/unix REMOTE-IP:/unix-patched-amd64-osol.2008.05
                     /usr/bin/scp -S /usr/bin/ssh /a/platform/i86pc/amd64/boot_archive REMOTE-IP:/boot_archive-amd64-osol.2008.05
    
  • Use scp to pull these files to the grid controller and then push them to the dom0 working directory.
  • In the VM console shutdown -y -i0 -g0

Create a UFS image from the ZFS image

On dom0, in /var/applogic/osol64_build:

  • dd if=/dev/zero of=disk-image-osol64 bs=1k seek=3071k count=1k
  • losetup /dev/loop1 disk-image-osol64
  • xm create -c osol-2008.05-copy
  • Login as root and perform the following:
    • TERM=xterm
    • export TERM
    • tput reset
    • echo 'set xnf:xnf_cksum_offload = 0' >>/etc/system
    • svcadm disable svc:/network/physical:nwam
    • svcadm enable svc:/network/physical:default
    • cp /etc/nsswitch.dns /etc/nsswitch.conf
    • edit /etc/ssh/sshd_config and set PermitRootLogin yes (use: :%s/PermitRootLogin no/PermitRootLogin yes/g)
    • /lib/svc/method/sshd resart
    • scp ufs-create-image.sh from /vol/_impex/work_OSOL64 on the controller to / on the running ZFS VM and execute it. This script performs the following operations:
      • create a UFS volume on c4d1s0 and mount it on /ufs
      • copy the root filesystem, /devices and /dev to /ufs
      • fix the device names on /ufs
      • create additional needed directories in /ufs
    • Edit /ufs/etc/vfstab and replace the existing entries for / and /tmp with:
                       /dev/dsk/c0d0s0 /dev/rdsk/c0d0s0        /          ufs       1       no      noatime
                       swap        -        /tmp        tmpfs        -        yes     
      
    • bootadm update-archive -R /ufs
    • shutdown -y -g0 -i0

Modify the UFS image in Preparation for Making the Appliance

On dom0, in /var/applogic/osol64_build, boot the newly created UFS image

  • xm create -c osol-2008.05-ufs-pygrub-run

In /vol/_impex/work_OSOL64 on the controller execute ./ufs-modify.sh IP where IP is the IP address of the running VM. This script performs the following operations:

  • install the Solaris APK, expect and gcc
  • disable unnecessary services

Check the log file ufs-modify.log in case of any failure.

In the VM console, shutdown -y -g0 -i0.

Turn the UFS image into an OSOL64 Appliance

Use scp to pull the prepared image disk-image-osol64 from dom0 to /vol/_impex/work_OSOL64/ on the controller.

In /vol/_impex/work_OSOL64/, execute the script appliance-create.sh, which performs the following:

  • rename and gzip the prepared image
  • generate appropriate descriptor files
  • create the release tar osol64-1.0.0-1.tar.bz2 under /vol/_impex

Check the log file appliance-create.log in case of any failure.

Theory of Operation

None.

Configuration

None.

External network setup

None

Log Files

All logging services are enabled per the original install and log rotation occurs according to the default entries in /etc/logadm.conf

Important Notes

None

-- StephenQ - 18 Mar 2008

 
Copyright © CA 2005-2011. All Rights Reserved.
%