Login | Register
Login | Register

My pages Projects SunSource.net openCollabNet

N1SM Adapter Documentation

Needed components

The N1SM adapter is started by an Hedeby OS Dispatcher component which has to be installed on the N1SM host. The OS Dispatcher will connect to a running OS Provisioner component to report host resources. A Hedeby Resource Provider component will connect to the Provisioner and use and/or re-provision the reported resources. It is recommended to install first the Hedeby Resource Provider which containes the bootstrap installation before installing the OS Dispatcher and N1SM Adapter component.

In order to use the N1SM adapter it is also necessary to have an N1 System Manager 1.3.x running.

Installation

In order to install the Hedeby Dispatcher with a N1SM Adapter on the N1 System Manager host it is necessary to do some preparatory work:

  • The Hedeby shared folder has to be imported from managed servers after provisioning an operating system
  • The N1SM system must be enhanced by some update packages containing the Hedeby Software and the correct java version
  • The Hedeby OS Dispatcher component has to be installed on the N1 System Manager host and an additional Hedeby user has to be created
  • Possible operating systems for the resources have to be defined
  • Reprovisioning options must be defined for every resource
  • Base Management options (used to install the update packages) have to be defined for every resource
  • Resource and operating system properties have to be specified

Preparatory work on the N1 System Manager side

Create or Modify OS profiles

  • The OS profiles used for provisioning an operating system with the N1SH "load server" command must be enhanced to mount the Hedeby shared folder filesystem. Each N1SM Managed host must have the Hedeby shared  folder mounted to the same location.

    Mounting filesystems after provisioning can be done via post install scripts. A possible install script may contain one of following lines:

    # adding mount of GE shared directory for a solaris profile
    echo "hostfoo:/hedeby/GE/sharedFolder - /hedeby/GE/sharedFolder nfs - yes rw" >> /a/etc/vfstab
    mkdir -p /a/hedeby/GE/sharedFolder

    # adding mount of GE shared directory for a linux profile
    echo "hostfoo:/hedeby/GE/sharedFolder /hedeby/GE/sharedFolder nfs defaults 0 0" >> /etc/fstab
    mkdir -p /hedeby/GE/sharedFolder
    /usr/lib/lsb/install_initd --add netfs

  • Each managed host has to be visible and resolveable on the public network interface since the Hedeby Executor must be detectable from the Hedeby Service Containers and their Service Adapters.

  • Hedeby is creating certificates on the N1SM manager host. The managed hosts must have the correct system time, because otherwise there might be problems with the certificate creation time. It's recommented to install a time synchronization software on the managed hosts.

Please follow the instructions from the "Sun N1 System Manager Operating System Provisioning Guide" to create or modify OS Profiles.

Create a N1 System Manager user acount for the Hedeby Adapter

The Hedeby user acount which is starting the OS Dispatcher component has to be added to the N1 System Manager user list
with the privilegs to reprovision resources. In order to add users or modify user roles for the N1 System Manager system you have to start an N1SH shell and switch to the "SecurityAdmin" role. The following command sequence can be used to add a new user with "Admin" rights:

N1-ok> set session role SecurityAdmin
N1-ok> create user hedeby role Admin

Please follow the instructions from the "Sun N1 System Manager Discovery and Administration Guide" for managing users and roles.

Ensure that managed servers support the basemanagement feature

All managed servers should support the basemanagement feature which is used to install update packages after reprovisioning the operating system. A typical N1SH command to enable the basemanagement feature is may look as follows:

N1-ok> add server 10.11.245.181 feature=basemanagement agentip=192.168.1.181 agentssh=?
The question mark idicates that a user name and a credential has to be provided (SSH password) in
order to install the basemanagement software on the managed host.

NOTE: If a managed server doesn't support the basemanagement feature the N1SM osprofile post install script must be enhanced to copy the JRE and Hedeby software to the reprovisioned host after reprovisioning. Additionally the post install script must also start the install script for the Hedeby Executor component and start the Hedeby Executor.

