Pegasus Enhancement Proposal (PEP)

PEP#: 350 

PEP Type: Functional

Title: Multi CIMOM support on same OS

Status:  Approved

 Version History:

Version Date Author Change Description
0.1 30/Oct/2009 Surendra Kodali/
Venkat Puvvada
Initial Submission
 1.0  13/Nov/2009 Venkat Puvvada   Review comments incorporated/ Ballot version

 


Abstract: Add Support for OpenPegasus to run as multiple instances on the same Operating System.



Definition of the Problem

In some environments multiple CIMServers may be required to run on same OS.  A valid usecase is where vendor may want to ship providers  with  scaled down version of CIMServer without disturbing the other CIMOMs running on same OS. Currently multiple instances of Pegasus cannot be run on same OS because of dependency on the startup config files location and localdomain socket path at build time.

The below config files/local domain socket are created in /var/tmp directory on Linux, /tmp directory on other UNIX type platforms in non-release builds (PEGASUS_USE_RELEASE_DIRS=false) and should be known at compile time at present. For release builds each platform has its own configuration directory structure.

cimserver_start.lock - startup lock file
cimserver_start.conf - PID file
cimxml.socket - Local domain socket

In addition to the above config files the following problems are identified

1. Log identity of different CIMServers running
2. SLP Advertisements of each CIMServer
3. PAM Configuration file.

With the problems mentioned above, single Pegasus image cannot be configured  to run as multiple instances. Pegasus RPM package cannot be installed using runtime relocations (using --prefix option) because of above limitations.

Proposed Solution

A new Pegasus build time option PEGASUS_FLAVOR is proposed for building the different Pegasus flavors. This flavor is used in naming the following.

  1. Configuration directories in release builds
  2. Config file/local domain socket names (cimserver_start.lock, cimserver_start.conf and cimxml.socket) in non-release builds
  3. Log identity of the executables
  4. PAM configuration file.
  5. RPM name.

All other config file names and dirs will remain unchanged.
There will be no change to the current release directory structure/config file names if PEGASUS_FLAVOR is not set explicitly.

SLP provides a way to distinguish between multiple CIMServers running on same OS through "Service-hi-name" attribute which is equivalent to the CIM_ObjectManager.ElementName in SLP template. 

Configuration Parameters httpPort and httpsPort will not be fixed/hidden in release builds when PEGASUS_FLAVOR is set. All Man pages, documents, include files are copied to the PEGASUS_PROD_DIR(see below) in RPM Build.


Default value of PEGASUS_FLAVOR is "tog". By default RPM name is tog-pegasus, release directory structure and config file names remains same.

For Windows platforms no special mechanism will be provided to run as different services as part of this PEP.

1. Non-release builds (If PEGASUS_USE_RELEASE_DIRS=false, ) 2. Release builds (If PEGASUS_USE_RELEASE_DIRS=true, PEGASUS_OVERRIDE_DEFAULT_RELEASE_DIRS=true)
If user explicitly overwrites the default release dirs when PEGASUS_FLAVOR is set, it is expected that they will not conflict with other Pegasus images running on the same OS.

For Multi CIMOM support using RPM build, RPM spec file can be generated using the create_OpenPegasusRPMSpec target in Makefile.Release after setting the PEGASUS_FLAVOR env variable. Note that RPM Build on Linux uses PEGASUS_OVERRIDE_DEFAULT_RELEASE_DIRS option. The following code changes will be placed in env_var_{OS}.status file.

ifeq ($(PEGASUS_FLAVOR), tog)

    PEGASUS_PROD_DIR = /usr
    PEGASUS_DOC_DIR = /usr/share/doc/tog-pegasus-{version}
    PEGASUS_MAN_DIR = /usr/share/man
    PEGASUS_PRODSHARE_DIR = /usr/share/Pegasus
    PEGASUS_VARDATA_DIR = /var/lib/Pegasus
    PEGASUS_CONFIG_DIR = /etc/Pegasus
    PEGASUS_VARRUN_DIR = /var/run/tog-pegasus
    PAM_CONFIG_DIR=/etc/pam.d
    PAM_CONFIG_FILE=wbem
    PEGASUS_INCLUDE_DIR = /usr/include
