COSMOS DEMO i10

From Eclipsepedia

Jump to: navigation, search

This page provides instructions on how to install and run the COSMOS demo for i10. For i9 instructions, see COSMOS DEMO i9.

Contents

Objective of the Demo

The COSMOS Demo illustrates the main features of COSMOS.

Installation

Download COSMOS Demo and Prerequisites

This section provides instructions for installing and running the demo program that is provided in the COSMOS i10 build.

  1. Install Tomcat 5.5.26. The directory where the Tomcat server is installed will be referred to as the <tomcat_install_dir> in this document.
  2. Download Axis2 war file for Tomcat.
  3. Downlaod the BIRT.
  4. Download DOJO.
  5. From the COSMOS download page, click on the link of the latest candidate build for i10. Download the zip file under the "COSMOS Demo" section.
  6. Unzip the demo zip file to a directory. You will see a directory called "cosmos-demo". This directory will be referred to as <cosmos-demo> in this document.
  7. If you are using the Aperi MDR, you will need to install and setup Aperi as follows:
    1. Download the Aperi Storage Resource Manager version 0.4.1 from Aperi downloads
    2. Follow the instructions at Aperi install instructions. You MUST choose Derby as your database.
    3. After successfully installing Aperi, you may wish to run some Aperi probes to populate your database with storage information (refer to the "Aperi post-installation instructions" section of the install instructions).
    4. Note that the Aperi MDR is preconfigured to access the default Aperi derby database (at localhost and port 1527). If you have chosen another location, you will need to modify the <tomcat>\webapps\axis2\WEB-INF\services\AperiMdr\META-INF\services.xml file to change the DERBY_HOST and DERBY_PORT parameters.
    5. Before using the Aperi MDR, start the Aperi derby database. For example: type "start derby" from the <Aperi install>\db directory.

Configurations

  • At a Windows command prompt, enter <cosmos-demo>\bin.
  • Run configDemo.bat to update some configuration files according to your system environment.
  • The configDemo program assumes your <cosmos-demo> directory and the tomcat installation are on the same host.
  • The configDemo program accepts 5 parameters. They are:
    1. tomcatDir: Apache Tomcat install directory <tomcat_install_dir>
    2. cosmosDir: COSMOS Demo install directory <cosmos-demo>
    3. birt: path to BIRT Runtime zip file (download from step 4 above)
    4. dojo: parth to dojo zip file (download from step 5 above)
    5. axis2war: (optional) Path to the axis2.war file (downloaded from step 3 above)
  • You will see something like the following in a successful execution of the config program.
Unzipping d:\Program Files\apache-tomcat-5.5.25\webapps_backup4\axis2.war to D:\
Program Files\apache-tomcat-5.5.25\webapps\axis2...
Installed axis2 on Apache Tomcat server.
Installed web application: COSMOSReportViewer
Installed web application: COSMOSUI
Unzipping d:\dev\birt-runtime-2.3M6.zip to D:\Program Files\apache-tomcat-5.5.25
\webapps/COSMOSReportViewer...
Unzipped BIRT to COSMOSReportViewer
Copied BIRT web viewer example to COSMOSReportViewer
Unzipping d:\dev\dojo-release-1.0.2.zip to D:\Program Files\apache-tomcat-5.5.25
\webapps/COSMOSUI...
Unzipped dojo to COSMOSUI.
Installed web service: AperiMdr
Installed web service: Broker
Installed web service: ExampleMdr
Installed web service: LoggingDataManager
Installed web service: ServiceFinder
Installed web service: SMLMDR
Installed web service: StatDataManager
Installed web service: TestFederatingCMDB
Copied axis jar files to COSMOSUI.
Copied axis jar files to COSMOSReportViewer.
Copied axis jar files to cosmos client.
Updated axis2.xml.
Updated services.xml for SML MDR.
Updated services.xml for statistical MDR.