Please follow the instructions from the "Sun N1 System Manager Discovery and Administration Guide - Adding and Upgrading Base Management and Os Monitoring Features" for getting more information about the basemanagement feature.

Create update JRE packages for the Hedeby software

The Hedeby Executor component needs at least Java Runtime Environment 1.5.x. This version has to be available on the managed
hosts after reprovisioning. It is possible to specify update names in the Hedeby N1SM adapter configuration which should be installed
after reprovisioning. These updates have to be installed on the N1 System Manager.

If an operating system already supports JRE 1.5.x per default the creation of the update is not necessary.

Please follow the instructions from the "Sun N1 System Manager Operating System Provisioning Guide - Managing Packages, Patches and RPMs" for getting more information about update packages.

Create update packages for the Hedeby Executor software

After installing the OS Dispatcher and N1SM adpater component on the N1 System manager host there is a utility script in the Hedeby install sub directory "grm_util/n1sm/n1smUpdatePackageCreation.sh". This script is used to create N1SM update packages containing the Hedeby Executor software. This update
packages are added to the N1 System manager updates.

Installation of the Hedeby N1SM adapter and OS Dispatcher

Perform the following steps to perform the Hedeby N1SM adapter installation. After installation you can test the installation by checking some command line options which are described in the examples section.

  1. Copy the Hedeby source code to a local install directory your N1 System manager host:
    [root@hostfoo ~]# cd /hedeby/GE/ht65_inst/
    [root@hostfoo ~]# ls
    bin grm_util hedeby.class inst_grm.bat inst_grm.sh lib man

    The used install directory will also be used for the managed N1SM hosts when the Hedeby update packages are installed. Each N1SM Managed host will have the same local Hedeby install folder location.

  2. Be sure to use a java runtime environment version > 1.5.x and set your JAVA_HOME and PATH environment correctly:
    [root@hostfoo ~]# which java
    /hedeby/J2SE/jdk1.5.0_07/bin/java
    [root@hostfoo ~]# echo $JAVA_HOME
    /hedeby/J2SE/jdk1.5.0_07

  3. Start the installation as user root using java system preferences  to store  the settings:
    [root@hostfoo ~]# ./inst_grm.sh -system
  4. Perform the bootstrap installation and select the OsDispatcher component. When asked for the N1SM Adapter configuration you have the option to create a empty adapter configuration or to use an already existing one. The installation does not support a graphical user interface for the N1SM adapter configuration. Have a look at the configuration section to get a detailed description of the Hedeby N1SM adapter configuration file.



Configuration

This section is describing the Hedeby N1SM Adapter configuration file options which is used for defining operating system properties, hardware properties, reprovisioning options and basemanagement options for every resource that should be provided to the Hedeby Resource Provider in order to be assigned to Service Containers and their services.

This is done by specifying two operating systems ("Red Hat Enterprise Linux ES release 3 (Taroon Update 6)" and "Solaris 10 3/05 HW1 s10x_wos_74L2a X86") which can be used on two resources (dt218-14 and dt218-15). The example configuration is stored in XML format and is described in the following paragraph. The table below shows the network configuration of the two hosts:

Public resolveable hostname

dt218-14

dt218-15

Management interface IP (Standard name of the server in N1SM)

10.11.245.179

10.11.245.181

Public interface IP

10.11.245.180

10.11.245.182

Provisioning interface IP

172.1.1.179

172.1.1.181

Configuration file name and file location

The Hedeby N1SM adapter configuration is stored in an XML file which always have the name config.xml and is stored in the shared Hedeby configuration sub folder in the configuration directory for the OS Distributor component:

[root@hostfoo ht65]# ls -la config/osd_n1sm/n1smAdapter/config.xml 
-rw-r--r-- 1 root root 5305 Nov 8 04:46 config/osd_n1sm/n1smAdapter/config.xml

Global definitions

Configuration tag name

Description

Identifier

Specifies the name of the configuration. It is the name of the directory where the config.xml file is stored

n1shPath

Specifies the full path to the n1sh shell executeable. This shell is used for submitting commands to the N1 System Manager.

expectPath