else
    PEGASUS_PROD_DIR = /usr/local/$(PEGASUS_FLAVOR)-pegasus
    PEGASUS_DOC_DIR = $(PEGASUS_PROD_DIR)/share/doc/$(PEGASUS_FLAVOR)-pegasus-{version}
    PEGASUS_MAN_DIR = $(PEGASUS_PROD_DIR)/share/man
    PEGASUS_PRODSHARE_DIR = $(PEGASUS_PROD_DIR)/share/Pegasus
    PEGASUS_VARDATA_DIR = $(PEGASUS_PROD_DIR)/var/Pegasus
    PEGASUS_CONFIG_DIR = $(PEGASUS_PROD_DIR)/etc/Pegasus
    PAM_CONFIG_DIR=/etc/pam.d
    PAM_CONFIG_FILE=wbem$(PEGASUS_FLAVOR)
    PEGASUS_VARRUN_DIR = $(PEGASUS_PROD_DIR)/var/run/$(PEGASUS_FLAVOR)-pegasus
    PEGASUS_INCLUDE_DIR = $(PEGASUS_PROD_DIR)/include

endif  

/etc/pam.d/wbem           ====>  Pam authentication file
/etc/init.d /tog-pegasus  ====>  Pegasus service file
/etc/Pegasus                  ====> config files
/usr/bin                          ====>  cimmof  cimmofl  cimprovider  cimsub osinfo wbemexec
/usr/sbin                        ====>  cimauth cimconfig cimserver cimprovagt cimservera cimreparchive  cimtrust  repupgrade
/usr/lib                           ====>  All libraries (includes providers and provider managers)
/var/lib/Pegasus             ====> repository, log and trace
/var/run/tog-pegasus     ====> cimserver run info
/usr/share                     ====> mof, doc and man pages
/usr/include                   ====> Include files

After setting flavor(other than "tog").

The product will moved to the /usr/local except the tog-pegasus service and pam config file.
 
/etc/pam.d/wbem$(Flavor)                                                        ====> Pam authentication file
/etc/init.d /$(Flavor}-pegasus                                                   ====> Pegasus service file
/usr/local/$(Flavor)-Pegasus/etc/Pegasus                                ====> config files
/usr/local/$(Flavor)-Pegasus/bin                                              ====>  cimmof  cimmofl  cimprovider  cimsub  osinfo  wbemexec
/usr/local/$(Flavor)-Pegasus/sbin                                            ====>  cimauth cimconfig cimserver  cimprovagt  cimservera cimreparchive cimtrust  repupgrade
/usr/local/$(Flavor)-Pegasus/lib                                               ====>  libraries
/usr/local/$(Flavor)-Pegasus/var/lib/Pegasus                           ====>  repository, log and trace
/usr/local/$(Flavor)-Pegasus/var/run/
$(Flavor)-Pegasus        ====> cimserver run info
/usr/local/$(Flavor)-Pegasus/share                                         ====> mof, doc and man pages
/usr/local/$(Flavor)-Pegasus/include                                       ====> Include files 

3. Release builds (If PEGASUS_USE_RELEASE_DIRS=true, PEGASUS_OVERRIDE_DEFAULT_RELEASE_DIRS=false)

When PEGASUS_FLAVOR is set, It is expected that default release dirs are overwritten since these release dirs are platform dependent and there is no general and good way of determining the release dirs for each platform. Alternatively PEGASUS_FLAVOR can be prefixed/suffixed to the existing release dirs.


Examples

On Linux, if PEGASUS_FLAVOR is set to "abc", all built RPMs will be named using abc-pegasus which includes normal, test, devel and debuginfo RPMs.

Ex:

abc-pegasus-2.10.0-1.el5.i386.rpm
abc-pegasus-test-2.10.0-1.el5.i386.rpm
abc-pegasus-devel-2.10.0-1.el5.i386.rpm
abc-pegasus-debuginfo-2.10.0-1.el5.i386.rpm