Starting the COSMOS components

  • After you have configured the program by following instructions in the previous section, start Tomcat by running <tomcat_install_dir>/bin/startup.bat. By starting the web server, the broker, data managers, reporting and user interface will be started. Note: You need to set JRE_HOME or JAVA_HOME before running startup.bat.
  • At the command prompt, execute
<cosmos-demo>\cosmos-client\cosmosClient.bat
  • At the COSMOS prompt, enter
broker registerAllDataManagers
  • This will register all data managers with the broker.

Using COSMOS Command Line Client

Registering All Data Managers with Broker

  • At the command prompt, execute:
 <cosmos-demo>\cosmos-client\cosmosClient.bat http://localhost:8080/axis2/services/Broker
 COSMOS> broker registerAllDataManagers

Listing All Data Managers Registered with Broker

  • At the command prompt, execute:
 <cosmos-demo>\cosmos-client\cosmosClient.bat http://localhost:8080/axis2/services/Broker
 COSMOS> broker getDataManagers 

Deregistering Data Managers from broker

  • At the command prompt, execute:
<cosmos-demo>\cosmos-client\cosmosClient.bat http://localhost:8080/axis2/services/Broker
COSMOS> broker deregister <hostname> <DataManagerName> 

Find all DataManagers using CosmosServiceFinder web service

  • At the command prompt, execute:
<cosmos-demo>\cosmos-client\cosmosClient.bat http://localhost:8080/axis2/services/Broker
COSMOS> finddatamanagers http://localhost:8080/axis2/services/CosmosServiceFinder


Executing CMDBf Queries using the command line client

To run the COSMOS Client application, type cosmosClient from a command line prompt at the <cosmos-demo>\cosmos-client directory.

The general syntax of the query command is graphQuery <host> <MDR name> <query filename>

The query files for the Example MDR are located in <cosmos-demo>\cosmos-client\cmdbfquery\ExampleMDR. You can invoke these queries on the Example MDR as follows (where <cosmos-demo> is the directory of the COSMOS demo and <hostname> is your machine name):

COSMOS> graphQuery <hostname> ExampleMdr <cosmos-demo>\cosmos-client\cmdbfQuery\ExampleMDR\all-students.txt
Query response:
<?xml version="1.0" encoding="UTF-8"?><cmdbf:queryResult xmlns:cmdbf="http://cmdbf.org/schema/1-0-0/datamodel">
        <cmdbf:nodes templateId="items">
                <cmdbf:item>
                        <cmdbf:record xmlns="http://school">

                                <student>
                                 <identity firstName="Mike" id="03" lastName="Lee"/>
                                </student>

                                <cmdbf:recordMetadata>
                                        <cmdbf:recordId>03</cmdbf:recordId>
                                </cmdbf:recordMetadata>
                        </cmdbf:record>
                        <cmdbf:instanceId>
                                <cmdbf:mdrId>org.eclipse.cosmos.samples.cmdbf.XMLRepository</cmdbf:mdrId>
                                <cmdbf:localId>03</cmdbf:localId>
                        </cmdbf:instanceId>
                </cmdbf:item>
                <cmdbf:item>
                        <cmdbf:record xmlns="http://school">

                                <student>
                                 <identity firstName="Jane" id="02" lastName="Ryerson"/>
                                </student>

                                <cmdbf:recordMetadata>
                                        <cmdbf:recordId>02</cmdbf:recordId>
                                </cmdbf:recordMetadata>
                        </cmdbf:record>
                        <cmdbf:instanceId>
                                <cmdbf:mdrId>org.eclipse.cosmos.samples.cmdbf.XMLRepository</cmdbf:mdrId>
                                <cmdbf:localId>02</cmdbf:localId>
                        </cmdbf:instanceId>
                </cmdbf:item>
                <cmdbf:item>
                        <cmdbf:record xmlns="http://school">

                                <student>
                                 <identity firstName="Bob" id="01" lastName="Davidson"/>
                                </student>

                                <cmdbf:recordMetadata>
                                        <cmdbf:recordId>01</cmdbf:recordId>
                                </cmdbf:recordMetadata>
                        </cmdbf:record>
                        <cmdbf:instanceId>
                                <cmdbf:mdrId>org.eclipse.cosmos.samples.cmdbf.XMLRepository</cmdbf:mdrId>
                                <cmdbf:localId>01</cmdbf:localId>
                        </cmdbf:instanceId>
                </cmdbf:item>
        </cmdbf:nodes>