Specifies the full path to the expect shell executable. Expect commands are used to setup n1sh commands which have to be started interactively. The expect application is part of the N1 System Manager installation. 

enableN1smSimulation

If this value is set to "true" the N1SM adapter will report resources without N1SM at all. Of course there is no "real" provisioning possible. This configuration tag is only useful for debugging.

<config name="n1smAdapter">
<config name="Identifier">n1smAdapter</config>
<config name="n1shPath">/opt/sun/n1gc/bin/n1sh</config>
<config name="expectPath">/usr/bin/expect</config>
...
</config>


Operating system specifications


Configuration tag name

Description

operatingSystemProperties

This section is used to descibe the operating systems which can be used for reprovisioning on resources. Each subsection defines a operating system name and its attributes. Each operating system section has to set the following listed properties:

  • operatingSystemName:
    The general name of the operating system

  • operatingSystemRelease:
    The release number of the operating system

  • operatingSystemPatchlevel:
    The patchlevel description of the operating system

  • operatingSystemVendor:
    The general vendor name of the operating system

Additional user defined properties are supported.


<config name="n1smAdapter">
...
<config name="operatingSystemProperties">
<config name="rhel3u6-es">
<config name="operatingSystemName">linux</config>
<config name="operatingSystemRelease">3</config>
<config name="operatingSystemPatchlevel">u6</config>
<config name="operatingSystemVendor">Red Hat</config>
</config>
<config name="solaris10hw1x86_final">
<config name="operatingSystemName">solaris</config>
<config name="operatingSystemRelease">10</config>
<config name="operatingSystemPatchlevel">hw1</config>
<config name="operatingSystemVendor">Sun Microsystems</config>
</config>
</config>
...
</config>


Resource definitions


Configuration tag name

Description

resourceProperties

This section is used to descibe the host resources. Each subsection defines one resource. The resource name specified by

<config name="dt218-14">

must match the public resolveable hostname of the resource.


<config name="n1smAdapter">
...
<config name="resourceProperties">
<config name="dt218-14">
...
</config>
<config name="dt218-15">
...
</config>
</config>
...
</config>

Hardware specifications


Resource configuration tag name

Description

<config name="HOSTNAME">

This section is used to descibe the hardware properties for the resource. Each subsection defines a hardware property name and its value. Each resource specific section has to set the following listed properties:

  • hardwareCpuCount:
    The number of CPUs on the host resource

  • hardwareCpuArchitecture:
    The CPU architecture identifier

  • hardwareCpuFrequency:
    The CPU frequency

Additional user defined properties are supported.



<config name="n1smAdapter">
...
<config name="resourceProperties">
<config name="dt218-14">
<config name="hardwareCpuCount">1</config>
<config name="hardwareCpuArchitecture">x86</config>
<config name="hardwareCpuFrequency">1000</config>
...
</config>
...
</config>
...
</config>

List of supported operating systems


Resource configuration tag name

Description

provisionableOperatingSystems

Used to define a supported operating system for the resource (In the example the host resource "dt218-15" supports the operating systems "rhel3u6-es" and "solaris10hw1x86".).

NOTE: The operating system names have to be defined in the "operatingSystemProperties" section.


<config name="n1smAdapter">
...
<config name="resourceProperties">
<config name="dt218-14">
...
<config name="provisionableOperatingSystems">
<config name="operatingSystemCandidate">rhel3u6-es</config>
<config name="operatingSystemCandidate">solaris10hw1x86_final</config>
</config>
...
</config>
...
</config>
...
</config>

N1SM command parameter specification


Resource configuration tag name

Description

n1smCommandParameters

This section is used to define the command line parameters for the N1SM "load server" command. All supported command line options (e.g. networktype=static) must be provided for each operating system. It is possible to define global parameters which are added for every operating system.

<config name="n1smAdapter">
...
<config name="resourceProperties">
<config name="dt218-14">
...
<config name="n1smCommandParameters">
...
</config>
...
</config>
...
</config>
...
</config>


N1SM server name

N1SM command configuration tag name in the resource configuration section

Description

server name

