r1 - 30 Apr 2008 - 14:31:08 - BeckyHYou are here: Wiki >  AppLogic23 Web > AdvAPKInstallGuideSolaris
ALERT! AppLogic 2.3 Beta Documentation The latest production release is AppLogic 3.0.30

Installation Guide for Solaris 10 (a.k.a. SunOS 5.10) and OpenSolaris (SunOS 5.11) Distributions

Files

  • apk-ver-solaris.tar.gz - the appliance kit

Compatibility

The apk-*-solaris versions are compatible with the following OS distros:

  • Solaris 10 (tested on 5.10 Generic_120012-14)
  • OpenSolaris (tested on ver 5.11 snv_76)

To install APK you need either:

  • an existing appliance based on Solaris / OpenSolaris
  • a vanilla installation of the OS

Preparing the image

The following steps may vary, depending on how the OS was originally installed. They are not performed by the APK setup script, and are left to the discretion of the operator, because some of them are invasive and may be destructive, if accidentally done on a live system (rather than on the image being prepared) - therefore running them in an automated script may be inadvisable.

Skip any steps that are not appropriate.

  1. remove the network configuration files: rm /etc/hostname.*
  2. make sure that the following GNU utilities are installed: bash, wget, gzip, tar.
  3. un-install any OS services that will not be used

NOTE: After it is cleaned up, the volume may be 'shrunk' to produce a smaller boot volume image for the appliance, however ensure that at least 5-10MB of free space is left, to have space for installing APK, as well as to have some headroom for log files, temporary files, etc.

Installing APK

Have the OS image mounted in your file system. If the image is already installed as a volume on an AppLogic grid, it can be accessed using the 'vol manage' command. Copy the APK files to the /tmp directory on the image itself or to a temporary directory on the host where the image is mounted. If the image is already on a grid, copy the files to the image itself using the Web interface. (If not doing this on a grid: note that the following operations must be done as user 'root'.)

Un-pack the the APK binary archive into the root directory of the image, .e.g:

  cd /mnt/vol
  gtar -zxf tmp/apk-2.0.1-solaris.tar.gz

Installing on an OpenSolaris image prepared for running as a para-virtualized appliance (`uname -i` == i86xpv)

  bash tmp/apk-install pvm

If installing on a Solaris 10 or OpenSolaris image that will be run as a hardware assisted virtual machine (HVM):

  bash tmp/apk-install

If ran with the 'pvm' option and the target image has a para-virtualized kernel present, the script will replace the boot configuration file. The old one will be saved asboot/grub/menu.lst.apksave. If you actually didn't want that (and will run the appliance as HVM) restore the file manually. If there is no para-virtualized kernel present but 'pvm' was specified, the install script will print a warning; the install will not be aborted and the image will still be valid to use as an HVM appliance.

The setup script (and the tar files, if they were copied to the image itself) can be removed now:

  rm tmp/apk-install tmp/apk-*.tar.gz

Un-mount the image and import it to your AppLogic grid (or just close the 'vol manage' shell, if the image was already on your grid and was edited using 'vol manage').

If the image was that of an existing appliance: edit the class (using the GUI editor) and remove the kernel and initrd file names. Set the configuration mode to 'dhcp'.

Customizing Appliance Behavior - Quick Reference

Appliance Init Configuration

If the file /etc/sysconfig/applogic_init is present, the APK init script reads it as a shell include script (with the "." command). The following parameters can be defined in /etc/sysconfig/applogic_init:

APK_AUTH_KEY_PATH location in which to store the appliance SSH access public key. The '3t comp ssh' command connects to appliances using the matching private key. Default is /root/.ssh. If set to an empty string, the key will not be stored anywhere.
If the specified location is an existing file, its owner and permissions will be preserved. Otherwise the file will be created with owner 'root'.
APK_CONFIG_FILES space-separated list of files to which to apply appliance properties. This replaces the config file list specified in the "Edit Class" dialog in the GUI (for appliances that are not using APK). An appliance outfitted with APK will use the APK_CONFIG_FILES list found on the appliance itself, not the list specified in the GUI.

ALERT! Important: if installing APK in an existing appliance - check in the class descriptor (using the editor GUI) for the presence of configuration files in the "Config Files" tab found in the View Class / Edit Class dialog. Transfer the list of files to the APK_CONFIG_FILES setting in the appliance.

ALERT! Important: the /etc/sysconfig/applogic_init file is executed before any configuration data is retrieved or or applied, therefore the script cannot rely on the presence of any of the appliance's configuration files.

Example /etc/sysconfig/applogic_init:

   APK_CONFIG_FILES=/etc/httpd/conf.d/myconfig.conf
   APK_AUTH_KEY_PATH=/root/.ssh/alternate_keys

Appliance Post-start Check

If the file /etc/sysconfig/applogic_appliance is present, the APK "late init" script reads it as a shell include script (with the "." command), after all services on the appliance have been started. The return status from the script indicates whether the appliance is to be considered "started OK" or "failed". If the script prints a message to stderr and returns an error, the last line from this message will be used as the error message sent to the controller.

Example post-start check file, for a Web server appliance - verifies that the server is up and responds to HTTP GET to the home page:

   if ! wget -q -O /dev/null http://localhost/ ; then
      echo "start failed - Web server is not responding" >&2
      return 1
   fi
   return 0

ALERT! Important: some appliances in the system catalog use a customized script located in /appliance to initialize services. This is no longer supported. This directory is deleted when APK is installed, to keep the root directory structure clean and compliant with the Filesystem Hierarchy Standard. One could move the code from such scripts to /etc/sysconfig/applogic_appliance, to emulate the old behavior but this is not the intention of the post-start check file and is not recommended. Instead, an installed service should have its own init script and in general should be able to operate entirely outside of AppLogic.

-- BeckyH - 30 Apr 2008

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