</cmdbf:queryResult>
COSMOS>

Hint: You can use the COSMOS UI Query Builder (described below) to construct complex queries, preview them, and cut/paste them into a file for later use with the command line client.


Using the COSMOS Web User Interface

Once you have started the COSMOS components as described above, point your web browser to http://localhost:8080/COSMOSUI/?page=cosmos

Getting Started

The initial page of the COSMOS Web User Interface displays three main panes. The left pane shows a list of data managers that are registered with the broker. The top right pane shows a detail view that is initially blank. The bottom right pane shows a properties view that is initially blank. The initial state of the COSMOS Web User Interface is illustrated below.

Image:Demoi10_gettingstarted.jpg

  • There are initially six data managers that are registered with the broker.
    • A Statistical Data Manager ("StatDataManager")
    • An Asset Repository that contains asset information that is modelled using the Service Modeling Language(SML) ("Resource Repository")
    • An Example Federating CMDB ("Sample Repository with Registration")
    • An Example MDR that contains information related to students and teachers ("Sample Repository with Query")
    • A Logging Data Manager that collects log file information in the form of Common Base Events(CBE)("LoggingDataManager")
    • An MDR connecting containing storage management data from Aperi using a JDBC interface ("AperiMdr")

The end user can select a particular data manager to display properties associated with the data manager. The properties are shown in the bottom right pane in the Properties view. This is illustrated below:

Image:Demoi10_prop.jpg

Using the Statistical Data Manager

The Statistical Data Manager contains statistical observation that have been previously collected and saved within a database. The user can use the COSMOS UI to query the Statistical data manager for a list of data collection sessions and generate reports on the recorded data.

To show statistical data sources

  • The user can expand the "StatDataManager" node in the left pane to show a list of recorded statistical data sessions. Note that two data collection sessions have been recorded and saved. This is illustrated below.

Image:Demoi10_statlist.jpg

  • Note that the properties view shows the properties of the data collection session and shows the datasource, epr and keyset information.

To run the statistical data report

  • The user can generate a report on the collected data by right-clicking the session they want to generate the report on. A menu option should be shown to generate a "Statistical Report". The is illustrated below.

Image:demoi10_statreport.jpg

  • When the user clicks on the "Statistical Report" menu option the following report will be generated in the "Details" pane in the top right pane.

Image:demoi10_statreport2.jpg

Using the CBE Data Manager

The CBE data manager collects a set of log files in the form of Common Base Events. A set of log files have been previously collected. The user can use the COSMOS UI to query the CBE data manager for a list of log files and generate reports on the log data.

To show CBE data sources

  • The user can expand the "LoggingDataManager" node in the left pane to show a list of log files managed by the data manager. This is illustrated below.

Image:Demoi10_cbelist.jpg

  • Note that the properties view shows the properties of the log file.

To run the CBE data report

  • The user can generate a report on the collected data by right-clicking the log file they want to generate the report on. A menu option should be shown to generate a "Top 10 Log Report". The is illustrated below.

Image:demoi10_cbereport.jpg

  • When the user clicks on the "Top 10 Log Report" menu option the following report will be generated in the "Details" pane in the top right pane.

Image:demoi10_cbereport2.jpg

Using the SML MDR

The SML MDR manages a repository that contains asset data that is modeled using the Service Modeling Language. The current repository contains asset information about a rack unit that has a set of mounted CPUs connected by cables and switches. Users can construct a CMDBf query to acquire asset information on these resources.