If the N1SM server name (normally the ip address of the management interface) differs from the real resolveable hostname it is necessary to specify the N1SM server name with this property.

<config name="n1smAdapter">
...
<config name="resourceProperties">
<config name="dt218-14">
...
<config name="n1smCommandParameters">
<config name="server name">10.11.245.181</config>
...
</config>
...
</config>
...
</config>
...
</config>


N1SM load server parameters

N1SM command configuration tag name in the resource configuration section

Description

provisioningParameters

It is necessary to specify the load server parameters for each operating system. The following identifiers are used to define the load server parameters.

global

The paramters set in this section are used for every operating system when the server is provisioned.

<config name="OPERATING_SYSTEM_NAME">

By using this tag it is possible to define load server parameters for the specified operating system.
enableBasemanagement

If "enableBasemanagement" value is set to false the basemanagement feature is not installed after provisioning an operating system. This also means, that no software packages are installed. This option can be used to provide the possibility to the n1sm admin to setup it's own software install scripting framework.

The global and the operating system specific sections allow to set this parameter.

Example:

If the resource "dt218-15" should be reprovisioned to the operating system "rhel3u6-es" the N1SM adapter would perform the following load server command:

load server 10.11.245.181 osprofile rhel3u6-es 
bootip=172.1.1.181 networktype=static
 gateway=10.11.245.1 ip=172.1.1.181
 netmask=255.255.255.0 bootnetworkdevice=eth1
 hostname=dt218-15 networkdevice=eth1

<config name="n1smAdapter">
...
<config name="resourceProperties">
<config name="dt218-14">
...
<config name="n1smCommandParameters">
...
<config name="provisioningParameters">
<config name="global">
<config name="networktype">static</config>
<config name="gateway">10.11.245.1</config>
<config name="netmask">255.255.255.0</config>
<config name="ip">172.1.1.181</config>
</config>
<config name="rhel3u6-es">
<config name="hostname">dt218-15</config>
<config name="bootip">172.1.1.181</config>
<config name="networkdevice">eth1</config>
<config name="bootnetworkdevice">eth1</config>
</config>
<config name="solaris10hw1x86_final">
<config name="networkdevice">bge1</config>
<config name="bootnetworkdevice">bge1</config>
</config>
</config>
...
</config>
...
</config>
...
</config>
...
</config>



N1SM basemanagement parameters

N1SM command configuration tag name in the resource configuration section

Description

basemanagementParameters

After reprovisioning the operating system the N1SM adapter will start the N1SM basemanagement on the newly provisioned resource. In order to enable this feature the parameters "agentip" and "agentssh" has to be defined for the N1SM "add server" command.

Since the "agentssh" command value is a credential the N1SM adapter expects the name of a password file ("dt218-15.agentssh"). The password file must be stored in the local GRM var/spool/N1smAdapter/passwords directory of the N1SM adapter component on the N1SM host.

It contains the username and the password for the ssh login.

Example:

After reprovision of resource "dt218-15" the following add server command will be executed by the N1SM adapter (The USER/PASSWORD string is taken from the password file "dt218-15.agentssh"):

add server 10.11.245.181 feature=basemanagement agentip=172.1.1.181 agentssh=USER/PASSWORD

<config name="n1smAdapter">
...
<config name="resourceProperties">
<config name="dt218-14">
...
<config name="n1smCommandParameters">
...
<config name="basemanagementParameters">
<config name="agentip">172.1.1.181</config>
<config name="agentssh">dt218-15.agentssh</config>
</config>
</config>
...
</config>
...
</config>
...
</config>


List of needed update packages


Configuration tag name

Description

n1smLoadUpdateListProperties

This section is used to define which software updates have to be installed after reprovisioning and basemanagement adding on a N1SM managed host resource. It is possible to define a standard update list or to overwrite the update list for a specific operating system.

The updates are loaded in the specified order which is defined by the name of the tag.

The example below has an empty standard update list (first "updateList" section). This means no updates are loaded to the resources after reprovisioning. The global (standard) update list can be overwritten by defining a subsection with the name of the operating system. If the operating system section defines a new "updateList" section the global one is ignored when the specified operating system is provisioned. 