Usecase 1: Development build, only PEGASUS_FLAVOR=abc set.

Config files changed: /var/tmp/cimserverabc_start.lock, /var/tmp/cimserverabc_start.conf and /var/tmp/cimxmlabc.socket
PAM config file : Expected file is /etc/pam.d/wbemabc
LogIdentity: cimserverabc, cimprovagtabc, cimlistenerabc, cimservermainabc, cimserveraabc (Note that z/OS has different names)

Usecase 2: Release RPM build, main RPM,  PEGASUS_FLAVOR=abc set. (RPM Build on linux overwrites the default release dirs)

Default value of prod dir PEGASUS_PROD_DIR = /usr/local/$(PEGASUS_FLAVOR)-pegasus.

On HP-UX default prod dir would be PEGASUS_PROD_DIR = /opt/$(PEGASUS_FLAVOR)-wbem.

/usr/local/abc-pegasus/etc/Pegasus
/usr/local/abc-pegasus/etc/Pegasus/access.conf
/etc/init.d/abc-pegasus
/etc/pam.d/wbemabc
/usr/local/abc-pegasus/bin/
/usr/local/abc-pegasus/lib/Pegasus
/usr/local/abc-pegasus/lib/Pegasus/providerManagers
/usr/local/abc-pegasus/lib/Pegasus/providers
/usr/local/abc-pegasus/lib/
/usr/local/abc-pegasus/sbin/
/usr/local/abc-pegasus/share/Pegasus
/usr/local/abc-pegasus/share/Pegasus/mof
/usr/local/abc-pegasus/share/Pegasus/scripts
/usr/local/abc-pegasus/share/doc/abc-pegasus-{version}
/usr/local/abc-pegasus/share/man/
/usr/local/abc-pegasus/var/lib/Pegasus
/usr/local/abc-pegasus/var/lib/Pegasus/cache
/usr/local/abc-pegasus/var/lib/Pegasus/log
/usr/local/abc-pegasus/var/lib/Pegasus/repository
/usr/local/abc-pegasus/var/run/abc-pegasus
/usr/local/abc-pegasus/var/run/abc-pegasus/socket

Logidentity would be same as discussed in Usecase 1.

Usecase 3: No RPM Build, PEGASUS_FLAVOR=abc and PEGASUS_USE_RELEASE_DIRS=true

This depends upon the values of release dir structure in Constants.h,  Platforms have to define their own release dir structure using the flavor. An error will be reported if both PEGASUS_FLAVOR and PEGASUS_USE_RELEASE_DIRS are set and PEGASUS_OVERRIDE_DEFAULT_RELEASE_DIRS is not set.

Update to BuildAndReleaseOptions.html

PEGASUS_FLAVOR

Description:
Builds the Pegasus using the given flavor name. Flavor is used in structuring the release dirs,configuration file names, log identity and PAM config file. RPMs are named using the flavor name.
Default Value: tog
Recommended Value (Development Build): tog
Recommended Value (Release Build): tog
Required: No
Considerations: To build RPM using flavor, RPM spec file needs to be regenerated after setting the flavor value. This can be done using the create_OpenPegasusRPMSpecFile target in the Makefile.Release. Platforms have to define their own release dir structure using the flavor for release builds. An error will be reported if both PEGASUS_FLAVOR and PEGASUS_USE_RELEASE_DIRS are set and PEGASUS_OVERRIDE_DEFAULT_RELEASE_DIRS is not set. RPM build on linux defines PEGASUS_OVERRIDE_DEFAULT_RELEASE_DIRS by default.

Future Ideas
  1. Build a configure script which generates the options/config dirs  based on flavor set.

Schedule

Available in 2.10

Discussion

(sahana_prabhakar) On HPUX the PEGASUS_PROD_DIR is set to /opt/wbem by default. Similar approach like Linux can be followed to rename the directory structure. It could be called /opt/flavorname-wbem.



Copyright (c) 2009 IBM Corp.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Template last modified: February 17th 2009 by Martin Kirk
Template version: 1.15