To submit a query

  • To submit a query on the SML Repository right click the "Resource Repository" from the "Data Manager" view. A pop-up menu should be shown with a "Submit Query..." option as illustrated below.

Image:demoi10_smlmenu.jpg

  • Click on the option. This will bring up a dialog box that will allow the user to enter a CMDBf query. Let us submit the following CMDBf query. This query will get information on a cable.
<?xml version="1.0" encoding="UTF-8"?>
<s:query xmlns:s="http://cmdbf.org/schema/1-0-0/datamodel">
	<s:itemTemplate id="cableTemplate">
		<s:instanceIdConstraint>
			<s:instanceId>
				<s:mdrId>http://cosmos.org/rm/sml/repository</s:mdrId>
				<s:localId>Cable1.xml</s:localId>
			</s:instanceId>
		</s:instanceIdConstraint>
	</s:itemTemplate>
</s:query>
  • Enter the above CMDBf query in the Dialog box and click "Submit" as shown below.

Image:demoi10_smlsubmit.jpg

  • The graph response viewer should be shown in the details pane in the top right pane as shown below.

Image:demoi10_smlviewer.jpg

  • Click on the "Source" cell in the "Nodes and Edges" section of the view. The Record section of the view should show the cable information. Note that the asset information is displayed as a SML structure as follows:
<s:cable name="0001" xmlns:conn="connection" xmlns:ft="facetModel"     xmlns:it="http://www.cosmos.rm/dataCenter/core"     
xmlns:pm="propertyModel" xmlns:s="cable"     xmlns:sml="http://schemas.serviceml.org/sml/2007/02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">   
 <it:facets>        <it:facet>            <it:properties>                <pm:connector format="RJ45"/>            </it:properties>        </it:facet>        
<it:facet>            <ft:location>                <it:properties>                    <ft:position coordinate="in use"/>                </it:properties>            
</ft:location>        </it:facet>        <it:facet>            <it:properties>                <conn:connection>                    
<conn:source sml:ref="true">                        <sml:uri>
/DataCenterSample/hardware/networking/Switch1.xml#xpointer(/switch[@name="switch1"]/facets/facet/ports[@input="true"]/port[@number="0"])
</sml:uri>                    </conn:source>                    <conn:target sml:ref="true">                        <sml:uri>	
/DataCenterSample/hardware/networking/Router1.xml#xpointer(/router[@name="router1"]/facets/facet/ports[@input="false"]/port[@number="1"]) 					                    
</sml:uri>                 </conn:target>                </conn:connection>            </it:properties>        </it:facet>    
</it:facets></s:cable>

Using the Example MDR

The Example MDR manages a repository containing information on a set of students and teachers. The repository contains information such as the student's name, teacher's name and which students are taught by a particular teacher. Users can construct a CMDBf query to acquire the student or teacher information.

To submit a query

  • To submit a query on the Example MDR right click the "Sample Repository with Query" from the "Data Manager" view. A pop-up menu should be shown with a "Submit Query..." option as illustrated below.

Image:demoi10_exammenu.jpg

  • Click on the menu option. This will bring up a query builder dialog box that will allow the user to construct a CMDBf query. Let us build the following CMDBf query using the query builder. This query will get a list of students.
<?xml version="1.0" encoding="UTF-8"?>
<s:query xmlns:s="http://cmdbf.org/schema/1-0-0/datamodel">
	<s:itemTemplate id="items">
		<s:recordConstraint>
			<s:recordType namespace="" localName="student"/>			
		</s:recordConstraint>
	</s:itemTemplate>
</s:query>
  • The query builder is composed of three panes. The top level pane allows the user to create itemTemplate and relationshipTemplate nodes. Right click the "query" node in the top pane and select 'Add Item' as shown below.

Image:demoi10_exambuilder.jpg

  • This will bring up a second dialog box that allows the user to enter the template id. Enter the word 'items' in the text box as shown below.