When the operating system "hel3u6-es" is reprovisioned on the resource "dt218-15" the following N1SM commands in the written order are started in the N1SH shell.

load server 10.11.245.181 update jre_15008_linux_i586

and

load server 10.11.245.181 update linux_rh_es3

The first update is used to install a java runtime environement which is supported by the GRM system. The second update contains the GRM software for starting an GRM executor on the managed N1SM host resource.


<config name="n1smAdapter">
...
<config name="n1smLoadUpdateListProperties">
<config name="updateList">
</config>
<config name="rhel3u6-es">
<config name="updateList">
<config name="1">jre_15008_linux_i586</config>
<config name="2">grm_linux</config>
</config>
</config>
<config name="solaris10hw1x86_final">
<config name="updateList">
<config name="1">sol_amd64_jre_15_009</config>
<config name="2">grm_solaris</config>
</config>
</config>
</config>
</config>


Examples

This section should give a short overview how the Hedeby N1SM Adapter is integrated into the Hedeby command line interface. The examples using a hedeby system with a running resource provider, OS Provisioner, OS Dispatcher with a N1SM adapter with the configuration described in the  configuration section. The gconf commands are started under the Hedeby administrator user account.

Show resource list

The gconf command can be used to show all reported resources:

[hedeby@dt218-145 bin]$ gconf show_resources
Registered resources:
<NONE>
Unassigned resources:
host dt218-14 (ok)
host dt218-15 (ok)

There are two resources available: dt218-14 and dt218-15

Show resource properties of a resource

The gconf command can be used to show the resource properties of a resource:


[hedeby@dt218-145 bin]$ gconf show_resource dt218-14
Resource ID: dt218-14
Type: host
State: unassigned
Annotation: NONE
Properties:
hardwareCpuFrequency => 1000
hardwareCpuArchitecture => x86
hardwareCpuCount => 1
operatingSystemName => linux
operatingSystemVendor => Red Hat
operatingSystemRelease => 3
resourceHostname => dt218-14
operatingSystemPatchlevel => u6
resourceIPAddress => 10.11.245.180

The output shows the resource properties of the resource dt218-14 which is currently running a Red Hat linux system.

Show possible resource properties

The gconf command can be used to show all possible resource properties which can be achived by reprovisioning the resource:

[hedeby@dt218-145 bin]$ gconf show_os_options dt218-14
Reprovisionable resource properties:

Option 0
hardwareCpuFrequency => 1000
hardwareCpuArchitecture => x86
hardwareCpuCount => 1
operatingSystemVendor => Red Hat
operatingSystemName => linux
operatingSystemRelease => 3
resourceHostname => dt218-14
operatingSystemPatchlevel => u6
resourceIPAddress => 10.11.245.180

Option 1
hardwareCpuFrequency => 1000
hardwareCpuArchitecture => x86
hardwareCpuCount => 1
operatingSystemVendor => Sun Microsystems
operatingSystemName => solaris
operatingSystemRelease => 10
resourceHostname => dt218-14
operatingSystemPatchlevel => hw1
resourceIPAddress => 10.11.245.180

The output shows all possible resource properties set which can be provisioned to the resource dt218-14.

Reprovision a resource to match specified properties

The gconf command can be used to reprovision a resource by specifying the desired resource properties:

[hedeby@dt218-145 bin]$ gconf reprovision -r dt218-15 operatingSystemName=solaris
A request to reprovision the selected resource has been submitted

After the reprovisioning the following resource attributes should be reported:

[hedeby@dt218-145 bin]$ gconf show_resource dt218-14
Resource ID: dt218-14
Type: host
State: unassigned
Annotation: NONE
Properties:
hardwareCpuFrequency => 1000
hardwareCpuArchitecture => x86
hardwareCpuCount => 1
operatingSystemVendor => Sun Microsystems
operatingSystemName => solaris
operatingSystemRelease => 10
resourceHostname => dt218-14
operatingSystemPatchlevel => hw1
resourceIPAddress => 10.11.245.180