Image:demoi10_examadditem.jpg

  • Notice that we constructed the following 'itemTemplate' node in the CMDBf query as illustrated in the XML shown in the previous step.
<s:itemTemplate id="items">
  • Select the 'itemTemplate' node in the bottom left pane to view the properties on the element. If we look at the XML structure of the CMDBf query we can notice that the query contains a 'recordContraint' element under the itemTemplate. Therefore, we need to add a recordConstraint element under the 'itemTemplate' node by right clicking the 'itemTemplate' node and selecting the 'add recordConstraint' menu option as shown below.

Image:demoi10_examrecordConstraint.jpg

  • Next we need to add a 'recordType' element under the 'recordConstraint' node. This time we right click the 'recordConstraint' node in the bottom left pane and select the 'add recordType' menu option as shown below.

Image:demoi9_examrecordType.jpg

  • Now we need to set the localName on the recordType element to 'student'. Click on the cell next to the 'localName' cell in the bottom right table. This will allow you to edit the attribute value. Enter the word 'student' in the text box and click enter as shown below.

Image:demoi9_examedit.jpg

  • At this point we constructed the CMDBf query and we are ready to submit the query to the Example MDR. We can click the "Preview XML" button to look at the CMDBf query we constructed. This is illustrated below:

Image:demoi9_exampreview.jpg

  • Click the 'Submit' button.
  • The graph response viewer should be shown in the details pane in the top right pane as shown below. The view will show a list of three students

Image:demoi10_examview.jpg

  • Click on the "Source" cell in the "Nodes and Edges" section of the view. The Record section of the view should show the information on a particular student. Note that the student information is displayed as a XML structure as follows:
<student>
   <identity firstName="Mike" id="03" lastName="Lee"/>
</student>

Using the Registration Example CMDBf

To register configuration items with the test Federating CMDB

  • start the COSMOS UI
  • right-click on the "Sample Repository with Registration" Data Manager
  • select "Register Configuration Items..." on the popup menu

Image:COSMOS_I10_Register1.JPG

  • In the "Register MDR Configuration Items" window, select the "Example MDR"

Image:COSMOS_I10_Register2.JPG

  • Press the "Register" button
  • A list of configuration items will be displayed showing status results

Image:COSMOS_I10_Register3.JPG

To Deregister configuration items from the test Federating CMDB

  • start the COSMOS UI
  • right-click on the "Sample Repository with Registration" Data Manager
  • select "Deregister Configuration Items..." on the popup menu

Image:COSMOS_I10_DeRegister1.JPG

  • In the "Deregister MDR Configuration Items" window, select the "Example MDR"

Image:COSMOS_I10_DeRegister2.JPG

  • Press the "Deregister" button
  • A list of configuration items will be displayed showing status results

Image:COSMOS_I10_DeRegister3.JPG

Using the Aperi MDR

Before you can use the Aperi MDR, make sure that you have started the Aperi Derby database. For example: type "start derby" from the <Aperi install directory>\db directory.

The Aperi MDR contains the following configuration items:

  • StoragePool
  • StorageSystem

The Aperi MDR contains the following relationships:

  • StorageSystemStoragePools (Storage Pools associated with a Storage System)

To submit a query

There are several ways to submit a query to the Aperi MDR:

  • Use a web service client application
  • Write a COSMOS client application (refer to the COSMOS User Guide for details)
  • Use the COSMOS UI Query Builder to construct and execute the query
  • Use the COSMOS client application to execute a query from a file


Query usage and samples

The Aperi MDR supports instance id constraints and record constraints (with record types and/or property value constraints).

The configuration item name is specified as the localName attribute of a recordType element in a recordConstraint. The property name is specified as the localName attribute of a propertyValue element in a recordConstraint. The relationship name is specified as the localName attribute of a recordType element in a recordConstraint.

The queryService metadata (in the WSDL) lists the supported property value operators in the query capabilities.


For example, to query all the StorageSystem configuration items:

<?xml version="1.0" encoding="UTF-8" ?>
<s:query xmlns:s="http://cmdbf.org/schema/1-0-0/datamodel">
   <s:itemTemplate id="items" suppressFromResult="false">
      <s:recordConstraint>
         <s:recordType namespace="http://schemas.aperimdr.org/schema/AperiMDR" localName="StorageSystem" />
      </s:recordConstraint>
   </s:itemTemplate>
</s:query>


You can further constrain the query using the graphQuery operators of a propertyValue element of a recordConstraint.

For example, to query all the StorageSystem configuration items with a display_name value beginning with "DS", use the "like" operator:

<?xml version="1.0" encoding="UTF-8"?>
<s:query xmlns:s="http://cmdbf.org/schema/1-0-0/datamodel">
   <s:itemTemplate id="items" suppressFromResult="false" >
      <s:recordConstraint >
         <s:recordType namespace="http://schemas.aperimdr.org/schema/AperiMDR" localName="StorageSystem" >
         </s:recordType>
         <s:propertyValue namespace="StorageSystem" localName="display_name" >
            <s:like negate="false" caseSensitive="false" >DS%</s:like >
         </s:propertyValue>
      </s:recordConstraint>
   </s:itemTemplate>
</s:query>


You can also query for an particular instance of a configuration item by specifying the localId of an instanceId element in an instanceIdConstraint.

For example, to query for the StorageSystem configuration item with localId "StorageSystem=2307":

<?xml version="1.0" encoding="UTF-8"?>
<s:query xmlns:s="http://cmdbf.org/schema/1-0-0/datamodel">
   <s:itemTemplate id="items" suppressFromResult="false" >
      <s:instanceIdConstraint >
         <s:instanceId>
            <s:mdrId>AperiMDRID</s:mdrId>         
	    <s:localId>StorageSystem=2307</s:localId>
         </s:instanceId>
      </s:instanceIdConstraint>
   </s:itemTemplate>
</s:query>


You can query for a specific relationship between two configuration items by specifying the relationship template and two item templates with constraints.

For example, to query the relationship between the StorageSystem with Subsystem_ID equal to "2307" and the StoragePool instance of "StoragePool=2660":

<?xml version="1.0" encoding="UTF-8"?>
<s:query xmlns:s="http://cmdbf.org/schema/1-0-0/datamodel">
   <s:itemTemplate id="subsys" suppressFromResult="false" >
      <s:recordConstraint >
         <s:recordType namespace="http://schemas.aperimdr.org/schema/AperiMDR" localName="StorageSystem" >
         </s:recordType>
         <s:propertyValue namespace="StorageSystem" localName="Subsystem_ID" >
            <s:equal negate="false" caseSensitive="false" >2307</s:equal >
         </s:propertyValue>
      </s:recordConstraint>
   </s:itemTemplate>
   <s:itemTemplate id="pool" suppressFromResult="false" >
      <s:recordConstraint >
         <s:recordType namespace="http://schemas.aperimdr.org/schema/AperiMDR" localName="StoragePool" >
         </s:recordType>
      </s:recordConstraint>
      <s:instanceIdConstraint >
         <s:instanceId>
            <s:mdrId>AperiMDRID</s:mdrId>         
	    <s:localId>StoragePool=2660</s:localId>
         </s:instanceId>
      </s:instanceIdConstraint>
   </s:itemTemplate>
   <s:relationshipTemplate id="hasPool" suppressFromResult="false" >
      <s:sourceTemplate ref="subsys" minimum="0" maximum="0" >
      </s:sourceTemplate>
      <s:targetTemplate ref="pool" minimum="0" maximum="0" >
      </s:targetTemplate>
      <s:recordConstraint >
         <s:recordType namespace="http://schemas.aperimdr.org/schema/AperiMDR" localName="StorageSystemStoragePools" >
         </s:recordType>
      </s:recordConstraint>
   </s:relationshipTemplate>
</s:query>

Copyright © 2008 The Eclipse Foundation. All Rights Reserved

Personal tools