<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://help.openclovis.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://help.openclovis.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Prasad</id>
		<title>OpenClovis Product Documentation - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://help.openclovis.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Prasad"/>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Special:Contributions/Prasad"/>
		<updated>2026-08-05T22:16:18Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.20.2</generator>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/evalguide/prerequisites</id>
		<title>Doc:latest/evalguide/prerequisites</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/evalguide/prerequisites"/>
				<updated>2014-11-17T07:12:58Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Hardware and Software Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Hardware and Software Prerequisites==&lt;br /&gt;
&lt;br /&gt;
The OpenClovis SAFplus Platform SDK allows the modeller to define exactly what kind of hardware configuration a model runs on.  This Evaluation Model has been set up to allow a variety of hardware configurations.  You should match your hardware as best as possible with one of the configurations described below.&lt;br /&gt;
&lt;br /&gt;
This chapter initially summarizes the configurations you may recreate, followed by a description of the hardware and software specifications.&lt;br /&gt;
&lt;br /&gt;
The hardware set up you wish to choose depends upon two factors:&lt;br /&gt;
*whether you wish to use ATCA blades or PCs/laptops/Virtual Machines &lt;br /&gt;
*number of PCs/laptops/blades/Virtual Machines you have available&lt;br /&gt;
&lt;br /&gt;
The following table helps you decide which setup you can recreate. For example, if you wish to use an ATCA chassis and have 3 blades available, then you may wish to create Hardware Setup 1.2.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Hardware Setups'''&lt;br /&gt;
!style=&amp;quot;background-color:lightgray;&amp;quot;|&lt;br /&gt;
!style=&amp;quot;background-color:lightgray;&amp;quot; colspan=&amp;quot;3&amp;quot;| Hardware Setup&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Single Node&lt;br /&gt;
|3 Node - Distributed&lt;br /&gt;
|4 Node - Distributed&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Chassis/Blades&lt;br /&gt;
|Hardware Setup 1.1&lt;br /&gt;
|Hardware Setup 1.2&lt;br /&gt;
|Hardware Setup 1.3&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Pcs/Laptops/Virtual Machines&lt;br /&gt;
|Hardware Setup 2.1&lt;br /&gt;
|Hardware Setup 2.2&lt;br /&gt;
|Hardware Setup 2.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] The word Node here represents either a PC, laptop or blade or Virtual Machine.&lt;br /&gt;
&lt;br /&gt;
===Development Environment===&lt;br /&gt;
&lt;br /&gt;
The Development Machine is the primary machine where the SAFplus Platform SDK and Evaluation System is installed and built. As discussed within this document, the development machine plays an important role in moving System Controller and Payload Node images to the runtime environment.&lt;br /&gt;
&lt;br /&gt;
'''Development Machine'''&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Development Machine Environment'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Hardware&lt;br /&gt;
|Software&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Development Machine&lt;br /&gt;
|PC or Laptop or Virtual Machine&lt;br /&gt;
&amp;lt;br&amp;gt;Hard disk - 10 GB or more&lt;br /&gt;
&amp;lt;br&amp;gt;RAM - 512 MB or more&lt;br /&gt;
&amp;lt;br&amp;gt;Processor - Intel Pentium II (or better) &lt;br /&gt;
| Linux Distribution (Ubuntu 7.04 and above preferred)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] Although a distinction is made throughout this document to separate the two  functions of the  Development Machine and  Management Station Machine, they can in fact be the same PC/Laptop/Virtual Machine.&lt;br /&gt;
&lt;br /&gt;
===Runtime Environment===&lt;br /&gt;
&lt;br /&gt;
A  distinction is made between the Development and Runtime Environment as SAFplus Platform will most likely run within an environment made up of chassis, blades, shelf managers, switches etc. and be monitored remotely. Hence we have attempted to make this Evaluation System simulate the environment it will be used in, as represented in Runtime Hardware Setup 1.1, 1.2 and 1.3 (see Chapter [[Doc:latest/evalguide/setup#Runtime Hardware Setup| Runtime Hardware Setup]]). An alternative setup is also provided, using PCs/Virtual Machines, as discussed in Runtime Hardware Setup 2.1, 2.2 and 2.3 (again see Chapter [[Doc:latest/evalguide/setup#Runtime Hardware Setup| Runtime Hardware Setup]]).&lt;br /&gt;
&lt;br /&gt;
====Runtime Setup 1.1, 1.2 and 1.3====&lt;br /&gt;
&lt;br /&gt;
Runtime Hardware Setup 1.1, 1.2 or 1.3 requires a Chassis and 1, 3 or 4 blade(s) respectively and one PC or laptop or Virtual Machine to act as the Management Station Machine. Below is listed the equipment required.&lt;br /&gt;
&lt;br /&gt;
=====Chassis=====&lt;br /&gt;
&lt;br /&gt;
ATCA chassis with a Shelf Manager.&lt;br /&gt;
&lt;br /&gt;
=====Management Station Machine=====&lt;br /&gt;
&lt;br /&gt;
A Management Station is necessary for Runtime Hardware Setup 1.1, 1.2 and 1.3.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Management Station Environment'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Hardware&lt;br /&gt;
|Software&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Development Station Machine&lt;br /&gt;
|PC or Laptop or Virtual Machine&lt;br /&gt;
&amp;lt;br&amp;gt;Hard disk - 10 GB or more&lt;br /&gt;
&amp;lt;br&amp;gt;RAM - 512 MB or more&lt;br /&gt;
&amp;lt;br&amp;gt;Processor - Intel Pentium II (or better) &lt;br /&gt;
| Linux Distribution (Ubuntu 7.04 and above preferred)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] It is possible to use a single PC/laptop/Virtual Machine as both host for the development and management machines. Virtual machine environments can also be used with some limitations to the hardware exercises.&lt;br /&gt;
&lt;br /&gt;
=====System Controller=====&lt;br /&gt;
&lt;br /&gt;
Runtime Hardware Setup 1.1 and 1.2 required one System Controller.&lt;br /&gt;
&lt;br /&gt;
Runtime Hardware Setup 1.3 requires two System Controllers.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''System Controller'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Hardware&lt;br /&gt;
|Software&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|System Controller&lt;br /&gt;
|ATCA Intel (MPCBL0001) Blade&lt;br /&gt;
&amp;lt;br&amp;gt;Hard Disk - 10 GB or more&lt;br /&gt;
&amp;lt;br&amp;gt;RAM - 512 MB or more&lt;br /&gt;
| Linux Distribution (Ubuntu 7.04 and above preferred)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Payload (Blades) Node=====&lt;br /&gt;
&lt;br /&gt;
Two Payload nodes are necessary for Runtime Hardware Setup 1.2 and 1.3.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Payload Nodes'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Hardware&lt;br /&gt;
|Software&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Two Payload Blades&lt;br /&gt;
|ATCA Intel (MPCBL0001) Blade&lt;br /&gt;
&amp;lt;br&amp;gt;Hard Disk - 10 GB or more&lt;br /&gt;
&amp;lt;br&amp;gt;RAM - 512 MB or more&lt;br /&gt;
| Linux Distribution (Ubuntu 7.04 and above preferred)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Switch=====&lt;br /&gt;
&lt;br /&gt;
10/100Mbps or Gigabit Ethernet switch.&lt;br /&gt;
&lt;br /&gt;
See Chapter [[Doc:latest/evalguide/build#Building the Evaluation System and Deploying Runtime Images| Building the Evaluation System and Deploying Runtime Images]] for further installation details.&lt;br /&gt;
&lt;br /&gt;
====Runtime Setup 2.1, 2.2 and 2.3====&lt;br /&gt;
&lt;br /&gt;
Runtime Hardware Setup 2 is a simpler hardware set up, only requiring PC(s)/laptop(s)/Virtual Machine(s) and a switch. Runtime Hardware Setup 2.1, 2.2 or 2.3 requires 1, 3 or 4 PC(s) or laptop(s) or Virtual Machine(s) respectively. In addition a PC or laptop or Virtual Machine is needed to act as the Management Station Machine. Below is listed the equipment required.&lt;br /&gt;
&lt;br /&gt;
=====Management Station Machine=====&lt;br /&gt;
&lt;br /&gt;
One Management Station is necessary for Runtime Hardware Setup 2.1, 2.2 and 2.3.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Development Management Machine'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Hardware&lt;br /&gt;
|Software&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Management/Development Station Machine&lt;br /&gt;
|PC or Laptop or Virtual Machine&lt;br /&gt;
&amp;lt;br&amp;gt;Hard disk - 10 GB or more&lt;br /&gt;
&amp;lt;br&amp;gt;RAM - 512 MB or more&lt;br /&gt;
&amp;lt;br&amp;gt;Processor - Intel Pentium II (or better) &lt;br /&gt;
| Linux Distribution (Ubuntu 7.04 and above preferred)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] It is possible to use a single PC as the development machine, management machine and simultaneously as the target for a single node.  Distributed node exercises will require a second machine.  Virtual machine environments can also be used with some limitations to the hardware exercises.&lt;br /&gt;
&lt;br /&gt;
=====System Controller=====&lt;br /&gt;
&lt;br /&gt;
Runtime Hardware Setup 2.1 and 2.2 required one System Controller.&lt;br /&gt;
&lt;br /&gt;
Runtime Hardware Setup 2.3 requires two System Controllers.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''System Controller'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Hardware&lt;br /&gt;
|Software&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|System Controller&lt;br /&gt;
|PC or Laptop or Virtual Machine&lt;br /&gt;
&amp;lt;br&amp;gt;Hard disk - 10 GB or more&lt;br /&gt;
&amp;lt;br&amp;gt;RAM - 512 MB or more&lt;br /&gt;
&amp;lt;br&amp;gt;Processor - Intel Pentium II (or Better)&lt;br /&gt;
| Linux Distribution (Ubuntu 7.04 and above preferred)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Payload Node=====&lt;br /&gt;
&lt;br /&gt;
Two Payload PCs /laptops/Virtual Machines are required for Runtime Hardware Setup 2.2 and 2.3.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Payload Nodes'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Hardware&lt;br /&gt;
|Software&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Two Payload Nodes&lt;br /&gt;
|PC or Laptop or Virtual Machine&lt;br /&gt;
&amp;lt;br&amp;gt;HD - 10 GB or more&lt;br /&gt;
&amp;lt;br&amp;gt;RAM - 512 MB or more&lt;br /&gt;
&amp;lt;br&amp;gt;Processor - Intel Pentium II (or Better)&lt;br /&gt;
| Linux Distribution (Ubuntu 7.04 and above preferred)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Switch=====&lt;br /&gt;
&lt;br /&gt;
10/100 Mbps or Gigabit ethernet switch.&lt;br /&gt;
&lt;br /&gt;
See Chapter [[Doc:latest/evalguide/build#Building the Evaluation System and Deploying Runtime Images| Building the Evaluation System and Deploying Runtime Images]] for further runtime installation details.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
This chapter provided a list of the equipment required for the development and runtime environment. See Chapter [[Doc:latest/evalguide/setup#Runtime Hardware Setup|Runtime Hardware Setup]], for further information concerning setting up the hardware environment. This is followed by Chapter [[Doc:latest/evalguide/build#Building the Evaluation System and Deploying Runtime Images| Building the Evaluation System and Deploying Runtime Images]], which provides information concerning the installation of target images onto the runtime environment.&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/evalguide/setup</id>
		<title>Doc:latest/evalguide/setup</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/evalguide/setup"/>
				<updated>2014-11-17T07:05:22Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Runtime Hardware Setup 2.2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Runtime Hardware Setup==&lt;br /&gt;
&lt;br /&gt;
As SAFplus Platform will run on an environment which consists of chassis, blades, switch fabrics and shelf managers, we have created Runtime Hardware Setup 1.1, 1.2 and 1.3. If this equipment is not available we suggest using a similar environment where PCs/laptops/Virtual Machines can be used to replace the chassis and blades, see Runtime Hardware setup 2.1, 2.2 and 2.3.&lt;br /&gt;
&lt;br /&gt;
'''Management Station Machine'''&lt;br /&gt;
&lt;br /&gt;
The Management Machine allows users to launch the Evaluation System on the target environment, enabling them to remotely control SAFplus Platform (via ssh), start and stop sample applications and monitor output.&lt;br /&gt;
 &lt;br /&gt;
'''System Controller'''&lt;br /&gt;
&lt;br /&gt;
One or more System Controllers are required within our target environment. For further information on the role of a System Controller see the Clovis SAFplus Platform User Guide.&lt;br /&gt;
&lt;br /&gt;
'''Payload Node'''&lt;br /&gt;
&lt;br /&gt;
Two Payload Nodes are required for our Evaluation System to demonstrate multi node SAFplus Platform functionality. This is required for Runtime Setup 1.2, 1.3, 2.2 and 2.3.&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 1.1===&lt;br /&gt;
&lt;br /&gt;
This is the simple chassis, blade setup. Where one blade/node is present and acts as the System controller. Within the Runtime Hardware Setup 1.1,  the following equipment is used.&lt;br /&gt;
*1 ATCA Chassis&lt;br /&gt;
*1 x Intel MPCBL0001N04 Blades.&lt;br /&gt;
*1 ATCA Chassis Management Module (CMM)&lt;br /&gt;
*1 ATCA Switch Fabric &lt;br /&gt;
*1 PC Management Station&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 1.1'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller &lt;br /&gt;
|Management Station&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.0.X&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Chassis Slot&lt;br /&gt;
|1&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] The IP addresses here are examples. The end user is able to use his/her IP address. The necessary changes have to be made to &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt;. (See Section [[Doc:latest/evalguide/build#Configuration File - target.conf| Configuration File - target.conf]]) &lt;br /&gt;
&lt;br /&gt;
The following diagram shows how the above equipment has been interconnected.&lt;br /&gt;
&lt;br /&gt;
[[File:eval_HwSetup1-1.png|500px|frame|center|'''Runtime Hardware Setup 1.1''']]&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 1.2===&lt;br /&gt;
&lt;br /&gt;
This is the chassis and blade setup, where three blades/nodes are present that act as the System Controller and two Payload Nodes. Within the Runtime Hardware Setup 1.2,  the following equipment is used:&lt;br /&gt;
*1 ATCA Chassis&lt;br /&gt;
*3 x Intel MPCBL0001N04 Blades.&lt;br /&gt;
*1 ATCA Chassis Management Module&lt;br /&gt;
*1 ATCA Switch Fabric &lt;br /&gt;
*1 PC Management Station&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 1.2'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller &lt;br /&gt;
|Payload Node0&lt;br /&gt;
|Payload Node1&lt;br /&gt;
|Management Station&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Chassis Slot&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|3&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:eval_HwSetup1-2.png|frame|center|'''Runtime Hardware Setup 1.2''']]&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 1.3===&lt;br /&gt;
&lt;br /&gt;
This four blade setup, requires two System Controllers and two Payload Nodes. The following equipment is used:&lt;br /&gt;
*1 ATCA Chassis&lt;br /&gt;
*4 x Intel MPCBL0001N04 Blades.&lt;br /&gt;
*1 ATCA Chassis Management Module&lt;br /&gt;
*1 ATCA Switch Fabric &lt;br /&gt;
*1 PC Management Station&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 1.3'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller0 &lt;br /&gt;
|System Controller1 &lt;br /&gt;
|Payload Node0&lt;br /&gt;
|Payload Node1&lt;br /&gt;
|Management Station&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Chassis Slot&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|3&lt;br /&gt;
|4&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:eval_HwSetup1-3.png|frame|center|'''Runtime Hardware Setup 1.3''']]&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 2.1===&lt;br /&gt;
&lt;br /&gt;
If chassis, blades and switch fabrics are not available and you wish to run the single node setup, then the target environment can be emulated by Runtime Hardware Setup 2.1.  This is the simplest set up and requires only one PC/laptop/Virtual Machine to act as the Development Machine, Management Machine and System Controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 2.1'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
| Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:eval_HwSetup2-1.png|frame|center|'''Runtime Hardware Setup 2.1''']]&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 2.2===&lt;br /&gt;
&lt;br /&gt;
If chassis, blades and switch fabrics are not available, then the target environment can be emulated by Runtime Hardware Setup 2.2. Below is  a list of the required hardware:&lt;br /&gt;
&lt;br /&gt;
*'''4 PCs/Laptops/Virtual Machines''' &lt;br /&gt;
&lt;br /&gt;
As shown in Figure [[#Runtime Hardware Setup 2.2|Runtime Hardware Setup 2.2]], these will represent:&lt;br /&gt;
*1 Management Station Machine&lt;br /&gt;
*1 System Controller node&lt;br /&gt;
*2 Payload Nodes (PCs/Laptops/Virtual Machines)	&lt;br /&gt;
*1 switch &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 2.2'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller  &lt;br /&gt;
|Payload Node0&lt;br /&gt;
|Payload Node1&lt;br /&gt;
|Management Station&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;Runtime Hardware Setup 2.2&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
[[File:eval_HwSetup2-2.png|frame|center|'''Runtime Hardware Setup 2.2''']]&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 2.3===&lt;br /&gt;
&lt;br /&gt;
If four PCs are available then the target environment can be emulated by Runtime Hardware Setup 2.3. Below is a list of the required hardware:&lt;br /&gt;
*'''5 PCs/Laptops/Virtual Machines'''&lt;br /&gt;
&lt;br /&gt;
These will represent:&lt;br /&gt;
*1 Management Station Machine&lt;br /&gt;
*2 System Controller node&lt;br /&gt;
*2 Payload Nodes (PCs/Laptops/Virtual Machines)	&lt;br /&gt;
*1 switch &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 2.3'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller0 &lt;br /&gt;
|System Controller1  &lt;br /&gt;
|Payload Node0&lt;br /&gt;
|Payload Node1&lt;br /&gt;
|Management Station&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:eval_HwSetup2-3.png|frame|center|'''Runtime Hardware Setup 2.3''']]&lt;br /&gt;
&lt;br /&gt;
===Summary and Next Steps===&lt;br /&gt;
&lt;br /&gt;
This chapter has laid out the various hardware setups available to run our sample applications. Once you have chosen the set up that you wish to try and have all the hardware in place, correctly interlinked, the next step is to install the run time targets. This is discussed within the following chapter.&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/evalguide/setup</id>
		<title>Doc:latest/evalguide/setup</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/evalguide/setup"/>
				<updated>2014-11-17T07:04:34Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Runtime Hardware Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Runtime Hardware Setup==&lt;br /&gt;
&lt;br /&gt;
As SAFplus Platform will run on an environment which consists of chassis, blades, switch fabrics and shelf managers, we have created Runtime Hardware Setup 1.1, 1.2 and 1.3. If this equipment is not available we suggest using a similar environment where PCs/laptops/Virtual Machines can be used to replace the chassis and blades, see Runtime Hardware setup 2.1, 2.2 and 2.3.&lt;br /&gt;
&lt;br /&gt;
'''Management Station Machine'''&lt;br /&gt;
&lt;br /&gt;
The Management Machine allows users to launch the Evaluation System on the target environment, enabling them to remotely control SAFplus Platform (via ssh), start and stop sample applications and monitor output.&lt;br /&gt;
 &lt;br /&gt;
'''System Controller'''&lt;br /&gt;
&lt;br /&gt;
One or more System Controllers are required within our target environment. For further information on the role of a System Controller see the Clovis SAFplus Platform User Guide.&lt;br /&gt;
&lt;br /&gt;
'''Payload Node'''&lt;br /&gt;
&lt;br /&gt;
Two Payload Nodes are required for our Evaluation System to demonstrate multi node SAFplus Platform functionality. This is required for Runtime Setup 1.2, 1.3, 2.2 and 2.3.&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 1.1===&lt;br /&gt;
&lt;br /&gt;
This is the simple chassis, blade setup. Where one blade/node is present and acts as the System controller. Within the Runtime Hardware Setup 1.1,  the following equipment is used.&lt;br /&gt;
*1 ATCA Chassis&lt;br /&gt;
*1 x Intel MPCBL0001N04 Blades.&lt;br /&gt;
*1 ATCA Chassis Management Module (CMM)&lt;br /&gt;
*1 ATCA Switch Fabric &lt;br /&gt;
*1 PC Management Station&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 1.1'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller &lt;br /&gt;
|Management Station&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.0.X&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Chassis Slot&lt;br /&gt;
|1&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] The IP addresses here are examples. The end user is able to use his/her IP address. The necessary changes have to be made to &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt;. (See Section [[Doc:latest/evalguide/build#Configuration File - target.conf| Configuration File - target.conf]]) &lt;br /&gt;
&lt;br /&gt;
The following diagram shows how the above equipment has been interconnected.&lt;br /&gt;
&lt;br /&gt;
[[File:eval_HwSetup1-1.png|500px|frame|center|'''Runtime Hardware Setup 1.1''']]&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 1.2===&lt;br /&gt;
&lt;br /&gt;
This is the chassis and blade setup, where three blades/nodes are present that act as the System Controller and two Payload Nodes. Within the Runtime Hardware Setup 1.2,  the following equipment is used:&lt;br /&gt;
*1 ATCA Chassis&lt;br /&gt;
*3 x Intel MPCBL0001N04 Blades.&lt;br /&gt;
*1 ATCA Chassis Management Module&lt;br /&gt;
*1 ATCA Switch Fabric &lt;br /&gt;
*1 PC Management Station&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 1.2'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller &lt;br /&gt;
|Payload Node0&lt;br /&gt;
|Payload Node1&lt;br /&gt;
|Management Station&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Chassis Slot&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|3&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:eval_HwSetup1-2.png|frame|center|'''Runtime Hardware Setup 1.2''']]&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 1.3===&lt;br /&gt;
&lt;br /&gt;
This four blade setup, requires two System Controllers and two Payload Nodes. The following equipment is used:&lt;br /&gt;
*1 ATCA Chassis&lt;br /&gt;
*4 x Intel MPCBL0001N04 Blades.&lt;br /&gt;
*1 ATCA Chassis Management Module&lt;br /&gt;
*1 ATCA Switch Fabric &lt;br /&gt;
*1 PC Management Station&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 1.3'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller0 &lt;br /&gt;
|System Controller1 &lt;br /&gt;
|Payload Node0&lt;br /&gt;
|Payload Node1&lt;br /&gt;
|Management Station&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Chassis Slot&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|3&lt;br /&gt;
|4&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:eval_HwSetup1-3.png|frame|center|'''Runtime Hardware Setup 1.3''']]&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 2.1===&lt;br /&gt;
&lt;br /&gt;
If chassis, blades and switch fabrics are not available and you wish to run the single node setup, then the target environment can be emulated by Runtime Hardware Setup 2.1.  This is the simplest set up and requires only one PC/laptop/Virtual Machine to act as the Development Machine, Management Machine and System Controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 2.1'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
| Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:eval_HwSetup2-1.png|frame|center|'''Runtime Hardware Setup 2.1''']]&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 2.2===&lt;br /&gt;
&lt;br /&gt;
If chassis, blades and switch fabrics are not available, then the target environment can be emulated by Runtime Hardware Setup 2.2. Below is  a list of the required hardware:&lt;br /&gt;
&lt;br /&gt;
*'''4 PCs/Laptops/Virtual Machines''' &lt;br /&gt;
&lt;br /&gt;
As shown in Figure [[#Runtime Hardware Setup 2.2|Runtime Hardware Setup 2.2]], these will represent:&lt;br /&gt;
*1 Management Station Machine&lt;br /&gt;
*1 System Controller node&lt;br /&gt;
*2 Payload Nodes (PCs/Laptops)	&lt;br /&gt;
*1 switch &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 2.2'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller  &lt;br /&gt;
|Payload Node0&lt;br /&gt;
|Payload Node1&lt;br /&gt;
|Management Station&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;Runtime Hardware Setup 2.2&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
[[File:eval_HwSetup2-2.png|frame|center|'''Runtime Hardware Setup 2.2''']]&lt;br /&gt;
&lt;br /&gt;
===Runtime Hardware Setup 2.3===&lt;br /&gt;
&lt;br /&gt;
If four PCs are available then the target environment can be emulated by Runtime Hardware Setup 2.3. Below is a list of the required hardware:&lt;br /&gt;
*'''5 PCs/Laptops/Virtual Machines'''&lt;br /&gt;
&lt;br /&gt;
These will represent:&lt;br /&gt;
*1 Management Station Machine&lt;br /&gt;
*2 System Controller node&lt;br /&gt;
*2 Payload Nodes (PCs/Laptops/Virtual Machines)	&lt;br /&gt;
*1 switch &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot; | '''Runtime Hardware Setup 2.3'''&lt;br /&gt;
|- style=&amp;quot;background-color:lightgray;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|System Controller0 &lt;br /&gt;
|System Controller1  &lt;br /&gt;
|Payload Node0&lt;br /&gt;
|Payload Node1&lt;br /&gt;
|Management Station&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|OS&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|Linux&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|Kernel V&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|2.6 and above&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background-color:lightgray;&amp;quot;|eth0&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|192.168.30.X&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:eval_HwSetup2-3.png|frame|center|'''Runtime Hardware Setup 2.3''']]&lt;br /&gt;
&lt;br /&gt;
===Summary and Next Steps===&lt;br /&gt;
&lt;br /&gt;
This chapter has laid out the various hardware setups available to run our sample applications. Once you have chosen the set up that you wish to try and have all the hardware in place, correctly interlinked, the next step is to install the run time targets. This is discussed within the following chapter.&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/evalguide/csa112</id>
		<title>Doc:latest/evalguide/csa112</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/evalguide/csa112"/>
				<updated>2014-11-17T06:39:56Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* How to Run csa212 and What to Observe */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==csa112 Event Subscription==&lt;br /&gt;
&lt;br /&gt;
An event service is an communications mechanism organised around the categories of data rather then senders and receivers.  A &amp;quot;publisher&amp;quot; posts a message to a well-known event channel and all &amp;quot;subscribers&amp;quot; receive the message.  Publishers and subscribers do not need to know who each other are; they need only know the event channel name.  &lt;br /&gt;
&lt;br /&gt;
As the Messaging service is similar to mail, the Event service is similar to a bulletin board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Objective===&lt;br /&gt;
&lt;br /&gt;
The objective of csa112 is to learn how to use the SAFplus Platform event service to subscribe to events and to extract the relevant information from the events received by subscription.  &lt;br /&gt;
&lt;br /&gt;
===What you will learn===&lt;br /&gt;
&lt;br /&gt;
You will learn:&lt;br /&gt;
*how to initialize the event library&lt;br /&gt;
*how to subscribe to events&lt;br /&gt;
*how to receive events&lt;br /&gt;
*how to extract the event data&lt;br /&gt;
&lt;br /&gt;
The SAFplus Event service is SA-Forum compliant and this tutorial expects that you will refer to the relevant SA-Forum document for an in-depth description of the APIs used.&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&lt;br /&gt;
One difference to note between this application and previous ones is that this application will not have a main loop in &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt;.  Instead we will do our work in callback code.  This means that when we return from &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; we won't exit the application.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    SaNameT evtChannelName =&lt;br /&gt;
    {&lt;br /&gt;
        sizeof EVENT_CHANNEL_NAME -1,&lt;br /&gt;
        EVENT_CHANNEL_NAME&lt;br /&gt;
    };&lt;br /&gt;
 &lt;br /&gt;
    SaEvtChannelHandleT   evtChannelHandle = 0;&lt;br /&gt;
    SaEvtHandleT          evtLibHandle=0;&lt;br /&gt;
    SaEvtEventHandleT     eventHandle=0;&lt;br /&gt;
&lt;br /&gt;
    static void  csa112Comp_appEventCallback( SaEvtSubscriptionIdT subscriptionId, &lt;br /&gt;
                                              SaEvtEventHandleT eventHandle,&lt;br /&gt;
                                              SaSizeT eventDataSize);&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Here we define variables to hold the payload of our event. Note the initialization of the &amp;lt;code&amp;gt;evtChannelName&amp;lt;/code&amp;gt;.  The length is set to the length of the &amp;lt;code&amp;gt;EVENT_CHANNEL_NAME&amp;lt;/code&amp;gt; string WITHOUT including the &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; terminator.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        const SaEvtCallbacksT evtCallbacks =&lt;br /&gt;
        {&lt;br /&gt;
            NULL,  /* Event open callback */&lt;br /&gt;
            csa112Comp_appEventCallback  /* Event delivery callback */&lt;br /&gt;
        };&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        // publish our event callbacks&lt;br /&gt;
        rc = saEvtInitialize(&amp;amp;evtLibHandle, &amp;amp;evtCallbacks, &amp;amp;evtVersion);&lt;br /&gt;
        ...&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
We initialize the OpenClovis Event Manager with &amp;lt;code&amp;gt;saEvtInitialize&amp;lt;/code&amp;gt;.  We pass the address of the variable where we want the event handle stored.  We pass the address of our event callback functions structure.  Note that the only event callback function that we specify is &amp;lt;code&amp;gt;csa112Comp_appEventCallback&amp;lt;/code&amp;gt;.  We do not specify the other callback which is the Asynchronous channel open callback.  We specify &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; for that field of &amp;lt;code&amp;gt;evtCallbacks&amp;lt;/code&amp;gt; because we don't open our event channel asynchronously.:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        // Open an event chanel so that we can subscribe to events on that channel&lt;br /&gt;
        rc = saEvtChannelOpen(evtLibHandle, &amp;amp;evtChannelName, &lt;br /&gt;
                              (SA_EVT_CHANNEL_PUBLISHER | SA_EVT_CHANNEL_SUBSCRIBER | SA_EVT_CHANNEL_CREATE), &lt;br /&gt;
                              (SaTimeT)SA_TIME_END, &amp;amp;evtChannelHandle);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failure opening event channel [0x%x] at %ld&amp;quot;, rc, time(0L));&lt;br /&gt;
            errorExit(rc);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        rc = saEvtEventSubscribe(evtChannelHandle, NULL, 1);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to subscribe to event channel [0x%x]&amp;quot;,rc);&lt;br /&gt;
            errorExit(rc);&lt;br /&gt;
        }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Within the above code we open the channel synchronously.  We pass the handle we got back from &amp;lt;code&amp;gt;saEvtInitialize&amp;lt;/code&amp;gt;, the channel name we defined previously, flags that indicate this process is subscribing to the channel and it's a global channel, and that the channel should be created if it's not already there, a timeout value of &amp;quot;forever&amp;quot;, and the address of the location where the channel handle should be stored.  Then, we subscribe to a specific event stream on the event channel.  The &amp;lt;code&amp;gt;EVENT_TYPE&amp;lt;/code&amp;gt; constant is defined in &amp;lt;code&amp;gt;common/common.h&amp;lt;/code&amp;gt; as 5432.  This value is used by the event publisher when it sends events.  The constant 1 being passed simply identifies this specific subscription on this channel.  This value will be passed to our event delivery callback function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    static void &lt;br /&gt;
    csa112Comp_appEventCallback(SaEvtSubscriptionIdT subscriptionId,&lt;br /&gt;
                                SaEvtEventHandleT eventHandle, &lt;br /&gt;
                                SaSizeT eventDataSize)&lt;br /&gt;
    {&lt;br /&gt;
    &lt;br /&gt;
        SaAisErrorT     rc = SA_AIS_OK;&lt;br /&gt;
        static ClPtrT   resTest = 0;    &lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO,&amp;quot;We've got an event to receive\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        if (resTest != 0)&lt;br /&gt;
        {&lt;br /&gt;
            clHeapFree((char *)resTest);&lt;br /&gt;
            resTest = 0;&lt;br /&gt;
        }&lt;br /&gt;
        resTest = clHeapAllocate(eventDataSize + 1);&lt;br /&gt;
&lt;br /&gt;
        if (resTest == 0)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to allocate space for event&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        rc = saEvtEventDataGet(eventHandle, resTest, &amp;amp;eventDataSize);&lt;br /&gt;
&lt;br /&gt;
        if (rc!= SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to get event data [0x%x]&amp;quot;,rc);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        *(((char *)resTest) + eventDataSize) = 0;&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO,&amp;quot;received event: %s\n&amp;quot;, (char *)resTest);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The event delivery callback function is named &amp;lt;code&amp;gt;csa112Comp_appEventCallback&amp;lt;/code&amp;gt;. It checks whether our incoming data buffer needs to be deallocated.  If there is a buffer, it deallocates it and then allocates enough data to receive the incoming event data.  Then, we extract the data from the event into the newly allocated buffer using &amp;lt;code&amp;gt;clEventDataGet&amp;lt;/code&amp;gt;.  Finally, we print the event data we received using &amp;lt;code&amp;gt;clprintf&amp;lt;/code&amp;gt; which is another member of Clovis' OS Abstraction Layer.  As its name and usage suggest, it is the OSAL replacement for printf.&lt;br /&gt;
&lt;br /&gt;
'''Note:'''&lt;br /&gt;
&lt;br /&gt;
Before building the project,copy the common directory which can be found under            &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;/src/app&amp;lt;/code&amp;gt; to the working area&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/common  .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How to Run csa112 and What to Observe===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start example csa212 in the same manner that we have started previous examples, with the SAFplus Platform Console.(Unlock csa212SGI0 instead of csa112SGI0 to run csa212).&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /root/asp/bin&lt;br /&gt;
 # ./asp_console&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa212SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the log file for this example you should see the following.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa212CompI3Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00001 :   INFO) Component [csa212CompI3] : PID [10366]. Initializing&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00002 :   INFO)    IOC Address             : 0x4&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00003 :   INFO)    IOC Port                : 0x80&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:15:31.389 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00004 :   INFO) Component [csa212CompI3] : PID [10366]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now unlock the application with:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa212SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point you should see the following in the log.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa212CompI3Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 Fri Oct  1 13:15:31.389 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00012 :   INFO) csa212: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Thats all there is to this example. What you are looking at in the log is the output of our event listener. It doesn't appear very interesting because we have not yet written an event publisher that will give the program something to output. We'll do that in the next example (csa213).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point we can shut down our example in the usual fashion.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa212SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa212SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; end&lt;br /&gt;
cli[Test]-&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
[[File:OpenClovis_Note.png]]When running model csa212 you will not see the output described for the the amsLockAssignment and amsUnlock commands.&lt;br /&gt;
&lt;br /&gt;
===Summary and References===&lt;br /&gt;
&lt;br /&gt;
We've seen how to create a basic event subscriber application using Clovis' event manager library.  For further reading check the Clovis SAFplus Platform API reference guide, specifically the section on the event manager.  Also, the header file: &amp;lt;code&amp;gt;clEventExtApi.h&amp;lt;/code&amp;gt; should be helpful.&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/evalguide/csa113</id>
		<title>Doc:latest/evalguide/csa113</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/evalguide/csa113"/>
				<updated>2014-11-17T06:39:15Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* csa213 SA Forum Compliant Event Publication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==csa113 Event Publication==&lt;br /&gt;
&lt;br /&gt;
===Objective===&lt;br /&gt;
&lt;br /&gt;
The objective is to learn how to write an event publishing application using Clovis' Event Manager API.&lt;br /&gt;
&lt;br /&gt;
===What You Will Learn===&lt;br /&gt;
&lt;br /&gt;
*You will learn how to publish events using Clovis' Event Manager API.&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
        ...&lt;br /&gt;
        const SaEvtCallbacksT evtCallbacks =&lt;br /&gt;
        {&lt;br /&gt;
            NULL,  /* Event open callback */&lt;br /&gt;
            csa112Comp_appEventCallback  /* Event delivery callback */&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        /* Initialize AMF client library. */&lt;br /&gt;
    if ( (rc = saAmfInitialize(&amp;amp;amfHandle, &amp;amp;callbacks, &amp;amp;version)) != SA_AIS_OK)&lt;br /&gt;
        errorExit(rc);&lt;br /&gt;
&lt;br /&gt;
        ....&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function of this example we again see a call to &amp;lt;code&amp;gt;saAmfInitialize&amp;lt;/code&amp;gt;. Everything initializeAmf function is the same as before in csa112.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        // Open an event chanel so that we can subscribe to events on that channel&lt;br /&gt;
        rc = saEvtChannelOpen(evtLibHandle, &lt;br /&gt;
                &amp;amp;evtChannelName, &lt;br /&gt;
                (SA_EVT_CHANNEL_PUBLISHER | &lt;br /&gt;
                 SA_EVT_CHANNEL_SUBSCRIBER | &lt;br /&gt;
                 SA_EVT_CHANNEL_CREATE), &lt;br /&gt;
                (SaTimeT)SA_TIME_END, &lt;br /&gt;
                &amp;amp;evtChannelHandle);&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Here we open the event channel.  This is the same as in csa112.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        rc = saEvtEventAllocate(evtChannelHandle, &amp;amp;eventHandle);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to allocate event [0x%x]\n&amp;quot;, rc);&lt;br /&gt;
            assert(0);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        rc = saEvtEventAttributesSet(eventHandle, &lt;br /&gt;
               NULL, &lt;br /&gt;
               1, &lt;br /&gt;
               0, &lt;br /&gt;
               &amp;amp;publisherName);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to set event attributes [0x%x]\n&amp;quot;,rc);&lt;br /&gt;
            assert(0);            &lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;code&amp;gt;saEvtEventAllocate&amp;lt;/code&amp;gt; allocates an event header.  This header is identified by the event handle passed back to &amp;lt;code&amp;gt;gTestInfo.eventHandle&amp;lt;/code&amp;gt;.  The handle should be used any time the event header is to be used to manipulate the header, either by using &amp;lt;code&amp;gt;saEvtEventAttributesSet&amp;lt;/code&amp;gt; (right below), or to send an event using the header as in &amp;lt;code&amp;gt;saEvtEventPublish&amp;lt;/code&amp;gt;.  The call to &amp;lt;code&amp;gt;saEvtEventAttributesSet&amp;lt;/code&amp;gt; defines defines the priority to be 1 which is just below the highest priority of &amp;lt;code&amp;gt;CL_EVENT_HIGHEST_PRIORITY&amp;lt;/code&amp;gt; which is defined as 0 where &amp;lt;code&amp;gt;CL_EVENT_LOWEST_PRIORITY&amp;lt;/code&amp;gt; is defined as 3.  The retention time is specified as 0 since we don't want the event to be kept around if there is no subscriber to pick it up.  Finally the &amp;lt;code&amp;gt;publisherName&amp;lt;/code&amp;gt; is specified because it's required.  Our subscriber doesn't care who publishes the events it receives.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    int&lt;br /&gt;
    main(int argc, &lt;br /&gt;
         char *argv[])&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        while (!unblockNow)&lt;br /&gt;
        {&lt;br /&gt;
            /* csa113: If I am active then I'll publish an event.&lt;br /&gt;
            Note, any application can publish and event regardless of&lt;br /&gt;
            HA state.  This tutorial simply uses HA state so only&lt;br /&gt;
            one of the two processes are publishing.&lt;br /&gt;
            */&lt;br /&gt;
        &lt;br /&gt;
            if (running &amp;amp;&amp;amp; ha_state == SA_AMF_HA_ACTIVE)&lt;br /&gt;
            {&lt;br /&gt;
                csa113Comp_PublishEvent();&lt;br /&gt;
            }&lt;br /&gt;
            /* Keep the event publish rate reasonable for this tutorial*/&lt;br /&gt;
            sleep(1);  &lt;br /&gt;
        }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Here is the main loop. As long as the application is running and active we make a call to &amp;lt;code&amp;gt;csa113Comp_PublishEvent&amp;lt;/code&amp;gt;.  The work of the application takes place in &amp;lt;code&amp;gt;csa113Comp_PublishEvent&amp;lt;/code&amp;gt;, which is presented below.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    static SaAisErrorT &lt;br /&gt;
    csa113Comp_PublishEvent()&lt;br /&gt;
    {&lt;br /&gt;
        SaEvtEventIdT   eventId         = 0;&lt;br /&gt;
        static int      index           = 0;&lt;br /&gt;
        SaSizeT         data_len        = 0;&lt;br /&gt;
        SaAisErrorT	rc              = SA_AIS_OK;&lt;br /&gt;
        char            *data           = 0;&lt;br /&gt;
        typedef void (*Generator)(char **, ClSizeT*);&lt;br /&gt;
&lt;br /&gt;
       // Note: to add a new generator, just define it above and then include&lt;br /&gt;
       // the new functions name in the generators list.&lt;br /&gt;
       // Next, maybe something that gets disk free info by way of getfsent&lt;br /&gt;
       // and statfs?&lt;br /&gt;
&lt;br /&gt;
       static Generator generators[]   =&lt;br /&gt;
       {&lt;br /&gt;
           generate_time_of_day,&lt;br /&gt;
           generate_load_average&lt;br /&gt;
       };&lt;br /&gt;
&lt;br /&gt;
       // every time through increment index and then set index to&lt;br /&gt;
       // it's value modulo the number of entries in the generators&lt;br /&gt;
       // array.  This will cause us to cycle through the list of&lt;br /&gt;
       // generators as we're called to publish events.&lt;br /&gt;
       (*generators[index++])(&amp;amp;data, &amp;amp;data_len);&lt;br /&gt;
       index %= (int)(sizeof generators / sizeof generators[0]);&lt;br /&gt;
       if (data == 0 || data_len == 0)&lt;br /&gt;
       {&lt;br /&gt;
           clprintf(CL_LOG_SEV_ERROR, &amp;quot;No event data generated.&amp;quot;);&lt;br /&gt;
           return SA_AIS_ERR_NO_MEMORY;&lt;br /&gt;
       }&lt;br /&gt;
       clprintf(CL_LOG_SEV_INFO,&amp;quot;Publishing Event: %.*s\n&amp;quot;,(int)data_len, data);&lt;br /&gt;
       rc = saEvtEventPublish(eventHandle, (void *)data, data_len, &amp;amp;eventId);&lt;br /&gt;
&lt;br /&gt;
       if (rc != SA_AIS_OK)&lt;br /&gt;
       {&lt;br /&gt;
           clprintf(CL_LOG_SEV_ERROR,&amp;quot;Event publish attempt failed with error [%x]&amp;quot;, rc);&lt;br /&gt;
       }&lt;br /&gt;
       clHeapFree(data);&lt;br /&gt;
&lt;br /&gt;
       return SA_AIS_OK;&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
There's code to call one of a list of generator functions.  The functions on the list, return a pointer and a length which are used to pass to &amp;lt;code&amp;gt;saEvtEventPublish&amp;lt;/code&amp;gt;.  We pass the eventHandle  prepared earlier with &amp;lt;code&amp;gt;saEvtEventAllocate&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;saEvtEventAttributesSet&amp;lt;/code&amp;gt;. Pass the pointer and the length that we get back from the generator function. Those are used to package up the event data and send it to any subscribers.  We also pass the address of the &amp;lt;code&amp;gt;eventId&amp;lt;/code&amp;gt; local variable.  This is required so that the &amp;lt;code&amp;gt;saEvtEventPublish&amp;lt;/code&amp;gt; function can return the event ID.  We don't need it, so we promptly drop it in the bit bucket.  Finally, we free the data that was allocated in the generator function and passed back as we no longer need it.&lt;br /&gt;
&lt;br /&gt;
'''Note:'''&lt;br /&gt;
&lt;br /&gt;
Before building the project,copy the common directory which can be found under            &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;/src/app&amp;lt;/code&amp;gt; to the working area&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/common  .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How to Run csa113 and What to Observe===&lt;br /&gt;
&lt;br /&gt;
In csa113 you will be observing an event publishing application. This will be far more interesting if you observe an event subscription application at the same time. For this we will use the example from csa112.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First you should start up csa112 and put it in a LockAssignment state so that it can receive events.(Unlock csa212SGI0 instead of csa112SGI0 to run csa213).&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /root/asp/bin&lt;br /&gt;
 # ./asp_console&lt;br /&gt;
&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa112SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa112SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the csa112 application log you should see:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| $ /root/asp/var/log/csa112CompI0Log.latest &lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Mon Jul 14 22:50:34 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00037 :   INFO)&lt;br /&gt;
 csa112: Instantiated as component instance csa112CompI0.&lt;br /&gt;
Mon Jul 14 22:50:34 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00038 :   INFO)&lt;br /&gt;
 csa112CompI0: Waiting for CSI assignment...&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00041 :   INFO)&lt;br /&gt;
 Component [csa112CompI0] : PID [24830]. CSI Set Received&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00042 :   INFO)&lt;br /&gt;
    CSI Flags               : [Add One]&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00043 :   INFO)&lt;br /&gt;
    CSI Name                : [csa112CSII0]&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00044 :   INFO)&lt;br /&gt;
    Name Value Pairs        :&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00045 :   INFO)&lt;br /&gt;
    HA State                : [Active]&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00046 :   INFO)&lt;br /&gt;
    Active Descriptor       :&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00047 :   INFO)&lt;br /&gt;
      Transition Descriptor : [1]&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00048 :   INFO)&lt;br /&gt;
        Active Component    : [csa112CompI0]&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00049 :   INFO)&lt;br /&gt;
 csa112: ACTIVE state requested; activating service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
[[File:OpenClovis_Note.png]]When running model csa212 you will not see the output described above for the the amsLockAssignment and amsUnlock commands. Unlock csa212SGI0 instead of csa112SGI0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now you can start up the event publishing application and put it in a LockAssignment state. (Unlock csa213SGI0 instead of csa113SGI0 to run csa213).&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa113SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa113SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting csa113 into a LockAssignment state caused it to begin publishing events. Using &amp;lt;code&amp;gt;tail -f /root/asp/var/log/csa113CompI0Log.latest&amp;lt;/code&amp;gt; on the csa113 application log you can see the events being published.(Unlock csa213SGI0 instead of csa113SGI0 to run SAF version).&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| $ /root/asp/var/log/csa113CompI0Log.latest &lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Mon Jul 14 22:53:54 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00028 :   INFO)&lt;br /&gt;
 Component [csa113CompI0] : PID [24890]. Initializing&lt;br /&gt;
Mon Jul 14 22:53:54 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00029 :   INFO)&lt;br /&gt;
    IOC Address             : 0x1&lt;br /&gt;
Mon Jul 14 22:53:54 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00030 :   INFO)&lt;br /&gt;
    IOC Port                : 0x81&lt;br /&gt;
Mon Jul 14 22:53:54 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00037 :   INFO)&lt;br /&gt;
 Instantiated as component instance csa113CompI0.&lt;br /&gt;
Mon Jul 14 22:53:54 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00038 :   INFO)&lt;br /&gt;
 csa113CompI0: Waiting for CSI assignment...&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00041 :   INFO)&lt;br /&gt;
 Component [csa113CompI0] : PID [24890]. CSI Set Received&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00042 :   INFO)&lt;br /&gt;
    CSI Flags               : [Add One]&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00043 :   INFO)&lt;br /&gt;
    CSI Name                : [csa113CSII0]&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00044 :   INFO)&lt;br /&gt;
    Name Value Pairs        :&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00045 :   INFO)&lt;br /&gt;
    HA State                : [Active]&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00046 :   INFO)&lt;br /&gt;
    Active Descriptor       :&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00047 :   INFO)&lt;br /&gt;
      Transition Descriptor : [1]&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00048 :   INFO)&lt;br /&gt;
        Active Component    : [csa113CompI0]&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00049 :   INFO)&lt;br /&gt;
 csa113: ACTIVE state requested; activating service&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00050 : NOTICE)&lt;br /&gt;
 Publishing Event: Mon Jul 14 22:53:59 2008&lt;br /&gt;
Mon Jul 14 22:54:00 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00052 : NOTICE)&lt;br /&gt;
 Publishing Event: 0.05 0.07 0.03&lt;br /&gt;
Mon Jul 14 22:54:01 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00054 : NOTICE)&lt;br /&gt;
 Publishing Event: Mon Jul 14 22:54:01 2008&lt;br /&gt;
Mon Jul 14 22:54:02 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00056 : NOTICE)&lt;br /&gt;
 Publishing Event: 0.05 0.07 0.03&lt;br /&gt;
Mon Jul 14 22:54:03 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00058 : NOTICE)&lt;br /&gt;
 Publishing Event: Mon Jul 14 22:54:03 2008&lt;br /&gt;
Mon Jul 14 22:54:04 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00060 : NOTICE)&lt;br /&gt;
 Publishing Event: 0.05 0.07 0.03&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Since the event subscriber application is also running you can see the events that it is receiving in the csa112 application log file. Again using &amp;lt;code&amp;gt;tail -f /rootasp//var/log/csa112CompI0Log.latest&amp;lt;/code&amp;gt; you can see the following:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa112CompI0Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00052 : NOTICE)&lt;br /&gt;
 We've got an event to receive&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00054 : NOTICE)&lt;br /&gt;
 received event: Mon Jul 14 22:53:59 2008&lt;br /&gt;
Mon Jul 14 22:54:00 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00058 : NOTICE)&lt;br /&gt;
 We've got an event to receive&lt;br /&gt;
Mon Jul 14 22:54:00 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00060 : NOTICE)&lt;br /&gt;
 received event: 0.05 0.07 0.03&lt;br /&gt;
Mon Jul 14 22:54:01 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00064 : NOTICE)&lt;br /&gt;
 We've got an event to receive&lt;br /&gt;
Mon Jul 14 22:54:01 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00066 : NOTICE)&lt;br /&gt;
 received event: Mon Jul 14 22:54:01 2008&lt;br /&gt;
Mon Jul 14 22:54:02 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00070 : NOTICE)&lt;br /&gt;
 We've got an event to receive&lt;br /&gt;
Mon Jul 14 22:54:02 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00072 : NOTICE)&lt;br /&gt;
 received event: 0.05 0.07 0.03&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now you can shut everything down in the usual manner. Note that you will be shutting down two service groups.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa113SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa112SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa113SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa112SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; end&lt;br /&gt;
cli[Test]-&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summary and References===&lt;br /&gt;
&lt;br /&gt;
We've seen how to initialize the event manager subsystem as an event publisher.  We've seen:&lt;br /&gt;
*events flow from the event publisher to the subscriber.  &lt;br /&gt;
*how to format events and send them through the event manager subsystem&lt;br /&gt;
*For further reading, check the same sources as listed under the csa112 section.&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/evalguide/csa113</id>
		<title>Doc:latest/evalguide/csa113</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/evalguide/csa113"/>
				<updated>2014-11-17T06:38:12Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==csa113 Event Publication==&lt;br /&gt;
&lt;br /&gt;
===Objective===&lt;br /&gt;
&lt;br /&gt;
The objective is to learn how to write an event publishing application using Clovis' Event Manager API.&lt;br /&gt;
&lt;br /&gt;
===What You Will Learn===&lt;br /&gt;
&lt;br /&gt;
*You will learn how to publish events using Clovis' Event Manager API.&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
        ...&lt;br /&gt;
        const SaEvtCallbacksT evtCallbacks =&lt;br /&gt;
        {&lt;br /&gt;
            NULL,  /* Event open callback */&lt;br /&gt;
            csa112Comp_appEventCallback  /* Event delivery callback */&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        /* Initialize AMF client library. */&lt;br /&gt;
    if ( (rc = saAmfInitialize(&amp;amp;amfHandle, &amp;amp;callbacks, &amp;amp;version)) != SA_AIS_OK)&lt;br /&gt;
        errorExit(rc);&lt;br /&gt;
&lt;br /&gt;
        ....&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function of this example we again see a call to &amp;lt;code&amp;gt;saAmfInitialize&amp;lt;/code&amp;gt;. Everything initializeAmf function is the same as before in csa112.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        // Open an event chanel so that we can subscribe to events on that channel&lt;br /&gt;
        rc = saEvtChannelOpen(evtLibHandle, &lt;br /&gt;
                &amp;amp;evtChannelName, &lt;br /&gt;
                (SA_EVT_CHANNEL_PUBLISHER | &lt;br /&gt;
                 SA_EVT_CHANNEL_SUBSCRIBER | &lt;br /&gt;
                 SA_EVT_CHANNEL_CREATE), &lt;br /&gt;
                (SaTimeT)SA_TIME_END, &lt;br /&gt;
                &amp;amp;evtChannelHandle);&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Here we open the event channel.  This is the same as in csa112.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        rc = saEvtEventAllocate(evtChannelHandle, &amp;amp;eventHandle);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to allocate event [0x%x]\n&amp;quot;, rc);&lt;br /&gt;
            assert(0);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        rc = saEvtEventAttributesSet(eventHandle, &lt;br /&gt;
               NULL, &lt;br /&gt;
               1, &lt;br /&gt;
               0, &lt;br /&gt;
               &amp;amp;publisherName);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to set event attributes [0x%x]\n&amp;quot;,rc);&lt;br /&gt;
            assert(0);            &lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;code&amp;gt;saEvtEventAllocate&amp;lt;/code&amp;gt; allocates an event header.  This header is identified by the event handle passed back to &amp;lt;code&amp;gt;gTestInfo.eventHandle&amp;lt;/code&amp;gt;.  The handle should be used any time the event header is to be used to manipulate the header, either by using &amp;lt;code&amp;gt;saEvtEventAttributesSet&amp;lt;/code&amp;gt; (right below), or to send an event using the header as in &amp;lt;code&amp;gt;saEvtEventPublish&amp;lt;/code&amp;gt;.  The call to &amp;lt;code&amp;gt;saEvtEventAttributesSet&amp;lt;/code&amp;gt; defines defines the priority to be 1 which is just below the highest priority of &amp;lt;code&amp;gt;CL_EVENT_HIGHEST_PRIORITY&amp;lt;/code&amp;gt; which is defined as 0 where &amp;lt;code&amp;gt;CL_EVENT_LOWEST_PRIORITY&amp;lt;/code&amp;gt; is defined as 3.  The retention time is specified as 0 since we don't want the event to be kept around if there is no subscriber to pick it up.  Finally the &amp;lt;code&amp;gt;publisherName&amp;lt;/code&amp;gt; is specified because it's required.  Our subscriber doesn't care who publishes the events it receives.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    int&lt;br /&gt;
    main(int argc, &lt;br /&gt;
         char *argv[])&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        while (!unblockNow)&lt;br /&gt;
        {&lt;br /&gt;
            /* csa113: If I am active then I'll publish an event.&lt;br /&gt;
            Note, any application can publish and event regardless of&lt;br /&gt;
            HA state.  This tutorial simply uses HA state so only&lt;br /&gt;
            one of the two processes are publishing.&lt;br /&gt;
            */&lt;br /&gt;
        &lt;br /&gt;
            if (running &amp;amp;&amp;amp; ha_state == SA_AMF_HA_ACTIVE)&lt;br /&gt;
            {&lt;br /&gt;
                csa113Comp_PublishEvent();&lt;br /&gt;
            }&lt;br /&gt;
            /* Keep the event publish rate reasonable for this tutorial*/&lt;br /&gt;
            sleep(1);  &lt;br /&gt;
        }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Here is the main loop. As long as the application is running and active we make a call to &amp;lt;code&amp;gt;csa113Comp_PublishEvent&amp;lt;/code&amp;gt;.  The work of the application takes place in &amp;lt;code&amp;gt;csa113Comp_PublishEvent&amp;lt;/code&amp;gt;, which is presented below.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    static SaAisErrorT &lt;br /&gt;
    csa113Comp_PublishEvent()&lt;br /&gt;
    {&lt;br /&gt;
        SaEvtEventIdT   eventId         = 0;&lt;br /&gt;
        static int      index           = 0;&lt;br /&gt;
        SaSizeT         data_len        = 0;&lt;br /&gt;
        SaAisErrorT	rc              = SA_AIS_OK;&lt;br /&gt;
        char            *data           = 0;&lt;br /&gt;
        typedef void (*Generator)(char **, ClSizeT*);&lt;br /&gt;
&lt;br /&gt;
       // Note: to add a new generator, just define it above and then include&lt;br /&gt;
       // the new functions name in the generators list.&lt;br /&gt;
       // Next, maybe something that gets disk free info by way of getfsent&lt;br /&gt;
       // and statfs?&lt;br /&gt;
&lt;br /&gt;
       static Generator generators[]   =&lt;br /&gt;
       {&lt;br /&gt;
           generate_time_of_day,&lt;br /&gt;
           generate_load_average&lt;br /&gt;
       };&lt;br /&gt;
&lt;br /&gt;
       // every time through increment index and then set index to&lt;br /&gt;
       // it's value modulo the number of entries in the generators&lt;br /&gt;
       // array.  This will cause us to cycle through the list of&lt;br /&gt;
       // generators as we're called to publish events.&lt;br /&gt;
       (*generators[index++])(&amp;amp;data, &amp;amp;data_len);&lt;br /&gt;
       index %= (int)(sizeof generators / sizeof generators[0]);&lt;br /&gt;
       if (data == 0 || data_len == 0)&lt;br /&gt;
       {&lt;br /&gt;
           clprintf(CL_LOG_SEV_ERROR, &amp;quot;No event data generated.&amp;quot;);&lt;br /&gt;
           return SA_AIS_ERR_NO_MEMORY;&lt;br /&gt;
       }&lt;br /&gt;
       clprintf(CL_LOG_SEV_INFO,&amp;quot;Publishing Event: %.*s\n&amp;quot;,(int)data_len, data);&lt;br /&gt;
       rc = saEvtEventPublish(eventHandle, (void *)data, data_len, &amp;amp;eventId);&lt;br /&gt;
&lt;br /&gt;
       if (rc != SA_AIS_OK)&lt;br /&gt;
       {&lt;br /&gt;
           clprintf(CL_LOG_SEV_ERROR,&amp;quot;Event publish attempt failed with error [%x]&amp;quot;, rc);&lt;br /&gt;
       }&lt;br /&gt;
       clHeapFree(data);&lt;br /&gt;
&lt;br /&gt;
       return SA_AIS_OK;&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
There's code to call one of a list of generator functions.  The functions on the list, return a pointer and a length which are used to pass to &amp;lt;code&amp;gt;saEvtEventPublish&amp;lt;/code&amp;gt;.  We pass the eventHandle  prepared earlier with &amp;lt;code&amp;gt;saEvtEventAllocate&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;saEvtEventAttributesSet&amp;lt;/code&amp;gt;. Pass the pointer and the length that we get back from the generator function. Those are used to package up the event data and send it to any subscribers.  We also pass the address of the &amp;lt;code&amp;gt;eventId&amp;lt;/code&amp;gt; local variable.  This is required so that the &amp;lt;code&amp;gt;saEvtEventPublish&amp;lt;/code&amp;gt; function can return the event ID.  We don't need it, so we promptly drop it in the bit bucket.  Finally, we free the data that was allocated in the generator function and passed back as we no longer need it.&lt;br /&gt;
&lt;br /&gt;
'''Note:'''&lt;br /&gt;
&lt;br /&gt;
Before building the project,copy the common directory which can be found under            &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;/src/app&amp;lt;/code&amp;gt; to the working area&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/common  .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===csa213 SA Forum Compliant Event Publication===&lt;br /&gt;
&lt;br /&gt;
This sample application demonstrates the usage of SA Forum Event Service. As mentioned previously, this sample application does not deviate functionally with csa113. The code differences are due to using SA Forum data types (structures) and APIs , as presented in the following two tables. (Note we have not repeated data types and APIs covered previously.)&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot;| '''SA Forum Data Types with the SAFplus Platform equivalent'''&lt;br /&gt;
|- style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
!SA Forum Data Types   &lt;br /&gt;
!OpenClovis Data Types&lt;br /&gt;
|-&lt;br /&gt;
|SaEvtHandleT&lt;br /&gt;
|ClEventHandleT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot;| '''SA Forum APIs with the SAFplus Platform equivalent'''&lt;br /&gt;
|- style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
!SA Forum APIs&lt;br /&gt;
!OpenClovis APIs&lt;br /&gt;
|-&lt;br /&gt;
|SaEvtEventAllocate&lt;br /&gt;
|ClEventAllocate&lt;br /&gt;
|-&lt;br /&gt;
|saEvtEventAttributesSet&lt;br /&gt;
|clEventExtAttributesSet&lt;br /&gt;
|-&lt;br /&gt;
|saEvtEventPublish&lt;br /&gt;
|clEventPublish&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===How to Run csa113 and What to Observe===&lt;br /&gt;
&lt;br /&gt;
In csa113 you will be observing an event publishing application. This will be far more interesting if you observe an event subscription application at the same time. For this we will use the example from csa112.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First you should start up csa112 and put it in a LockAssignment state so that it can receive events.(Unlock csa212SGI0 instead of csa112SGI0 to run csa213).&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /root/asp/bin&lt;br /&gt;
 # ./asp_console&lt;br /&gt;
&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa112SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa112SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the csa112 application log you should see:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| $ /root/asp/var/log/csa112CompI0Log.latest &lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Mon Jul 14 22:50:34 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00037 :   INFO)&lt;br /&gt;
 csa112: Instantiated as component instance csa112CompI0.&lt;br /&gt;
Mon Jul 14 22:50:34 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00038 :   INFO)&lt;br /&gt;
 csa112CompI0: Waiting for CSI assignment...&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00041 :   INFO)&lt;br /&gt;
 Component [csa112CompI0] : PID [24830]. CSI Set Received&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00042 :   INFO)&lt;br /&gt;
    CSI Flags               : [Add One]&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00043 :   INFO)&lt;br /&gt;
    CSI Name                : [csa112CSII0]&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00044 :   INFO)&lt;br /&gt;
    Name Value Pairs        :&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00045 :   INFO)&lt;br /&gt;
    HA State                : [Active]&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00046 :   INFO)&lt;br /&gt;
    Active Descriptor       :&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00047 :   INFO)&lt;br /&gt;
      Transition Descriptor : [1]&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00048 :   INFO)&lt;br /&gt;
        Active Component    : [csa112CompI0]&lt;br /&gt;
Mon Jul 14 22:51:20 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00049 :   INFO)&lt;br /&gt;
 csa112: ACTIVE state requested; activating service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
[[File:OpenClovis_Note.png]]When running model csa212 you will not see the output described above for the the amsLockAssignment and amsUnlock commands. Unlock csa212SGI0 instead of csa112SGI0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now you can start up the event publishing application and put it in a LockAssignment state. (Unlock csa213SGI0 instead of csa113SGI0 to run csa213).&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa113SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa113SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Putting csa113 into a LockAssignment state caused it to begin publishing events. Using &amp;lt;code&amp;gt;tail -f /root/asp/var/log/csa113CompI0Log.latest&amp;lt;/code&amp;gt; on the csa113 application log you can see the events being published.(Unlock csa213SGI0 instead of csa113SGI0 to run SAF version).&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| $ /root/asp/var/log/csa113CompI0Log.latest &lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Mon Jul 14 22:53:54 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00028 :   INFO)&lt;br /&gt;
 Component [csa113CompI0] : PID [24890]. Initializing&lt;br /&gt;
Mon Jul 14 22:53:54 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00029 :   INFO)&lt;br /&gt;
    IOC Address             : 0x1&lt;br /&gt;
Mon Jul 14 22:53:54 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00030 :   INFO)&lt;br /&gt;
    IOC Port                : 0x81&lt;br /&gt;
Mon Jul 14 22:53:54 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00037 :   INFO)&lt;br /&gt;
 Instantiated as component instance csa113CompI0.&lt;br /&gt;
Mon Jul 14 22:53:54 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00038 :   INFO)&lt;br /&gt;
 csa113CompI0: Waiting for CSI assignment...&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00041 :   INFO)&lt;br /&gt;
 Component [csa113CompI0] : PID [24890]. CSI Set Received&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00042 :   INFO)&lt;br /&gt;
    CSI Flags               : [Add One]&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00043 :   INFO)&lt;br /&gt;
    CSI Name                : [csa113CSII0]&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00044 :   INFO)&lt;br /&gt;
    Name Value Pairs        :&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00045 :   INFO)&lt;br /&gt;
    HA State                : [Active]&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00046 :   INFO)&lt;br /&gt;
    Active Descriptor       :&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00047 :   INFO)&lt;br /&gt;
      Transition Descriptor : [1]&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00048 :   INFO)&lt;br /&gt;
        Active Component    : [csa113CompI0]&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00049 :   INFO)&lt;br /&gt;
 csa113: ACTIVE state requested; activating service&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00050 : NOTICE)&lt;br /&gt;
 Publishing Event: Mon Jul 14 22:53:59 2008&lt;br /&gt;
Mon Jul 14 22:54:00 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00052 : NOTICE)&lt;br /&gt;
 Publishing Event: 0.05 0.07 0.03&lt;br /&gt;
Mon Jul 14 22:54:01 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00054 : NOTICE)&lt;br /&gt;
 Publishing Event: Mon Jul 14 22:54:01 2008&lt;br /&gt;
Mon Jul 14 22:54:02 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00056 : NOTICE)&lt;br /&gt;
 Publishing Event: 0.05 0.07 0.03&lt;br /&gt;
Mon Jul 14 22:54:03 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00058 : NOTICE)&lt;br /&gt;
 Publishing Event: Mon Jul 14 22:54:03 2008&lt;br /&gt;
Mon Jul 14 22:54:04 2008   (SCNodeI0.24890 : csa113CompEO.---.---.00060 : NOTICE)&lt;br /&gt;
 Publishing Event: 0.05 0.07 0.03&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Since the event subscriber application is also running you can see the events that it is receiving in the csa112 application log file. Again using &amp;lt;code&amp;gt;tail -f /rootasp//var/log/csa112CompI0Log.latest&amp;lt;/code&amp;gt; you can see the following:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa112CompI0Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00052 : NOTICE)&lt;br /&gt;
 We've got an event to receive&lt;br /&gt;
Mon Jul 14 22:53:59 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00054 : NOTICE)&lt;br /&gt;
 received event: Mon Jul 14 22:53:59 2008&lt;br /&gt;
Mon Jul 14 22:54:00 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00058 : NOTICE)&lt;br /&gt;
 We've got an event to receive&lt;br /&gt;
Mon Jul 14 22:54:00 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00060 : NOTICE)&lt;br /&gt;
 received event: 0.05 0.07 0.03&lt;br /&gt;
Mon Jul 14 22:54:01 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00064 : NOTICE)&lt;br /&gt;
 We've got an event to receive&lt;br /&gt;
Mon Jul 14 22:54:01 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00066 : NOTICE)&lt;br /&gt;
 received event: Mon Jul 14 22:54:01 2008&lt;br /&gt;
Mon Jul 14 22:54:02 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00070 : NOTICE)&lt;br /&gt;
 We've got an event to receive&lt;br /&gt;
Mon Jul 14 22:54:02 2008   (SCNodeI0.24830 : csa112CompEO.---.---.00072 : NOTICE)&lt;br /&gt;
 received event: 0.05 0.07 0.03&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now you can shut everything down in the usual manner. Note that you will be shutting down two service groups.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa113SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa112SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa113SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa112SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; end&lt;br /&gt;
cli[Test]-&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Summary and References===&lt;br /&gt;
&lt;br /&gt;
We've seen how to initialize the event manager subsystem as an event publisher.  We've seen:&lt;br /&gt;
*events flow from the event publisher to the subscriber.  &lt;br /&gt;
*how to format events and send them through the event manager subsystem&lt;br /&gt;
*For further reading, check the same sources as listed under the csa112 section.&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/evalguide/csa112</id>
		<title>Doc:latest/evalguide/csa112</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/evalguide/csa112"/>
				<updated>2014-11-17T05:07:43Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* csa212 SA Forum Compliant Event Subscription */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==csa112 Event Subscription==&lt;br /&gt;
&lt;br /&gt;
An event service is an communications mechanism organised around the categories of data rather then senders and receivers.  A &amp;quot;publisher&amp;quot; posts a message to a well-known event channel and all &amp;quot;subscribers&amp;quot; receive the message.  Publishers and subscribers do not need to know who each other are; they need only know the event channel name.  &lt;br /&gt;
&lt;br /&gt;
As the Messaging service is similar to mail, the Event service is similar to a bulletin board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Objective===&lt;br /&gt;
&lt;br /&gt;
The objective of csa112 is to learn how to use the SAFplus Platform event service to subscribe to events and to extract the relevant information from the events received by subscription.  &lt;br /&gt;
&lt;br /&gt;
===What you will learn===&lt;br /&gt;
&lt;br /&gt;
You will learn:&lt;br /&gt;
*how to initialize the event library&lt;br /&gt;
*how to subscribe to events&lt;br /&gt;
*how to receive events&lt;br /&gt;
*how to extract the event data&lt;br /&gt;
&lt;br /&gt;
The SAFplus Event service is SA-Forum compliant and this tutorial expects that you will refer to the relevant SA-Forum document for an in-depth description of the APIs used.&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&lt;br /&gt;
One difference to note between this application and previous ones is that this application will not have a main loop in &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt;.  Instead we will do our work in callback code.  This means that when we return from &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; we won't exit the application.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    SaNameT evtChannelName =&lt;br /&gt;
    {&lt;br /&gt;
        sizeof EVENT_CHANNEL_NAME -1,&lt;br /&gt;
        EVENT_CHANNEL_NAME&lt;br /&gt;
    };&lt;br /&gt;
 &lt;br /&gt;
    SaEvtChannelHandleT   evtChannelHandle = 0;&lt;br /&gt;
    SaEvtHandleT          evtLibHandle=0;&lt;br /&gt;
    SaEvtEventHandleT     eventHandle=0;&lt;br /&gt;
&lt;br /&gt;
    static void  csa112Comp_appEventCallback( SaEvtSubscriptionIdT subscriptionId, &lt;br /&gt;
                                              SaEvtEventHandleT eventHandle,&lt;br /&gt;
                                              SaSizeT eventDataSize);&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Here we define variables to hold the payload of our event. Note the initialization of the &amp;lt;code&amp;gt;evtChannelName&amp;lt;/code&amp;gt;.  The length is set to the length of the &amp;lt;code&amp;gt;EVENT_CHANNEL_NAME&amp;lt;/code&amp;gt; string WITHOUT including the &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; terminator.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        const SaEvtCallbacksT evtCallbacks =&lt;br /&gt;
        {&lt;br /&gt;
            NULL,  /* Event open callback */&lt;br /&gt;
            csa112Comp_appEventCallback  /* Event delivery callback */&lt;br /&gt;
        };&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        // publish our event callbacks&lt;br /&gt;
        rc = saEvtInitialize(&amp;amp;evtLibHandle, &amp;amp;evtCallbacks, &amp;amp;evtVersion);&lt;br /&gt;
        ...&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
We initialize the OpenClovis Event Manager with &amp;lt;code&amp;gt;saEvtInitialize&amp;lt;/code&amp;gt;.  We pass the address of the variable where we want the event handle stored.  We pass the address of our event callback functions structure.  Note that the only event callback function that we specify is &amp;lt;code&amp;gt;csa112Comp_appEventCallback&amp;lt;/code&amp;gt;.  We do not specify the other callback which is the Asynchronous channel open callback.  We specify &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; for that field of &amp;lt;code&amp;gt;evtCallbacks&amp;lt;/code&amp;gt; because we don't open our event channel asynchronously.:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        // Open an event chanel so that we can subscribe to events on that channel&lt;br /&gt;
        rc = saEvtChannelOpen(evtLibHandle, &amp;amp;evtChannelName, &lt;br /&gt;
                              (SA_EVT_CHANNEL_PUBLISHER | SA_EVT_CHANNEL_SUBSCRIBER | SA_EVT_CHANNEL_CREATE), &lt;br /&gt;
                              (SaTimeT)SA_TIME_END, &amp;amp;evtChannelHandle);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failure opening event channel [0x%x] at %ld&amp;quot;, rc, time(0L));&lt;br /&gt;
            errorExit(rc);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        rc = saEvtEventSubscribe(evtChannelHandle, NULL, 1);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to subscribe to event channel [0x%x]&amp;quot;,rc);&lt;br /&gt;
            errorExit(rc);&lt;br /&gt;
        }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Within the above code we open the channel synchronously.  We pass the handle we got back from &amp;lt;code&amp;gt;saEvtInitialize&amp;lt;/code&amp;gt;, the channel name we defined previously, flags that indicate this process is subscribing to the channel and it's a global channel, and that the channel should be created if it's not already there, a timeout value of &amp;quot;forever&amp;quot;, and the address of the location where the channel handle should be stored.  Then, we subscribe to a specific event stream on the event channel.  The &amp;lt;code&amp;gt;EVENT_TYPE&amp;lt;/code&amp;gt; constant is defined in &amp;lt;code&amp;gt;common/common.h&amp;lt;/code&amp;gt; as 5432.  This value is used by the event publisher when it sends events.  The constant 1 being passed simply identifies this specific subscription on this channel.  This value will be passed to our event delivery callback function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    static void &lt;br /&gt;
    csa112Comp_appEventCallback(SaEvtSubscriptionIdT subscriptionId,&lt;br /&gt;
                                SaEvtEventHandleT eventHandle, &lt;br /&gt;
                                SaSizeT eventDataSize)&lt;br /&gt;
    {&lt;br /&gt;
    &lt;br /&gt;
        SaAisErrorT     rc = SA_AIS_OK;&lt;br /&gt;
        static ClPtrT   resTest = 0;    &lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO,&amp;quot;We've got an event to receive\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        if (resTest != 0)&lt;br /&gt;
        {&lt;br /&gt;
            clHeapFree((char *)resTest);&lt;br /&gt;
            resTest = 0;&lt;br /&gt;
        }&lt;br /&gt;
        resTest = clHeapAllocate(eventDataSize + 1);&lt;br /&gt;
&lt;br /&gt;
        if (resTest == 0)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to allocate space for event&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        rc = saEvtEventDataGet(eventHandle, resTest, &amp;amp;eventDataSize);&lt;br /&gt;
&lt;br /&gt;
        if (rc!= SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to get event data [0x%x]&amp;quot;,rc);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        *(((char *)resTest) + eventDataSize) = 0;&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO,&amp;quot;received event: %s\n&amp;quot;, (char *)resTest);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The event delivery callback function is named &amp;lt;code&amp;gt;csa112Comp_appEventCallback&amp;lt;/code&amp;gt;. It checks whether our incoming data buffer needs to be deallocated.  If there is a buffer, it deallocates it and then allocates enough data to receive the incoming event data.  Then, we extract the data from the event into the newly allocated buffer using &amp;lt;code&amp;gt;clEventDataGet&amp;lt;/code&amp;gt;.  Finally, we print the event data we received using &amp;lt;code&amp;gt;clprintf&amp;lt;/code&amp;gt; which is another member of Clovis' OS Abstraction Layer.  As its name and usage suggest, it is the OSAL replacement for printf.&lt;br /&gt;
&lt;br /&gt;
'''Note:'''&lt;br /&gt;
&lt;br /&gt;
Before building the project,copy the common directory which can be found under            &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;/src/app&amp;lt;/code&amp;gt; to the working area&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/common  .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How to Run csa212 and What to Observe===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start example csa212 in the same manner that we have started previous examples, with the SAFplus Platform Console.(Unlock csa212SGI0 instead of csa112SGI0 to run csa212).&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /root/asp/bin&lt;br /&gt;
 # ./asp_console&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa212SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the log file for this example you should see the following.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa212CompI3Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00001 :   INFO) Component [csa212CompI3] : PID [10366]. Initializing&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00002 :   INFO)    IOC Address             : 0x4&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00003 :   INFO)    IOC Port                : 0x80&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:15:31.389 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00004 :   INFO) Component [csa212CompI3] : PID [10366]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now unlock the application with:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa212SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point you should see the following in the log.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa212CompI3Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 Fri Oct  1 13:15:31.389 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00012 :   INFO) csa212: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Thats all there is to this example. What you are looking at in the log is the output of our event listener. It doesn't appear very interesting because we have not yet written an event publisher that will give the program something to output. We'll do that in the next example (csa213).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point we can shut down our example in the usual fashion.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa212SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa212SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; end&lt;br /&gt;
cli[Test]-&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
[[File:OpenClovis_Note.png]]When running model csa212 you will not see the output described for the the amsLockAssignment and amsUnlock commands.&lt;br /&gt;
&lt;br /&gt;
===Summary and References===&lt;br /&gt;
&lt;br /&gt;
We've seen how to create a basic event subscriber application using Clovis' event manager library.  For further reading check the Clovis SAFplus Platform API reference guide, specifically the section on the event manager.  Also, the header file: &amp;lt;code&amp;gt;clEventExtApi.h&amp;lt;/code&amp;gt; should be helpful.&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/evalguide/csa102</id>
		<title>Doc:latest/evalguide/csa102</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/evalguide/csa102"/>
				<updated>2014-11-14T11:38:22Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* How to Run csa102 and What to Observe */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==csa102 Redundancy and Failover==&lt;br /&gt;
&lt;br /&gt;
===Objective===&lt;br /&gt;
&lt;br /&gt;
This sample demonstrates basic HA (High Availability) and SU (Service Unit) fail-over functionality.  The application has two components, both processing the same workload as csa101, that is, repeatedly printing &amp;quot;Hello World&amp;quot;.  The difference, however, is that in this case there is now an active component and a standby component, with only the active component performing the printing function.&lt;br /&gt;
&lt;br /&gt;
csa102 is quite similar to csa101, and this section will discuss the areas in which they deviate.&lt;br /&gt;
&lt;br /&gt;
===What you will learn===&lt;br /&gt;
&lt;br /&gt;
*Keeping track of HA states and how to respond to callbacks requesting HA state changes.&lt;br /&gt;
&lt;br /&gt;
===How to create new Project Model csa102===&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model for csa102(the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. This is same as created for ''csa101''.&lt;br /&gt;
&lt;br /&gt;
Create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE as follows:&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start cl-ide by specifying the full path&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code. Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE.&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model '''csa102''' for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.This step is similar compared to ''csa101''.&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
Enter the following information (These steps are similar compared to ''csa101''):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''. &lt;br /&gt;
&amp;lt;br&amp;gt;Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''SDK Location''': Enter the location where the SAFplus Platform SDK was installed. For e.g. if the SDK was installed at location /opt/clovis, then the SDK location is /opt/clovis/sdk-&amp;lt;version&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_csa102_AddBlade.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_csa102_AddNode.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_csa102_DefineProgramNames.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa102 continuously prints &amp;quot;Hello World!&amp;quot; '''redundantly''').&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa102' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa102SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_csa102_ServiceGroupDetails.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our redundant model (which only has one node with one Active component and another standby component used for redundancy) change the '''Redundancy Model''' to '2N Redundancy' as shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa102 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The third change that we want to make is to the '''Auto repair'''. The '''Auto repair''' defines the state of the component to be achieved after failure of the component. So our csa102 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa102'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_csa102_SAFComponentDetails.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
To make the model to recover from failure by Stand-by component, the field '''Recovery action on error''' needs to be changed to ''Component fail over''.&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' window will be displayed. If you now completely expand the AMF Configuration branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_csa102_AMFConfig.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&lt;br /&gt;
The code can be geneteted using the same steps as mentioned for csa101. The genetated code can be found within the following directory&lt;br /&gt;
 &amp;lt;project-area_dir&amp;gt;/eval/src/app/csa102Comp&lt;br /&gt;
&lt;br /&gt;
This sample component is implemented in a few C modules that are quite similar to the csa101 module.  We will discuss the additions in detail.&lt;br /&gt;
&lt;br /&gt;
We change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream.  To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;    &lt;br /&gt;
#include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
#define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, CL_LOG_AREA_UNSPECIFIED, CL_LOG_CONTEXT_UNSPECIFIED, __VA_ARGS__)&lt;br /&gt;
...&lt;br /&gt;
ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the application's &amp;quot;main&amp;quot; function:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;   &lt;br /&gt;
    /*&lt;br /&gt;
     * Initialize the log stream&lt;br /&gt;
     */&lt;br /&gt;
    clEvalAppLogStreamOpen((ClCharT*)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This function is implemented in the src/app/ev.c file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As with csa102, the &amp;lt;code&amp;gt;safAssignWork()&amp;lt;/code&amp;gt; function is called to set the component's HA state, and the following block of code assigns this requested state to the component, while verbosely detailing this process:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                        const SaNameT       *compName,&lt;br /&gt;
                        SaAmfHAStateT       haState,&lt;br /&gt;
                        SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;, &lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            &lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa102: ACTIVE state requested; activating service&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
            &lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa102: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa102: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa102: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
In this case the application spawns a thread when it is assigned active which is a very common strategy for threaded applications.  It also sets a global variable &amp;quot;running&amp;quot; to true.  When the application is &amp;quot;quesced&amp;quot; -- that is when the active work assignment is taken away -- the application sets this global variable back to 0 to trigger the active thread to quit itself.  The thread is simply defined as:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO,&amp;quot;csa102: Threaded Hello World! %s&amp;quot;, show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static char* show_progress(void)&lt;br /&gt;
{&lt;br /&gt;
    static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
    static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
    /* Show a little progress bar */&lt;br /&gt;
    return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
}&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds)) saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        &lt;br /&gt;
        if (running) clprintf(CL_LOG_SEV_INFO,&amp;quot;csa102: Unthreaded Hello World! %s&amp;quot;, show_progress());  // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        else clprintf(CL_LOG_SEV_INFO,&amp;quot;csa102: idle&amp;quot;);&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===How to Run csa102 and What to Observe===&lt;br /&gt;
&lt;br /&gt;
As with the csa102 example we will use the SAFplus Platform Console to manipulate the administrative state of the csa102 service group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start the SAFplus Platform Console&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /root/asp/bin&lt;br /&gt;
 # ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Then put the csa102SGI0 service group into lock assignment state using the following commands.&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 cli[Test]-&amp;gt; setc 1&lt;br /&gt;
 cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
 cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa102SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because example 102 has two components there will be two application log files to view.  These are &amp;lt;code&amp;gt;/root/asp/var/log/csa102I0Log.latest&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/root/asp/var/log/csa102I1Log.latest&amp;lt;/code&amp;gt;.  Viewing these application logs using the &amp;lt;code&amp;gt;tail -f&amp;lt;/code&amp;gt;, you should see the following.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa102I0Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Fri Nov 14 16:54:40.339 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa102I0] : PID [22012]. Initializing&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:54:40.340 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:54:40.340 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:54:42.342 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa102: idle&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa102I1Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Fri Nov 14 16:54:40.347 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa102I1] : PID [22013]. Initializing&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:54:40.347 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:54:40.347 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x82&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:54:42.350 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa102: idle&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next, unlock the service group using the following SAFplus Platform Console command.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa102SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
and in the /var/log/csa102I*.log files we should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa102I0Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Fri Nov 14 16:55:21.816 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00024 :   INFO) &lt;br /&gt;
 Component [csa102I0] : PID [22012]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.816 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00025 :   INFO) &lt;br /&gt;
 CSI Flags : [Add One]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.816 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00026 :   INFO) &lt;br /&gt;
 CSI Name : [csa102CSII0]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.816 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00027 :   INFO) &lt;br /&gt;
 Name value pairs :&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.816 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00028 :   INFO) &lt;br /&gt;
 HA state : [Active]&lt;br /&gt;
Fri Nov 14 16:55:21.816 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00029 :   INFO) &lt;br /&gt;
 Active Descriptor :&lt;br /&gt;
Fri Nov 14 16:55:21.816 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00030 :   INFO) &lt;br /&gt;
 Transition Descriptor : [1]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.816 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00031 :   INFO) &lt;br /&gt;
 Active Component : [csa102I0]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.816 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00032 :   INFO) &lt;br /&gt;
 csa102: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.818 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00033 :   INFO) &lt;br /&gt;
 csa102: Unthreaded Hello World! .&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.818 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00034 :   INFO) &lt;br /&gt;
 csa102: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:23.818 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00035 :   INFO) &lt;br /&gt;
 csa102: Threaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:23.821 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00036 :   INFO) &lt;br /&gt;
 csa102: Unthreaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:25.819 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00037 :   INFO) &lt;br /&gt;
 csa102: Threaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:25.823 2014 (SCNodeI0.22012 : csa102I0.MAI.---.00038 :   INFO) &lt;br /&gt;
 csa102: Unthreaded Hello World!      .&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa102I1Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Fri Nov 14 16:55:21.855 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00024 :   INFO) &lt;br /&gt;
 Component [csa102I1] : PID [22013]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.855 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00025 :   INFO) &lt;br /&gt;
 CSI Flags : [Add One]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.855 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00026 :   INFO) &lt;br /&gt;
 CSI Name : [csa102CSII0]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.855 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00027 :   INFO) Name value pairs :&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.855 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00028 :   INFO) &lt;br /&gt;
 HA state : [Standby]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.855 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00029 :   INFO) &lt;br /&gt;
 Standby Descriptor :&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.855 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00030 :   INFO) &lt;br /&gt;
 Standby Rank : [1]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.855 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00031 :   INFO) &lt;br /&gt;
 Active Component : [csa102I0]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.855 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00032 :   INFO) &lt;br /&gt;
 csa102: Standby state requested&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:55:21.855 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00033 :   INFO) &lt;br /&gt;
 csa102: idle&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
These can be watched in a separate terminal window using &amp;lt;code&amp;gt;tail -f&amp;lt;/code&amp;gt;.  csa102I0 is the active component in this case, and csa102I1 is the standby.  Consequently, the &amp;quot;Hello world!&amp;quot; lines appear in csa102I0.log and not in csa102I1.log.  They will continue to be logged to that file until the HA state of that component changes, for example, when the process logging those lines is killed.  In the mean time the standby component: csa102I1 just waits until it is told that it should take over the workload.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Changing the HA state of the Client/Server'''&lt;br /&gt;
&lt;br /&gt;
The easiest way to test component fail-over is to kill the process associated with the active component using the &amp;lt;code&amp;gt;kill&amp;lt;/code&amp;gt; command.  For this you need to know the process ID of the active component. To find the process ID issue the following command from a bash shell.&lt;br /&gt;
 # ps -eaf | grep csa102&lt;br /&gt;
This should produce an output that looks similar to the following.&lt;br /&gt;
 root     22012 21797  0 16:54 ?        00:00:00 /root/asp/bin/csa102 -p&lt;br /&gt;
 root     22013 21797  0 16:54 ?        00:00:00 /root/asp/bin/csa102 -p&lt;br /&gt;
 root     22089  2321  0 16:55 pts/0    00:00:00 grep --color=auto csa102&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice the two entries that end with &amp;lt;code&amp;gt;csa102 -p&amp;lt;/code&amp;gt;. These are our two component processes. The first one is usually the active process. This is the one that we will kill. In this case the process ID is 22012. So to kill the active component you issue the command:&lt;br /&gt;
 # kill -9 22012&lt;br /&gt;
[[File:OpenClovis_Note.png]]If this step does not result in the active component being killed then it is likely that the standby component was killed. In this case simply try killing the other process.&lt;br /&gt;
&lt;br /&gt;
After executing the &amp;lt;code&amp;gt;kill&amp;lt;/code&amp;gt; command you can see in the csa102I1 application that the standby component is now active.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa102I1Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Fri Nov 14 16:56:00.257 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00053 :   INFO) &lt;br /&gt;
 Component [csa102I1] : PID [22013]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.257 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00054 :   INFO) &lt;br /&gt;
 CSI Flags : [Target All]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.257 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00055 :   INFO) &lt;br /&gt;
 HA state : [Active]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.257 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00056 :   INFO) &lt;br /&gt;
 Active Descriptor :&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.257 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00057 :   INFO) &lt;br /&gt;
 Transition Descriptor : [3]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.257 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00058 :   INFO) &lt;br /&gt;
 Active Component : [csa102I0]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.257 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00059 :   INFO) &lt;br /&gt;
 csa102: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.257 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00060 :   INFO) &lt;br /&gt;
 csa102: Unthreaded Hello World! .&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.257 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00061 :   INFO) &lt;br /&gt;
 csa102: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:02.258 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00062 :   INFO) &lt;br /&gt;
 csa102: Threaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:02.259 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00063 :   INFO) &lt;br /&gt;
 csa102: Unthreaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:04.259 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00064 :   INFO) &lt;br /&gt;
 csa102: Threaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:04.261 2014 (SCNodeI0.22013 : csa102I1.MAI.---.00065 :   INFO) &lt;br /&gt;
 csa102: Unthreaded Hello World!      .&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This indicates that the standby component has taken over for the failed active component.&lt;br /&gt;
&lt;br /&gt;
Looking in the csa102I0 application log you can see that this component was killed and has been restarted. Since csa102I1 took over as the active component this component now goes into the standby state.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa102I0Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Fri Nov 14 16:56:00.768 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa102I0] : PID [22096]. Initializing&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.768 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.768 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x83&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.769 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 Component [csa102I0] : PID [22096]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.769 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 CSI Flags : [Add One]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.769 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00006 :   INFO) &lt;br /&gt;
 CSI Name : [csa102CSII0]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.769 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00007 :   INFO) &lt;br /&gt;
 Name value pairs :&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.769 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00008 :   INFO) &lt;br /&gt;
 HA state : [Standby]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.769 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00009 :   INFO) &lt;br /&gt;
 Standby Descriptor :&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.769 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00010 :   INFO) &lt;br /&gt;
 Standby Rank : [1]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.769 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00011 :   INFO) &lt;br /&gt;
 Active Component : [csa102I1]&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.769 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00012 :   INFO) &lt;br /&gt;
 csa102: Standby state requested&lt;br /&gt;
&lt;br /&gt;
Fri Nov 14 16:56:00.772 2014 (SCNodeI0.22096 : csa102I0.MAI.---.00013 :   INFO) &lt;br /&gt;
 csa102: idle&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
You can continue to observe this failover by alternately killing the active component.&lt;br /&gt;
&lt;br /&gt;
To stop csa102 using the SAFplus Platform Console.&lt;br /&gt;
 cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa102SGI0&lt;br /&gt;
Successfully changed state of csa102SGI0 to LockAssignment&lt;br /&gt;
 cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa102SGI0&lt;br /&gt;
 cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
 cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
 cli[Test] -&amp;gt; bye&lt;br /&gt;
Successfully changed state of csa102SGI0 to LockInstantiation and exit.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
This Sample Application has covered basic HA and failover, with changing the state of a component to active and standby.&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/evalguide/csa112</id>
		<title>Doc:latest/evalguide/csa112</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/evalguide/csa112"/>
				<updated>2014-11-14T11:19:03Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==csa112 Event Subscription==&lt;br /&gt;
&lt;br /&gt;
An event service is an communications mechanism organised around the categories of data rather then senders and receivers.  A &amp;quot;publisher&amp;quot; posts a message to a well-known event channel and all &amp;quot;subscribers&amp;quot; receive the message.  Publishers and subscribers do not need to know who each other are; they need only know the event channel name.  &lt;br /&gt;
&lt;br /&gt;
As the Messaging service is similar to mail, the Event service is similar to a bulletin board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Objective===&lt;br /&gt;
&lt;br /&gt;
The objective of csa112 is to learn how to use the SAFplus Platform event service to subscribe to events and to extract the relevant information from the events received by subscription.  &lt;br /&gt;
&lt;br /&gt;
===What you will learn===&lt;br /&gt;
&lt;br /&gt;
You will learn:&lt;br /&gt;
*how to initialize the event library&lt;br /&gt;
*how to subscribe to events&lt;br /&gt;
*how to receive events&lt;br /&gt;
*how to extract the event data&lt;br /&gt;
&lt;br /&gt;
The SAFplus Event service is SA-Forum compliant and this tutorial expects that you will refer to the relevant SA-Forum document for an in-depth description of the APIs used.&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&lt;br /&gt;
One difference to note between this application and previous ones is that this application will not have a main loop in &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt;.  Instead we will do our work in callback code.  This means that when we return from &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; we won't exit the application.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    SaNameT evtChannelName =&lt;br /&gt;
    {&lt;br /&gt;
        sizeof EVENT_CHANNEL_NAME -1,&lt;br /&gt;
        EVENT_CHANNEL_NAME&lt;br /&gt;
    };&lt;br /&gt;
 &lt;br /&gt;
    SaEvtChannelHandleT   evtChannelHandle = 0;&lt;br /&gt;
    SaEvtHandleT          evtLibHandle=0;&lt;br /&gt;
    SaEvtEventHandleT     eventHandle=0;&lt;br /&gt;
&lt;br /&gt;
    static void  csa112Comp_appEventCallback( SaEvtSubscriptionIdT subscriptionId, &lt;br /&gt;
                                              SaEvtEventHandleT eventHandle,&lt;br /&gt;
                                              SaSizeT eventDataSize);&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Here we define variables to hold the payload of our event. Note the initialization of the &amp;lt;code&amp;gt;evtChannelName&amp;lt;/code&amp;gt;.  The length is set to the length of the &amp;lt;code&amp;gt;EVENT_CHANNEL_NAME&amp;lt;/code&amp;gt; string WITHOUT including the &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; terminator.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        const SaEvtCallbacksT evtCallbacks =&lt;br /&gt;
        {&lt;br /&gt;
            NULL,  /* Event open callback */&lt;br /&gt;
            csa112Comp_appEventCallback  /* Event delivery callback */&lt;br /&gt;
        };&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        // publish our event callbacks&lt;br /&gt;
        rc = saEvtInitialize(&amp;amp;evtLibHandle, &amp;amp;evtCallbacks, &amp;amp;evtVersion);&lt;br /&gt;
        ...&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
We initialize the OpenClovis Event Manager with &amp;lt;code&amp;gt;saEvtInitialize&amp;lt;/code&amp;gt;.  We pass the address of the variable where we want the event handle stored.  We pass the address of our event callback functions structure.  Note that the only event callback function that we specify is &amp;lt;code&amp;gt;csa112Comp_appEventCallback&amp;lt;/code&amp;gt;.  We do not specify the other callback which is the Asynchronous channel open callback.  We specify &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; for that field of &amp;lt;code&amp;gt;evtCallbacks&amp;lt;/code&amp;gt; because we don't open our event channel asynchronously.:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        // Open an event chanel so that we can subscribe to events on that channel&lt;br /&gt;
        rc = saEvtChannelOpen(evtLibHandle, &amp;amp;evtChannelName, &lt;br /&gt;
                              (SA_EVT_CHANNEL_PUBLISHER | SA_EVT_CHANNEL_SUBSCRIBER | SA_EVT_CHANNEL_CREATE), &lt;br /&gt;
                              (SaTimeT)SA_TIME_END, &amp;amp;evtChannelHandle);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failure opening event channel [0x%x] at %ld&amp;quot;, rc, time(0L));&lt;br /&gt;
            errorExit(rc);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        rc = saEvtEventSubscribe(evtChannelHandle, NULL, 1);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to subscribe to event channel [0x%x]&amp;quot;,rc);&lt;br /&gt;
            errorExit(rc);&lt;br /&gt;
        }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Within the above code we open the channel synchronously.  We pass the handle we got back from &amp;lt;code&amp;gt;saEvtInitialize&amp;lt;/code&amp;gt;, the channel name we defined previously, flags that indicate this process is subscribing to the channel and it's a global channel, and that the channel should be created if it's not already there, a timeout value of &amp;quot;forever&amp;quot;, and the address of the location where the channel handle should be stored.  Then, we subscribe to a specific event stream on the event channel.  The &amp;lt;code&amp;gt;EVENT_TYPE&amp;lt;/code&amp;gt; constant is defined in &amp;lt;code&amp;gt;common/common.h&amp;lt;/code&amp;gt; as 5432.  This value is used by the event publisher when it sends events.  The constant 1 being passed simply identifies this specific subscription on this channel.  This value will be passed to our event delivery callback function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    static void &lt;br /&gt;
    csa112Comp_appEventCallback(SaEvtSubscriptionIdT subscriptionId,&lt;br /&gt;
                                SaEvtEventHandleT eventHandle, &lt;br /&gt;
                                SaSizeT eventDataSize)&lt;br /&gt;
    {&lt;br /&gt;
    &lt;br /&gt;
        SaAisErrorT     rc = SA_AIS_OK;&lt;br /&gt;
        static ClPtrT   resTest = 0;    &lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO,&amp;quot;We've got an event to receive\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        if (resTest != 0)&lt;br /&gt;
        {&lt;br /&gt;
            clHeapFree((char *)resTest);&lt;br /&gt;
            resTest = 0;&lt;br /&gt;
        }&lt;br /&gt;
        resTest = clHeapAllocate(eventDataSize + 1);&lt;br /&gt;
&lt;br /&gt;
        if (resTest == 0)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to allocate space for event&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        rc = saEvtEventDataGet(eventHandle, resTest, &amp;amp;eventDataSize);&lt;br /&gt;
&lt;br /&gt;
        if (rc!= SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to get event data [0x%x]&amp;quot;,rc);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        *(((char *)resTest) + eventDataSize) = 0;&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO,&amp;quot;received event: %s\n&amp;quot;, (char *)resTest);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The event delivery callback function is named &amp;lt;code&amp;gt;csa112Comp_appEventCallback&amp;lt;/code&amp;gt;. It checks whether our incoming data buffer needs to be deallocated.  If there is a buffer, it deallocates it and then allocates enough data to receive the incoming event data.  Then, we extract the data from the event into the newly allocated buffer using &amp;lt;code&amp;gt;clEventDataGet&amp;lt;/code&amp;gt;.  Finally, we print the event data we received using &amp;lt;code&amp;gt;clprintf&amp;lt;/code&amp;gt; which is another member of Clovis' OS Abstraction Layer.  As its name and usage suggest, it is the OSAL replacement for printf.&lt;br /&gt;
&lt;br /&gt;
'''Note:'''&lt;br /&gt;
&lt;br /&gt;
Before building the project,copy the common directory which can be found under            &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;/src/app&amp;lt;/code&amp;gt; to the working area&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/common  .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===csa212 SA Forum Compliant Event Subscription===&lt;br /&gt;
&lt;br /&gt;
csa212 demonstrates the usage of SA Forum's Event Service. This sample application does not deviate functionally from csa112. The differences in code are due to using SA Forum data types (structures) and APIs , as presented in the following two tables. (Note we have not repeated data types and APIs covered previously.)&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot;| '''SA Forum Data Types with the SAFplus Platform equivalent'''&lt;br /&gt;
|- style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
!SA Forum Data Types   &lt;br /&gt;
!OpenClovis Data Types&lt;br /&gt;
|-&lt;br /&gt;
|SaEvtHandleT&lt;br /&gt;
|ClEventInitHandleT&lt;br /&gt;
|-&lt;br /&gt;
|SaEvtChannelHandleT&lt;br /&gt;
|ClEventChannelHandleT&lt;br /&gt;
|-&lt;br /&gt;
|SaEvtCallbacksT&lt;br /&gt;
|ClEventCallbacksT&lt;br /&gt;
|-&lt;br /&gt;
|SA_EVT_CHANNEL_SUBSCRIBER&lt;br /&gt;
|CL_EVENT_CHANNEL_SUBSCRIBER &lt;br /&gt;
|-&lt;br /&gt;
|SA_EVT_CHANNEL_CREATE&lt;br /&gt;
|CL_EVENT_CHANNEL_CREATE&lt;br /&gt;
|-&lt;br /&gt;
|SA_TIME_END&lt;br /&gt;
|CL_RMD_TIMEOUT_FOREVER &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot;| '''SA Forum APIs with the SAFplus Platform equivalent'''&lt;br /&gt;
|- style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
!SA Forum APIs&lt;br /&gt;
!OpenClovis APIs&lt;br /&gt;
|-&lt;br /&gt;
|SaEvtInitialize&lt;br /&gt;
|ClEventInitialize&lt;br /&gt;
|-&lt;br /&gt;
|saEvtChannelOpen&lt;br /&gt;
|clEventChannelOpen&lt;br /&gt;
|-&lt;br /&gt;
|saEvtEventSubscribe&lt;br /&gt;
|clEventExtSubscribe&lt;br /&gt;
|-&lt;br /&gt;
|saEvtEventDataGet&lt;br /&gt;
|clEventDataGet&lt;br /&gt;
|-&lt;br /&gt;
|saEvtChannelClose&lt;br /&gt;
|clEventChannelClose&lt;br /&gt;
|-&lt;br /&gt;
|saEvtFinalize&lt;br /&gt;
|clEventFinalize&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===How to Run csa212 and What to Observe===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start example csa212 in the same manner that we have started previous examples, with the SAFplus Platform Console.(Unlock csa212SGI0 instead of csa112SGI0 to run csa212).&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /root/asp/bin&lt;br /&gt;
 # ./asp_console&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa212SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the log file for this example you should see the following.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa212CompI3Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00001 :   INFO) Component [csa212CompI3] : PID [10366]. Initializing&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00002 :   INFO)    IOC Address             : 0x4&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00003 :   INFO)    IOC Port                : 0x80&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:15:31.389 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00004 :   INFO) Component [csa212CompI3] : PID [10366]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now unlock the application with:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa212SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point you should see the following in the log.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa212CompI3Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 Fri Oct  1 13:15:31.389 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00012 :   INFO) csa212: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Thats all there is to this example. What you are looking at in the log is the output of our event listener. It doesn't appear very interesting because we have not yet written an event publisher that will give the program something to output. We'll do that in the next example (csa213).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point we can shut down our example in the usual fashion.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa212SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa212SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; end&lt;br /&gt;
cli[Test]-&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
[[File:OpenClovis_Note.png]]When running model csa212 you will not see the output described for the the amsLockAssignment and amsUnlock commands.&lt;br /&gt;
&lt;br /&gt;
===Summary and References===&lt;br /&gt;
&lt;br /&gt;
We've seen how to create a basic event subscriber application using Clovis' event manager library.  For further reading check the Clovis SAFplus Platform API reference guide, specifically the section on the event manager.  Also, the header file: &amp;lt;code&amp;gt;clEventExtApi.h&amp;lt;/code&amp;gt; should be helpful.&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/evalguide/csa112</id>
		<title>Doc:latest/evalguide/csa112</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/evalguide/csa112"/>
				<updated>2014-11-14T11:09:10Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==csa112 Event Subscription==&lt;br /&gt;
&lt;br /&gt;
An event service is an communications mechanism organised around the categories of data rather then senders and receivers.  A &amp;quot;publisher&amp;quot; posts a message to a well-known event channel and all &amp;quot;subscribers&amp;quot; receive the message.  Publishers and subscribers do not need to know who each other are; they need only know the event channel name.  &lt;br /&gt;
&lt;br /&gt;
As the Messaging service is similar to mail, the Event service is similar to a bulletin board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Objective===&lt;br /&gt;
&lt;br /&gt;
The objective of csa112 is to learn how to use the SAFplus Platform event service to subscribe to events and to extract the relevant information from the events received by subscription.  &lt;br /&gt;
&lt;br /&gt;
===What you will learn===&lt;br /&gt;
&lt;br /&gt;
You will learn:&lt;br /&gt;
*how to initialize the event library&lt;br /&gt;
*how to subscribe to events&lt;br /&gt;
*how to receive events&lt;br /&gt;
*how to extract the event data&lt;br /&gt;
&lt;br /&gt;
The SAFplus Event service is SA-Forum compliant and this tutorial expects that you will refer to the relevant SA-Forum document for an in-depth description of the APIs used.&lt;br /&gt;
&lt;br /&gt;
===Code===&lt;br /&gt;
&lt;br /&gt;
One difference to note between this application and previous ones is that this application will not have a main loop in &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt;.  Instead we will do our work in callback code.  This means that when we return from &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; we won't exit the application.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    SaNameT evtChannelName =&lt;br /&gt;
    {&lt;br /&gt;
        sizeof EVENT_CHANNEL_NAME -1,&lt;br /&gt;
        EVENT_CHANNEL_NAME&lt;br /&gt;
    };&lt;br /&gt;
 &lt;br /&gt;
    SaEvtChannelHandleT   evtChannelHandle = 0;&lt;br /&gt;
    SaEvtHandleT          evtLibHandle=0;&lt;br /&gt;
    SaEvtEventHandleT     eventHandle=0;&lt;br /&gt;
&lt;br /&gt;
    static void  csa112Comp_appEventCallback( SaEvtSubscriptionIdT subscriptionId, &lt;br /&gt;
                                              SaEvtEventHandleT eventHandle,&lt;br /&gt;
                                              SaSizeT eventDataSize);&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Here we define variables to hold the payload of our event. Note the initialization of the &amp;lt;code&amp;gt;evtChannelName&amp;lt;/code&amp;gt;.  The length is set to the length of the &amp;lt;code&amp;gt;EVENT_CHANNEL_NAME&amp;lt;/code&amp;gt; string WITHOUT including the &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; terminator.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        const SaEvtCallbacksT evtCallbacks =&lt;br /&gt;
        {&lt;br /&gt;
            NULL,  /* Event open callback */&lt;br /&gt;
            csa112Comp_appEventCallback  /* Event delivery callback */&lt;br /&gt;
        };&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
        // publish our event callbacks&lt;br /&gt;
        rc = saEvtInitialize(&amp;amp;evtLibHandle, &amp;amp;evtCallbacks, &amp;amp;evtVersion);&lt;br /&gt;
        ...&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
We initialize the OpenClovis Event Manager with &amp;lt;code&amp;gt;saEvtInitialize&amp;lt;/code&amp;gt;.  We pass the address of the variable where we want the event handle stored.  We pass the address of our event callback functions structure.  Note that the only event callback function that we specify is &amp;lt;code&amp;gt;csa112Comp_appEventCallback&amp;lt;/code&amp;gt;.  We do not specify the other callback which is the Asynchronous channel open callback.  We specify &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; for that field of &amp;lt;code&amp;gt;evtCallbacks&amp;lt;/code&amp;gt; because we don't open our event channel asynchronously.:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    void&lt;br /&gt;
    initializeAmf(void)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        // Open an event chanel so that we can subscribe to events on that channel&lt;br /&gt;
        rc = saEvtChannelOpen(evtLibHandle, &amp;amp;evtChannelName, &lt;br /&gt;
                              (SA_EVT_CHANNEL_PUBLISHER | SA_EVT_CHANNEL_SUBSCRIBER | SA_EVT_CHANNEL_CREATE), &lt;br /&gt;
                              (SaTimeT)SA_TIME_END, &amp;amp;evtChannelHandle);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failure opening event channel [0x%x] at %ld&amp;quot;, rc, time(0L));&lt;br /&gt;
            errorExit(rc);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        rc = saEvtEventSubscribe(evtChannelHandle, NULL, 1);&lt;br /&gt;
        if (rc != SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to subscribe to event channel [0x%x]&amp;quot;,rc);&lt;br /&gt;
            errorExit(rc);&lt;br /&gt;
        }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Within the above code we open the channel synchronously.  We pass the handle we got back from &amp;lt;code&amp;gt;saEvtInitialize&amp;lt;/code&amp;gt;, the channel name we defined previously, flags that indicate this process is subscribing to the channel and it's a global channel, and that the channel should be created if it's not already there, a timeout value of &amp;quot;forever&amp;quot;, and the address of the location where the channel handle should be stored.  Then, we subscribe to a specific event stream on the event channel.  The &amp;lt;code&amp;gt;EVENT_TYPE&amp;lt;/code&amp;gt; constant is defined in &amp;lt;code&amp;gt;common/common.h&amp;lt;/code&amp;gt; as 5432.  This value is used by the event publisher when it sends events.  The constant 1 being passed simply identifies this specific subscription on this channel.  This value will be passed to our event delivery callback function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;| main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    static void &lt;br /&gt;
    csa112Comp_appEventCallback(SaEvtSubscriptionIdT subscriptionId,&lt;br /&gt;
                                SaEvtEventHandleT eventHandle, &lt;br /&gt;
                                SaSizeT eventDataSize)&lt;br /&gt;
    {&lt;br /&gt;
    &lt;br /&gt;
        SaAisErrorT     rc = SA_AIS_OK;&lt;br /&gt;
        static ClPtrT   resTest = 0;    &lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO,&amp;quot;We've got an event to receive\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        if (resTest != 0)&lt;br /&gt;
        {&lt;br /&gt;
            clHeapFree((char *)resTest);&lt;br /&gt;
            resTest = 0;&lt;br /&gt;
        }&lt;br /&gt;
        resTest = clHeapAllocate(eventDataSize + 1);&lt;br /&gt;
&lt;br /&gt;
        if (resTest == 0)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to allocate space for event&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        rc = saEvtEventDataGet(eventHandle, resTest, &amp;amp;eventDataSize);&lt;br /&gt;
&lt;br /&gt;
        if (rc!= SA_AIS_OK)&lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_ERROR, &amp;quot;Failed to get event data [0x%x]&amp;quot;,rc);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        *(((char *)resTest) + eventDataSize) = 0;&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO,&amp;quot;received event: %s\n&amp;quot;, (char *)resTest);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The event delivery callback function is named &amp;lt;code&amp;gt;csa112Comp_appEventCallback&amp;lt;/code&amp;gt;.  First it checks that the running variable is not zero and that the High Availability State is &amp;lt;code&amp;gt;CL_AMS_HA_STATE_ACTIVE&amp;lt;/code&amp;gt;, otherwise it returns, dropping the event in the bit bucket.  Next it checks whether our incoming data buffer needs to be deallocated.  If there is a buffer, it deallocates it and then allocates enough data to receive the incoming event data.  Then, we extract the data from the event into the newly allocated buffer using &amp;lt;code&amp;gt;clEventDataGet&amp;lt;/code&amp;gt;.  Finally, we print the event data we received using &amp;lt;code&amp;gt;clprintf&amp;lt;/code&amp;gt; which is another member of Clovis' OS Abstraction Layer.  As its name and usage suggest, it is the OSAL replacement for printf.&lt;br /&gt;
&lt;br /&gt;
'''Note:'''&lt;br /&gt;
&lt;br /&gt;
Before building the project,copy the common directory which can be found under            &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;/src/app&amp;lt;/code&amp;gt; to the working area&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/common  .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===csa212 SA Forum Compliant Event Subscription===&lt;br /&gt;
&lt;br /&gt;
csa212 demonstrates the usage of SA Forum's Event Service. This sample application does not deviate functionally from csa112. The differences in code are due to using SA Forum data types (structures) and APIs , as presented in the following two tables. (Note we have not repeated data types and APIs covered previously.)&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot;| '''SA Forum Data Types with the SAFplus Platform equivalent'''&lt;br /&gt;
|- style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
!SA Forum Data Types   &lt;br /&gt;
!OpenClovis Data Types&lt;br /&gt;
|-&lt;br /&gt;
|SaEvtHandleT&lt;br /&gt;
|ClEventInitHandleT&lt;br /&gt;
|-&lt;br /&gt;
|SaEvtChannelHandleT&lt;br /&gt;
|ClEventChannelHandleT&lt;br /&gt;
|-&lt;br /&gt;
|SaEvtCallbacksT&lt;br /&gt;
|ClEventCallbacksT&lt;br /&gt;
|-&lt;br /&gt;
|SA_EVT_CHANNEL_SUBSCRIBER&lt;br /&gt;
|CL_EVENT_CHANNEL_SUBSCRIBER &lt;br /&gt;
|-&lt;br /&gt;
|SA_EVT_CHANNEL_CREATE&lt;br /&gt;
|CL_EVENT_CHANNEL_CREATE&lt;br /&gt;
|-&lt;br /&gt;
|SA_TIME_END&lt;br /&gt;
|CL_RMD_TIMEOUT_FOREVER &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|+align=&amp;quot;bottom&amp;quot;| '''SA Forum APIs with the SAFplus Platform equivalent'''&lt;br /&gt;
|- style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
!SA Forum APIs&lt;br /&gt;
!OpenClovis APIs&lt;br /&gt;
|-&lt;br /&gt;
|SaEvtInitialize&lt;br /&gt;
|ClEventInitialize&lt;br /&gt;
|-&lt;br /&gt;
|saEvtChannelOpen&lt;br /&gt;
|clEventChannelOpen&lt;br /&gt;
|-&lt;br /&gt;
|saEvtEventSubscribe&lt;br /&gt;
|clEventExtSubscribe&lt;br /&gt;
|-&lt;br /&gt;
|saEvtEventDataGet&lt;br /&gt;
|clEventDataGet&lt;br /&gt;
|-&lt;br /&gt;
|saEvtChannelClose&lt;br /&gt;
|clEventChannelClose&lt;br /&gt;
|-&lt;br /&gt;
|saEvtFinalize&lt;br /&gt;
|clEventFinalize&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===How to Run csa212 and What to Observe===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start example csa212 in the same manner that we have started previous examples, with the SAFplus Platform Console.(Unlock csa212SGI0 instead of csa112SGI0 to run csa212).&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /root/asp/bin&lt;br /&gt;
 # ./asp_console&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa212SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the log file for this example you should see the following.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa212CompI3Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00001 :   INFO) Component [csa212CompI3] : PID [10366]. Initializing&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00002 :   INFO)    IOC Address             : 0x4&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:14:16.935 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00003 :   INFO)    IOC Port                : 0x80&lt;br /&gt;
&lt;br /&gt;
  Fri Oct  1 13:15:31.389 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00004 :   INFO) Component [csa212CompI3] : PID [10366]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now unlock the application with:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa212SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point you should see the following in the log.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa212CompI3Log.latest&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 Fri Oct  1 13:15:31.389 2010 (PayloadNodeI1.10366 : csa212CompEO.---.---.00012 :   INFO) csa212: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Thats all there is to this example. What you are looking at in the log is the output of our event listener. It doesn't appear very interesting because we have not yet written an event publisher that will give the program something to output. We'll do that in the next example (csa213).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point we can shut down our example in the usual fashion.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa212SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa212SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; end&lt;br /&gt;
cli[Test]-&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
[[File:OpenClovis_Note.png]]When running model csa212 you will not see the output described for the the amsLockAssignment and amsUnlock commands.&lt;br /&gt;
&lt;br /&gt;
===Summary and References===&lt;br /&gt;
&lt;br /&gt;
We've seen how to create a basic event subscriber application using Clovis' event manager library.  For further reading check the Clovis SAFplus Platform API reference guide, specifically the section on the event manager.  Also, the header file: &amp;lt;code&amp;gt;clEventExtApi.h&amp;lt;/code&amp;gt; should be helpful.&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T09:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Resource Editor View */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor1.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Component_Editor1.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Build_Configuration.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration TIPC Specific Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Make_Image_TIPC_Specific.png|frame|center| '''Make Images Configuration TIPC Specific Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration General Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Make_Images_General.png|frame|center| '''Make Images Configuration General Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_SCNodeI0.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101SUI0.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101I0.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List_csa101SGI0.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Associated_Service_Units.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_List_csa101SII0.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Component_Service_Instance_List_csa101CSII0.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T09:10:40Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Component Editor View */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Component_Editor1.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Build_Configuration.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration TIPC Specific Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Make_Image_TIPC_Specific.png|frame|center| '''Make Images Configuration TIPC Specific Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration General Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Make_Images_General.png|frame|center| '''Make Images Configuration General Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_SCNodeI0.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101SUI0.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101I0.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List_csa101SGI0.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Associated_Service_Units.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_List_csa101SII0.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Component_Service_Instance_List_csa101CSII0.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Resource_Editor1.png</id>
		<title>File:Resource Editor1.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Resource_Editor1.png"/>
				<updated>2014-11-14T09:09:59Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Component_Editor1.png</id>
		<title>File:Component Editor1.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Component_Editor1.png"/>
				<updated>2014-11-14T09:09:45Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T09:03:01Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Creating the csa101 Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Build_Configuration.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration TIPC Specific Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Make_Image_TIPC_Specific.png|frame|center| '''Make Images Configuration TIPC Specific Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration General Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Make_Images_General.png|frame|center| '''Make Images Configuration General Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_SCNodeI0.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101SUI0.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101I0.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List_csa101SGI0.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Associated_Service_Units.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_List_csa101SII0.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Component_Service_Instance_List_csa101CSII0.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Make_Images_General.png</id>
		<title>File:Make Images General.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Make_Images_General.png"/>
				<updated>2014-11-14T08:58:46Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Make_Image_TIPC_Specific.png</id>
		<title>File:Make Image TIPC Specific.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Make_Image_TIPC_Specific.png"/>
				<updated>2014-11-14T08:58:30Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:54:27Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Component Service Instance Instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Build_Configuration.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_SCNodeI0.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101SUI0.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101I0.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List_csa101SGI0.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Associated_Service_Units.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_List_csa101SII0.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Component_Service_Instance_List_csa101CSII0.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:53:51Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Service Instance Instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Build_Configuration.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_SCNodeI0.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101SUI0.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101I0.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List_csa101SGI0.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Associated_Service_Units.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_List_csa101SII0.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:52:11Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Service Group Instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Build_Configuration.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_SCNodeI0.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101SUI0.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101I0.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List_csa101SGI0.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Associated_Service_Units.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:50:45Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Component Instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Build_Configuration.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_SCNodeI0.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101SUI0.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101I0.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:50:05Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Service Unit Instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Build_Configuration.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_SCNodeI0.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_csa101SUI0.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:48:20Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Node Instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Build_Configuration.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_Details_SCNodeI0.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:45:34Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Building the csa101 Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Build_Configuration.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Build_Configuration.png</id>
		<title>File:Build Configuration.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Build_Configuration.png"/>
				<updated>2014-11-14T08:44:57Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:43:17Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Generating the csa101 Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace_Generate_Source.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_BuildConfigDetails.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Clovis_Workspace_Generate_Source.png</id>
		<title>File:Clovis Workspace Generate Source.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Clovis_Workspace_Generate_Source.png"/>
				<updated>2014-11-14T08:42:42Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:32:58Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Configuring Physical Instances */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_List.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:AMF_Configuration_Final.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CWCodeTree.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_BuildConfigDetails.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:30:23Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Creating Node Instances */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFConfig.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Node_Instance_List.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFSGWizardDetails.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMSConfigDetails.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CWCodeTree.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_BuildConfigDetails.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:28:01Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Configuring the SAF Component */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Component_Details.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Command_Line_Argument_Details.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFConfig.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFNodeWizardDetails.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFSGWizardDetails.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMSConfigDetails.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CWCodeTree.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_BuildConfigDetails.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:26:58Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Configuring the Service Instance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Instance_Details.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SAFComponentDetails.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CommandLineArgs.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFConfig.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFNodeWizardDetails.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFSGWizardDetails.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMSConfigDetails.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CWCodeTree.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_BuildConfigDetails.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Service_Instance_Details.png</id>
		<title>File:Service Instance Details.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Service_Instance_Details.png"/>
				<updated>2014-11-14T08:26:21Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:24:24Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Configuring the Service Group */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Service_Group_Details.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ServiceInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SAFComponentDetails.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CommandLineArgs.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFConfig.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFNodeWizardDetails.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFSGWizardDetails.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMSConfigDetails.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CWCodeTree.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_BuildConfigDetails.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:21:55Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Resource Editor View */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Resource_Editor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ServiceGroupDetails.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ServiceInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SAFComponentDetails.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CommandLineArgs.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFConfig.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFNodeWizardDetails.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFSGWizardDetails.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMSConfigDetails.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CWCodeTree.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_BuildConfigDetails.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:20:51Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* The SAFplus Platform IDE Perspective */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_Workspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ResourceEditor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ServiceGroupDetails.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ServiceInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SAFComponentDetails.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CommandLineArgs.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFConfig.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFNodeWizardDetails.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFSGWizardDetails.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMSConfigDetails.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CWCodeTree.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_BuildConfigDetails.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:19:27Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Creating the Sample Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:New_Project_Wizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Clovis_System_Project.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_Blade_Type.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Add_New_SAF_Node_Type.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:SAF_Service_Type_Name.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_ClovisWorkspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ResourceEditor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ServiceGroupDetails.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ServiceInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SAFComponentDetails.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CommandLineArgs.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFConfig.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFNodeWizardDetails.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFSGWizardDetails.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMSConfigDetails.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CWCodeTree.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_BuildConfigDetails.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/Doc:latest/tutorial</id>
		<title>Doc:latest/tutorial</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/Doc:latest/tutorial"/>
				<updated>2014-11-14T08:12:42Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: /* Launching the SAFplus Platform IDE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Preface==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' is a comprehensive tutorial designed to highlight the steps involved in using SAFplus software to design and build a high availability system. In this tutorial you will learn to:&lt;br /&gt;
* Design a model using the SAFplus IDE&lt;br /&gt;
* Generate code from this model to provide middleware support&lt;br /&gt;
* Customize this code for a particular application&lt;br /&gt;
* Build and deploy the customized code&lt;br /&gt;
* Run the system to see the SAFplus Platform software in action&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Audience===&lt;br /&gt;
&amp;lt;br&amp;gt; ''SAFplus Platform Sample Application Tutorial''  is designed for system integrators, designers, and system architects. To use SAFplus Platform, you should be aware of the fundamentals of operation, management, and configuration of telecommunication and networking domains. You should also be familiar with C programming, UML notations, and have the basic knowledge of Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This document assumes that you have installed the SAFplus Platform SDK, following the installation steps found in the ''SAFplus Platform Installation Guide''.&lt;br /&gt;
&lt;br /&gt;
===Documentation Conventions===&lt;br /&gt;
This guide uses different fonts and symbols to differentiate between document elements and types of information. These conventions are summarized in the following table.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#cdd6e6&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Notation&lt;br /&gt;
!style=&amp;quot;background:#d3e3ff&amp;quot;| Description&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffccaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Code&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|This font denotes the C code provided in various examples.&amp;lt;br&amp;gt;This font denotes function and variable names.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;background:#ffffaa&amp;quot; | &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Output&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|Terminal output.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;color:blue&amp;quot; | Cross reference&lt;br /&gt;
|This font denotes a hyperlink. You can click on the hyperlink text to access the reference location, which can be either a section within the guide or a URL link.&amp;lt;br&amp;gt;A cross reference refers to a section name and accesses the first page of that section.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;Filenames&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;lt;DIR&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| Files names, Directory paths.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|&amp;lt;code&amp;gt;$ Commands ''group_identifier''&amp;lt;/code&amp;gt; &lt;br /&gt;
| Commands to be run from a shell.&amp;lt;br&amp;gt; Italic text indicate an argument. This can be replaced with your desired value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This indicates the presence of notes or annotations, related to the context of the document. &lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Caution.png]]This indicates that certain precautionary measures must be taken before performing a particular task.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Info.png]]This indicates that additional information is provided to you.&lt;br /&gt;
&lt;br /&gt;
As mentioned in the ''SAFplus Platform Installation Guide'' the default directory for installation is &amp;lt;code&amp;gt;/opt/clovis&amp;lt;/code&amp;gt; for root installation and &amp;lt;code&amp;gt;$HOME/clovis&amp;lt;/code&amp;gt; for non root users. Throughout this document we will use &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;&amp;lt;/code&amp;gt; to refer to the installation directory.&lt;br /&gt;
&lt;br /&gt;
===Related Documents===&lt;br /&gt;
For additional information about OpenClovis products, please refer to the following guides:&lt;br /&gt;
* '''[[Doc:latest/relnotes | SAFplus Platform Release Notes]]''' provides information about the software and the hardware required to install OpenClovis SAFplus Availability/Scalability Platform and Integrated Development Environment (IDE). It summarizes the additional features and enhancements of the product since the previous release. It also summarizes the issues and limitations of the product and provides workarounds wherever applicable.&lt;br /&gt;
* '''[[Doc:latest/safcompliance | SAFplus Platform SA-Forum Compliance]]''' describes the level of compliance of OpenClovis SAFplus Platform and its Application Programming Interface (API) with the relevant Service Availability Forum Specifications.&lt;br /&gt;
* '''[[Doc:latest/installguide | SAFplus Platform Installation Guide]]''' provides the system requirements, installation procedure for OpenClovis SAFplus Platform, IDE, and the Evaluation System.&lt;br /&gt;
* '''[[Doc:latest/tutorial | SAFplus Platform Sample Application Tutorial]]''' explains the steps to create and build a sample model using OpenClovis IDE and OpenClovis SAFplus Platform. It also provides troubleshooting information for this process. This provides the logical first step in understanding the SAFplus Platform offering.&lt;br /&gt;
* '''[[Doc:latest/evalguide | SAFplus Platform Evaluation System User Guide]]''' provides all the required information to configure and run the sample models packaged within the Evaluation System. This document also provides good understanding of OpenClovis SAFplus Platform's functionality. This is the natural follow on to the ''OpenClovis Sample Application Tutorial'' as it builds on the example created in that document. &lt;br /&gt;
* '''[[Doc:latest/sdkguide | SAFplus Platform SDK User Guide]]''' provides information about SAFplus Availability/Scalability Platform architecture, various SAFplus Platform components, and their interactions. This guide helps you to configure the OpenClovis SAFplus Platform components, compile, and execute the SAFplus Platform code to build your custom application.&lt;br /&gt;
* '''[[Doc:latest/ideguide | SAFplus Platform IDE User Guide]]''' describes the usage of Integrated Development Environment (IDE), a graphical development environment that complements the SAFplus Platform. This guide helps you to understand how to use the various features of the IDE to build the application.&lt;br /&gt;
* '''[[Doc:latest/logtoolguide | SAFplus Platform Log Tool User Guide]]''' provides information about the usage of OpenClovis Log Tool. OpenClovis Log Tool is an interactive utility that allows you to view binary log files in a readable format and hence monitor system errors, warnings, and other log information. Log Tool allows you to format the &amp;lt;code&amp;gt;.log&amp;lt;/code&amp;gt; files and filter them to view the required entries.&lt;br /&gt;
* '''SAFplus Platform API Reference Guide [http://www.openclovis.org/doc/latest/apirefs/index.html]''' is provided for each component. It describes the Application Programming Interface (API), Service Model, and Management Information Model of the various OpenClovis Application Service Platform (SAFplus Platform) services. It helps the developer to understand the capabilities of the SAFplus Platform services and the APIs provided by these services.&lt;br /&gt;
* '''[[SAFplus Platform Console Reference Guide]]''' provides details about managing applications built on SAFplus Platform using the SAFplus Platform runtime debug console commands. SAFplus Platform Console commands can be used to manage, monitor, and test your application.&lt;br /&gt;
&lt;br /&gt;
===OpenClovis Online Technical Support===&lt;br /&gt;
OpenClovis customers and partners can register on our Web site and receive personalized services and information. If you need any support or assistance while working on OpenClovis products, you can access the following: URL: http://www.openclovis.com. Send your queries to: support@openclovis.com.&lt;br /&gt;
&lt;br /&gt;
===Documentation Feedback===&lt;br /&gt;
We are interested in hearing from our customers on the documentation provided with the product. Let us know your comments and suggestions on improving the documentation at OpenClovis Inc. Send your comments to: support@openclovis.com. Or even better, edit (or comment in) the page on our documentation wiki located at [http://help.openclovis.com http://help.openclovis.com].&lt;br /&gt;
&lt;br /&gt;
==Our Example: The csa101 System==&lt;br /&gt;
The ''SAFplus Platform Sample Application Tutorial'' will take you through a series of examples each introducing a key concept of the product. Each example builds on the example before it so it is important to go through them in order. The examples are named so that it is easy to determine their sequence. The examples all begin with the letters '''csa''' (standing for Clovis Sample Application) and end with a number. Our first example will be '''csa101'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of our first example is to highlight basic component management. It introduces the basic skeleton of a SAFplus Platform based application component and illustrates how it interacts with the System. It demonstrates basic component registration and life-cycle management.&lt;br /&gt;
&lt;br /&gt;
We will keep this first example very simple. It will consist of the SAFplus Platform running a small component named '''csa101'''. All that this component will do is continuously print 'Hello World!' to a log file. While this component is not very exciting, it will allow us to easily see when the application is in a running state and when it is not. This will allow us to focus on the infrastructure of SAFplus Platform and how the application interfaces with it.&lt;br /&gt;
&lt;br /&gt;
For this example we will assume that we have a chassis with five slots. We will have one type of blade in our example, a '''System Controller'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]With the type of model we are developing we would typically define two blade types to install in these slots. The first blade type would be a '''System Controller''' blade (which is responsible for running the SAFplus Platform software which manages application startup, shutdown, failover, etc.) and the second blade type would be a '''Payload''' blade (which is responsible for running our custom '''csa101''' application). However, for the purpose of simplifying the deployment of our system, we will define only the '''System Controller''' blade type and have both the SAFplus Platform and component application run on this one blade. This will allow the example to be run on a single PC.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Model==&lt;br /&gt;
The first step in setting up our example is to create a model which represents the system that we will eventually deploy. This is done through the '''SAFplus Platform IDE'''. In this chapter we will step through the following tasks:&lt;br /&gt;
* Create a project area&lt;br /&gt;
* Launch the '''SAFplus Platform IDE'''&lt;br /&gt;
* Create the IDE project&lt;br /&gt;
* Specify the Resource model (the types of physical hardware in our system)&lt;br /&gt;
* Specify the Component model (the types of components or applications in our system)&lt;br /&gt;
* Specify which Components run on which Resources&lt;br /&gt;
* Specify important build and boot parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Creating a New Project Area===&lt;br /&gt;
A project area is a directory on your system where you can develop SAFplus Platform models and generate the code corresponding to those models. The project area can hold multiple models allowing you to manage all of your models in one location. All the models in the same project area share the same SAFplus Platform source tree. This way any modifications made to the SAFplus Platform source tree are re-used across all the models that were created in that project area.&lt;br /&gt;
&lt;br /&gt;
You create a project area using a script from the command line. To create a project area named '''projectarea1''' in the '''/home/clovis''' directory you should execute the following command:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cl-create-project-area /home/clovis/projectarea1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Launching the SAFplus Platform IDE===&lt;br /&gt;
You can launch the '''SAFplus Platform IDE''' from the command line. If you chose to create symbolic links during installation you can simply enter &amp;lt;code&amp;gt;'''cl-ide'''&amp;lt;/code&amp;gt; from any directory. If you did not create symbolic links during installation you can either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the installation directory to the shells search path and then launch the IDE. For example with a bash shell, &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# export PATH=$PATH:$install_dir/6.1/sdk/bin&lt;br /&gt;
# cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# &amp;lt;install_dir&amp;gt;/6.1/sdk/bin/cl-ide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The splash screen for SAFplus Platform IDE is displayed as illustrated in Figure [[#SAFplus Platform IDE Opening Screen | SAFplus Platform IDE Opening Screen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Opening Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_OpeningScreen.png|frame|center| '''SAFplus Platform IDE Opening Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will then be prompted to select a workspace in which to do your work as illustrated in Figure [[#SAFplus Platform IDE Workspace Launcher | SAFplus Platform IDE Workspace Launcher]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Workspace Launcher'&amp;gt;&amp;lt;/span&amp;gt;[[File:Workspace_Launcher.png|frame|center| '''SAFplus Platform IDE Workspace Launcher''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The workspace you select should correspond to the project area that you created in the previous section (in this case &amp;quot;/home/clovis/projectarea1&amp;quot;). Note that the workspace includes a subdirectory of &amp;quot;/ide_workspace&amp;quot;. This is done strictly for organizational purposes. It keeps the IDE models separate from the generated SAFplus Platform models and code.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select the workspace and click  '''OK'''  to launch SAFplus Platform IDE as illustrated in the Figure [[#SAFplus Platform IDE Welcome Screen | SAFplus Platform IDE Welcome Screen]].&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Welcome Screen'&amp;gt;&amp;lt;/span&amp;gt;[[File:IDE_Welcome_Screen.png|frame|center| '''SAFplus Platform IDE Welcome Screen''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''SAFplus Platform''' IDE is launched and you are now looking at the main work area. For more information about the components of this main work area including the SAFplus Platform IDE menu and toolbar, see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Creating the Sample Project===&lt;br /&gt;
We will now create a project within the '''SAFplus Platform IDE'''. This project will hold both the resource model and the component model for our example system. The resource model is a physical view of the resources (the chassis, the blade types, etc.) in our system. The component model is a logical view of the components (applications, etc.) in our system.&lt;br /&gt;
&lt;br /&gt;
We will be using the '''New Project Wizard''' to create our project. The wizard captures some high-level information about the system that we are building and performs a lot of the basic setup for us.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]]The same model that we are building through the wizard could also be created manually through the Resource and Component Editors. For more information on the Resource and Component Editors see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To launch the '''New Project Wizard''' select  '''File'''  &amp;gt;  '''New''' &amp;gt;  '''Project''' from the IDE menu bar.&lt;br /&gt;
&lt;br /&gt;
The  '''New Project Wizard''' is displayed and  '''Clovis System Project'''  is selected by default as illustrated in Figure [[#New Project Wizard | New Project Wizard]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='New Project Wizard'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_NewProjectWizard.png|frame|center| '''New Project Wizard''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click  '''Next'''. The  '''Clovis System Project''' window is displayed as illustrated in Figure [[#Clovis System Project | Clovis System Project]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;span id='Clovis System Project'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NewProject.png|frame|center| '''Clovis System Project''' ]]&lt;br /&gt;
&lt;br /&gt;
Enter the following information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Name''' : Enter the name of your new project as  '''SampleModel'''.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]Do not use spaces or special characters for the project name. The project name can be alphanumeric, but cannot start with a number or have only numbers.&lt;br /&gt;
&amp;lt;br&amp;gt;Select  '''Use default'''  to use the same directory mentioned in the  '''Directory'''  field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''SDK Location''': Enter the location where the SAFplus Platform SDK was installed. For e.g. if the SDK was installed at location /opt/clovis, then the SDK location is /opt/clovis/sdk-&amp;lt;version&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Project Area Location''': Enter the location where the generated source code for the model should be stored.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]This can be any existing directory but is usually the project area that was created in the previous section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;'''Python Location''': Enter the location where Python 2.5.0 or above is installed on your system. If Python 2.5.0 or above was installed by SAFplus Platform SDK, the directory is  &amp;lt;code&amp;gt;'''&amp;lt;installation_directory&amp;gt;/6.1/buildtools/local/bin'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New Blade Type''' window is displayed. This dialog is used to define the blade types that are in our system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New Blade Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AddBlade.png|frame|center| '''Add New Blade Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that the system we are modelling has only one blade type...a System Controller.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new blade type to the list. Name this blade type 'SysBlade' (for System Controller blade).&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Add New SAF Node Type''' window is displayed. This dialog is used to define the type of logical node that will be run on the corresponding blade type defined in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Add New SAF Node Type'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AddNode.png|frame|center| '''Add New SAF Node Type''' ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node types represent groups of software. They are classified as either a System Controller class or a Payload class. This distinction gives the node type certain characteristics which cause it to behave in a well-defined manner. Since we have only a System Controller in our system we will add a node type of class System Controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a new node type to the list. Name the node type 'SCNode' and ensure that its node class is 'System Controller (SAF Class B)'.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Next'''. The '''Specify Program Names''' window is displayed. This dialog is used to create programs or SAF Service Types and associate them with the SAF Node Types specified in the previous dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Specify Program Names'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_DefineProgramNames.png|frame|center| '''Specify Program Names''' ]]&lt;br /&gt;
&lt;br /&gt;
In our system we need one SAF Service Type which represents our high availability software (csa101 that continously prints &amp;quot;Hello World!&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the '''Add''' button to add a program name to the list. Change the program name to 'csa101' and associate the program with the 'SCNode' node type.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click '''Finish'''. This will create the sample model using the blade type, node type, and program name information collected through the 'New Project Wizard' dialogs.&lt;br /&gt;
&lt;br /&gt;
===Viewing the Model===&lt;br /&gt;
&lt;br /&gt;
====The SAFplus Platform IDE Perspective====&lt;br /&gt;
Once the wizard pages are closed you will be returned to the main IDE view also known as the '''SAFplus Platform IDE Perspective'''. On the left hand side of this view you will see the '''Clovis Workspace''' pane which contains the new project you just created with all project related files and folders. The folders are displayed based on your filter settings. With the default filter settings, the folders shown in Figure [[#Clovis Workspace|Clovis Workspace]] is displayed in the '''Clovis Workspace''' pane. For information about filter settings, refer  ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_GettingStartedIDE_ClovisWorkspace.png|frame|center|Clovis Workspace]]&lt;br /&gt;
&lt;br /&gt;
By default, the '''Resource''' and '''Component''' Editor views are available for the created project. To view them, click '''Clovis''' on the menu bar at the top of the screen and select '''Resource Editor''' or  '''Component Editor'''  from the menu. You can also click '''Resource Editor''' or '''Component Editor''' icons from the tool bar as shown in Figure [[#SAFplus Platform IDE Tool Bar | SAFplus Platform IDE Tool Bar]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform IDE Tool Bar'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_Toolbar.png|frame|center| '''SAFplus Platform IDE Tool Bar''' ]]&lt;br /&gt;
&lt;br /&gt;
====Resource Editor View====&lt;br /&gt;
The '''Resource Editor''' shows the types of physical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Resource Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Resource Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ResourceEditor.png|frame|center| '''SAFplus Platform Resource Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Chassis''' object which is the root of all other objects in the editor. In our case it also has the '''SysBlade''' blade type that we created through the '''Project Creation Wizard'''. You will also notice that the '''SysBlade''' is attached to the '''Chassis''' using a '''Composition''' relationship indicating that '''SysBlade'''s reside within the '''Chassis'''.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Resource Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
====Component Editor View====&lt;br /&gt;
The '''Component Editor''' shows the types of logical objects in our system. It gives us a place to create new objects and interact with the objects that already exist. The '''Component Editor''' view for our model should look similar to the following figure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAFplus Platform Component Editor'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentEditor.png|frame|center| '''SAFplus Platform Component Editor''' ]]&lt;br /&gt;
&lt;br /&gt;
This editor always has a '''Cluster''' object which is the root of all other objects in the editor. In our case it also has the '''SCNode''' node type and the '''csa101''' SAF Service Type (a combination of Service Group, Service Unit, Service Instance, Component Service Instance, and SAF Component) that we created through the '''Project Creation Wizard'''. These have all been automatically attached in a way that makes a working model.&lt;br /&gt;
&lt;br /&gt;
On the right hand side of the editor view you will see the '''Palette''' which can be expanded and collapsed. Expanding the '''Palette''' you will see the list of objects that can be dragged onto the editor view to add to our model. Once an object is on the editor view you can view and change its properties by right clicking on the object and selecting '''Properties...''' from the context menu.&lt;br /&gt;
&lt;br /&gt;
For more information about the '''Component Editor''' view see ''SAFplus Platform IDE User Guide''.&lt;br /&gt;
&lt;br /&gt;
===Configuring the Components===&lt;br /&gt;
The '''New Project Wizard''' that we used to create our project configured the system using the most common options. We will have to make a few changes to this model in order for our example to work. We will make these changes in the '''Component Editor''' view.&lt;br /&gt;
&lt;br /&gt;
In the Component Editor you will notice seven different objects that were created by the wizard. The first two of these are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cluster: The root object of all other objects in the Component Editor view.&lt;br /&gt;
&amp;lt;li&amp;gt;SCNode: This is the SAF Node Type that we specified during project creation.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next five objects all make up the Program or SAF Service Type that we specified on the last dialog of the New Project Wizard. These objects are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SG: This is the Service Group representing our high availability software component.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SU: This is the Service Unit that is logically associated with the SCNode SAF Node Type.&lt;br /&gt;
&amp;lt;li&amp;gt;csa101SI: This is the Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101CSI: This is the Component Service Instance&lt;br /&gt;
&amp;lt;li&amp;gt;csa101: This is the SAF Component which represents our program or executable.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will be making changes to the Service Group (csa101SG), the Service Instance (csa101SI), and the SAF Component (csa101).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Group====&lt;br /&gt;
To make changes to the Service Group double-click on the box titled '''csa101SG'''. The '''Service Group Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ServiceGroupDetails.png|frame|center| '''Service Group Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The first change we want to make is to the '''Redundancy Model'''. The '''Redundancy Model''' is the strategy that is used by the SAFplus Platform system to recover from a node failure. For our simple model (which only has one node) we are not going to rely on any failover recovery so change the '''Redundancy Model''' to 'No Redundancy' as shown.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]You will notice that when you change the redundancy model some of the other fields are modified automatically and become read-only. This is to ensure integrity of the redundancy models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;The second change that we want to make is to the '''Admin State'''. The '''Admin State''' defines the state of the component when the system is first brought up. In our case we want to change the '''Admin State''' to be 'Locked Initialized'. This means that when the system first starts up this '''Service Group''' (and its subcomponents) will be initialized but not yet put into a running state. So our csa101 application will not yet start printing &amp;quot;Hello World!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the Service Instance====&lt;br /&gt;
To make changes to the Service Instance double-click on the box titled '''csa101SI'''. The '''Service Instance Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ServiceInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The only change we want to make here is to the '''Number of standby assignments'''. This value represents the number of components that will be waiting to take over during a node failure and goes hand-in-hand with the '''Redundancy Model''' that we selected for the Service Group. Since we selected 'No Redundancy' for our '''Redundancy Model''' we need to set this value to 0...since we are not supporting any failover in this model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;When you are finished making the changes click the '''OK''' button to commit the changes.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the SAF Component====&lt;br /&gt;
To make changes to the SAF Component double-click on the box titled '''csa101'''. The '''SAF Component Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SAF Component Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SAFComponentDetails.png|frame|center| '''SAF Component Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The SAF Component represents our high availabilty program or executable. We need to pass a command line argument to this executable. The reason for this argument is to force the program to print the 'Hello World!' output to a special log file for our viewing. We will look at this more closely when we customize our code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To add command line parameters click the '''Edit...''' button corresponding to the '''Command line Arguments''' label.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Command line Argument Details''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Command line Argument Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CommandLineArgs.png|frame|center| '''Command line Argument Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''New''' button to add a new value to the list.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on the new value in the list and it will become editable. Change the value to '''-p'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button to save and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''OK''' button on the '''SAF Component Details''' dialog to commit the changes to the SAF Component and close the dialog.&lt;br /&gt;
&amp;lt;li&amp;gt;Save the component model using the '''File &amp;gt; Save''' menu item.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Configuring Physical Instances===&lt;br /&gt;
The configuration of our logical models is complete. During this process we have defined all of the 'types' of objects in our system. Now it is time to configure actual instances of those objects so that they can be built and deployed.&lt;br /&gt;
&lt;br /&gt;
Object instance configuration is done through the Availability Management Framework (AMF) via the '''AMF Configuration''' dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To launch this dialog go to the the '''Clovis''' menu and select '''AMF Configuration...'''&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''AMF Configuration''' dialog is displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMF Configuration Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFConfig.png|frame|center| '''AMF Configuration Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
You will note from the instructions on this page that the physical instances representing the objects in our model can be created manually or by using wizards. Using the wizards will save us both typing and time so we will use these instead of creating each instance manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Creating Node Instances====&lt;br /&gt;
First we will create actual instances of the Node Types (in our case only one Node Type...SCNode) we created in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Double-click AMF Configuration in the left hand pane. The Node Instance List appears.&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Node Instance List. The right hand pane displays the fields we must fill out to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNode for the '''Node Type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SysBlade for the '''Blade type'''.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter 1 for the '''Node Count'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The complete form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFNodeWizardDetails.png|frame|center| '''Node Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our node instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expanding the '''Node Instance List''' branch of the '''AMF Configuration''' tree in the left-hand pane reveals a new node instance named SCNodeI0 (indicating SCNode Instance 0).&lt;br /&gt;
&lt;br /&gt;
====Creating Service Group Instances====&lt;br /&gt;
Now we will create actual instances of the Service Groups that we defined in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on Service Group List. The right hand pane displays the fields we must fill out to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the right hand pane:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select csa101SG (the only service group type we defined) for the '''Service Group Type'''.&lt;br /&gt;
*The '''Associated Node Instances''' list will be populated with all of the node instances that can be associated with the selected service group type.&lt;br /&gt;
&amp;lt;li&amp;gt;Select SCNodeI0 from the '''Associated Node Instances''' list.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The completed form should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Wizard Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMFSGWizardDetails.png|frame|center| '''Service Group Wizard Details''' ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the '''Create Instance Tree''' button to create our service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you now completely expand the '''AMF Configuration''' branch of the tree in the left-hand pane you will see the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='AMS Configuration Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_AMSConfigDetails.png|frame|center| '''AMF Configuration Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
Notice that not only have the wizards created the node and service group instances for you, they have also filled out the entire instance tree. This was accomplished based on two key sets of information. The first of these is the association that was made between the service group type and the node instance in the '''Service Group Wizard'''. The second set of information is the component model that we created through the New Project Wizard and the Component Editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For more information regarding the specific properties of the generated instances see [[#Appendix B: AMF Configuration Instance Details|Appendix B: AMF Configuration Instance Details]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Thats it. We are done modelling the csa101 example!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click the OK button to commit our changes and close the dialog. &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Now its time to generate the framework code.&lt;br /&gt;
&lt;br /&gt;
==Generating the csa101 Code==&lt;br /&gt;
In this step we generate the source code for our example. The code that will be created is the framework code that handles all of the low level functionality provided by SAFplus Platform.&lt;br /&gt;
&lt;br /&gt;
To generate the source code go to the '''Project''' menu and select '''Generate Source'''. Several progress dialogs will appear and after a few seconds code generation will be complete.&lt;br /&gt;
&lt;br /&gt;
The source code and configuration XML files are generated and placed in subdirectories of the '''Project Area Location''' that we specified in the '''New Project Wizard'''. You can review this location by using the '''Project &amp;gt; Properties''' menu to get to the '''Project Properties''' dialog and then selecting '''Clovis System Project''' in the left hand pane.&lt;br /&gt;
&lt;br /&gt;
You can review the generated code from within the SAFplus Platform IDE. To do this go to the '''Clovis Workspace''' pane and expand the '''SampleModel''' node. The node tree should look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Clovis Workspace Code Tree'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CWCodeTree.png|frame|center| '''Clovis Workspace Code Tree''' ]]&lt;br /&gt;
&lt;br /&gt;
The code of particular interest to our example is in the SampleModel/src/app/csa101 branch of the tree. This is the code for our csa101 example. The csa101 example consist of one C module (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;). There is also a make file that will be used for building the application. The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file implements our 'Hello World!' application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you run code generation a second time you will be presented with a dialog box asking if you would like to make a backup copy of the existing source code before proceeding. You can answer No to this dialog.&lt;br /&gt;
&lt;br /&gt;
==Customizing the csa101 Code==&lt;br /&gt;
While the code that was generated in the previous section can be built and run we want to make some changes to it so that we can easily see what our example is doing. For our example we will be changing one source file (&amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt;) and two make files.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In a real production situation this is the point where you would customize the code to perform the specific tasks of your product.&lt;br /&gt;
&lt;br /&gt;
You will notice in the C file that there are several places where you see the following comment block.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 // ...&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Makefiles have a similar convention but with a slightly different syntax.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Makefile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
 # ---END_APPLICATION_CODE---&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are sections of the file where it is safe to enter custom application code without having to worry about that code being overwritten if you were to again perform '''Generate Source''' for your model. This is important since the typical development cycle is an iterative process where you will return to the IDE to make modifications to your model.&lt;br /&gt;
&lt;br /&gt;
To simplify the process of building and running the csa101 example, OpenClovis, Inc. has already made the necessary code customizations and shipped this code with the SAFplus Platform SDK. At this point you can simply replace the generated source files with these customized versions to avoid typing in the changes. We will go over each customization below and explain what was done.&lt;br /&gt;
&lt;br /&gt;
To replace the generated files with the customized versions shipped with the SAFplus Platform SDK follow these instructions.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]  The sample applications containing the csa101 example can be found under the installation directory at &amp;lt;code&amp;gt;&amp;lt;install_dir&amp;gt;/6.1/sdk/src/examples/eval&amp;lt;/code&amp;gt;. We will refer to this directory in the remaining of this section as &amp;lt;code&amp;gt;&amp;lt;eval_dir&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Exit the SAFplus Platform IDE using the '''File &amp;gt; Exit''' menu item. If you are prompted to save changes before exiting answer yes.&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the source code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Using your favorite editor open the file &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; that resides in this directory. This is the application make file.&lt;br /&gt;
&amp;lt;li&amp;gt;Add the following line to this file within the first &amp;lt;code&amp;gt;BEGIN_APPLICATION_CODE&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;END_APPLICATION_CODE&amp;lt;/code&amp;gt; comment block.  This will instruct the build process to build our custom output library.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;SUBDIRS += ev&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save this file and exit the editor.&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the output package to our working area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp -r &amp;lt;eval_dir&amp;gt;/src/app/ev .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Navigate to the component code work area.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd csa101&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the csa101 source code.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/main.c .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Execute the following command to copy the component make file.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cp &amp;lt;eval_dir&amp;gt;/src/app/csa101Comp/Makefile .&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart the SAFplus Platform IDE.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cl-ide&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Customizing main.c===&lt;br /&gt;
The &amp;lt;code&amp;gt;main.c&amp;lt;/code&amp;gt; file is the C module which will implement our 'Hello World!' behavior. We have to make changes in several parts of this file.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you copied the files as instructed in the section above then these changes have already been made to the files. Use this section to review and understand the changes.&lt;br /&gt;
&lt;br /&gt;
In the include section of this file we have added a new include for &amp;lt;code&amp;gt;ev.h&amp;lt;/code&amp;gt;. This refers to a special output library that we copied to our work area in the previous section. This output library is used to redirect output from the application to a component specific log. This is purely cosmetic but it will allow us to easily monitor what is happening when we run our example.&lt;br /&gt;
Also, we change the logging from the default &amp;quot;application&amp;quot; stream to a custom stream. To do this, we include the header that defines our config routines, change the default &amp;quot;clLogApp&amp;quot; macro to use a different stream, and define that stream as a global variable:&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;../ev/ev.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 #define clprintf(severity, ...)   clAppLog(gEvalLogStream, severity, 10, &lt;br /&gt;
         &amp;quot;MAI&amp;quot;, CL_LOG_CONTEXT_UNSPECIFIED,__VA_ARGS__)&lt;br /&gt;
 ...&lt;br /&gt;
 ClLogStreamHandleT  gEvalLogStream = CL_HANDLE_INVALID_VALUE;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we define a static variables that will keep track of the state of our application and a function to aid in showing when the application is running. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
 /*&lt;br /&gt;
   ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 static int running = 0;&lt;br /&gt;
&lt;br /&gt;
 static char*&lt;br /&gt;
 show_progress(void)&lt;br /&gt;
 {&lt;br /&gt;
     static char bar[] = &amp;quot;          .&amp;quot;;&lt;br /&gt;
     static int progress = 0;&lt;br /&gt;
&lt;br /&gt;
     /* Show a little progress bar */&lt;br /&gt;
     return &amp;amp;bar[sizeof(bar)-2-(progress++)%(sizeof(bar)-2)];&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
   ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
The &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; flag will be used to indicate whether the current application is active or suspended.&lt;br /&gt;
The function &amp;lt;code&amp;gt;show_progress&amp;lt;/code&amp;gt; returns a pointer to a c string with a number of spaces followed by a '.' character. The number of spaces in the string cycles from zero to an upper bound. This is used later on to provide visual indication of the progress of the application's output.&lt;br /&gt;
&lt;br /&gt;
Next we have added a function &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; to print the output. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void* activeLoop(void* p)&lt;br /&gt;
{&lt;br /&gt;
    while (running)&lt;br /&gt;
    {&lt;br /&gt;
        clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Threaded Hello World! %s\n&amp;quot;,     &lt;br /&gt;
                 show_progress());&lt;br /&gt;
        sleep(2);&lt;br /&gt;
    }&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Notice the while loop condition. This function uses the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable that was initialized to 0. The loop will keep running until &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; is set to non-zero. The work of the application: printing &amp;quot;Hello World!&amp;quot; along with the progress indicator.  Next the command &amp;lt;code&amp;gt;sleep(2)&amp;lt;/code&amp;gt; simply sleeps for two seconds so as not to fill log files too quickly or completely swamp the CPU.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; becomes non-zero, we return from the function. &lt;br /&gt;
&lt;br /&gt;
Next, the log stream is initialized in the &amp;lt;code&amp;gt;initializeAmf&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Set up console redirection for demo purposes */&lt;br /&gt;
clEvalAppLogStreamOpen((ClCharT *)appName.value, &amp;amp;gEvalLogStream);&lt;br /&gt;
...&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Instantiated as component instance %s.&amp;quot;, appName.value);&lt;br /&gt;
clprintf(CL_LOG_SEV_INFO,&amp;quot;%s: Waiting for CSI assignment...&amp;quot;, appName.value);&lt;br /&gt;
&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Next we indicate log stream when we are exiting. &lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*  &lt;br /&gt;
 * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
 clEvalAppLogStreamClose(gEvalLogStream);&lt;br /&gt;
/*  &lt;br /&gt;
 * ---END_APPLICATION_CODE---&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
This will cause &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function to exit.&lt;br /&gt;
Next we will put in code to manage the state of our application.&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
void safAssignWork(SaInvocationT       invocation,&lt;br /&gt;
                   const SaNameT       *compName,&lt;br /&gt;
                   SaAmfHAStateT       haState,&lt;br /&gt;
                   SaAmfCSIDescriptorT csiDescriptor)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * ---BEGIN_APPLICATION_CODE--- &lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * ---END_APPLICATION_CODE---&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Print information about the CSI Set&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    clprintf (CL_LOG_SEV_INFO, &amp;quot;Component [%.*s] : PID [%d]. CSI Set Received\n&amp;quot;,&lt;br /&gt;
              compName-&amp;gt;length, compName-&amp;gt;value, mypid);&lt;br /&gt;
&lt;br /&gt;
    printCSI(csiDescriptor, haState);&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * Take appropriate action based on state&lt;br /&gt;
     */&lt;br /&gt;
&lt;br /&gt;
    switch ( haState )&lt;br /&gt;
    {&lt;br /&gt;
        case SA_AMF_HA_ACTIVE:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the active HA state &lt;br /&gt;
             * for the CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            &lt;br /&gt;
            pthread_t thr;&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: ACTIVE state requested; activating service\n&amp;quot;);&lt;br /&gt;
            running = 1;&lt;br /&gt;
            pthread_create(&amp;amp;thr,NULL,activeLoop,NULL);&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_STANDBY:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to take the standby HA state &lt;br /&gt;
             * for this CSI.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Standby state requested&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        case SA_AMF_HA_QUIESCED:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active or quiescing HA state. The application &lt;br /&gt;
             * must stop work associated with the CSI immediately.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Acknowledging new state quiesced&amp;quot;);&lt;br /&gt;
            running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfResponse(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
        case SA_AMF_HA_QUIESCING:&lt;br /&gt;
        {&lt;br /&gt;
            /*&lt;br /&gt;
             * AMF has requested application to quiesce the CSI currently&lt;br /&gt;
             * assigned the active HA state. The application must stop work&lt;br /&gt;
             * associated with the CSI gracefully and not accept any new&lt;br /&gt;
             * workloads while the work is being terminated.&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO, &amp;quot;csa101: Signaling completion of QUIESCING&amp;quot;);&lt;br /&gt;
              running = 0;&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
             * ---END_APPLICATION_CODE---&lt;br /&gt;
             */&lt;br /&gt;
&lt;br /&gt;
            saAmfCSIQuiescingComplete(amfHandle, invocation, SA_AIS_OK);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
We have modified the &amp;lt;code&amp;gt;safAssignWork&amp;lt;/code&amp;gt; callback function to let our application know what to do when the state changes. In the case where the state changes to &amp;lt;code&amp;gt;SA_AMF_HA_ACTIVE&amp;lt;/code&amp;gt; we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 1. This will cause our application to spawns a thread which calls &amp;lt;code&amp;gt;activeLoop&amp;lt;/code&amp;gt; function and start printing the 'Hello World!' message. For any other state change we set the &amp;lt;code&amp;gt;running&amp;lt;/code&amp;gt; variable to 0 which will cause the message to stop printing. For any state change we print out a message indicating the new state of the application.&lt;br /&gt;
&lt;br /&gt;
The example also demonstrates a non-threaded approach.  But first, some background: for both threaded and non-threaded applications, the main must have a &amp;quot;dispatch&amp;quot; loop that handles incoming AMF notifications and calls the relevant callback.  So to implement a single threaded SAF aware application, the programmer must modify this dispatch loop adding active (and potentially standby) functionality:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|main.c&lt;br /&gt;
 |- &lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
main(...)&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        struct timeval timeout;&lt;br /&gt;
        timeout.tv_sec = 2; timeout.tv_usec = 0;&lt;br /&gt;
&lt;br /&gt;
        FD_ZERO(&amp;amp;read_fds);&lt;br /&gt;
        FD_SET(dispatch_fd, &amp;amp;read_fds);&lt;br /&gt;
&lt;br /&gt;
        if( select(dispatch_fd + 1, &amp;amp;read_fds, NULL, NULL, &amp;amp;timeout) &amp;lt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (EINTR == errno)&lt;br /&gt;
            {&lt;br /&gt;
                continue;&lt;br /&gt;
            }&lt;br /&gt;
		    clprintf (CL_LOG_SEV_ERROR, &amp;quot;Error in select()&amp;quot;);&lt;br /&gt;
			perror(&amp;quot;&amp;quot;);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
        if (FD_ISSET(dispatch_fd,&amp;amp;read_fds))&lt;br /&gt;
        {&lt;br /&gt;
            saAmfDispatch(amfHandle, SA_DISPATCH_ALL);&lt;br /&gt;
        }&lt;br /&gt;
        if (running) &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: Unthreaded Hello World! %s&amp;quot;,&lt;br /&gt;
                     show_progress()); // Run the &amp;quot;active&amp;quot; code&lt;br /&gt;
        }&lt;br /&gt;
        else &lt;br /&gt;
        {&lt;br /&gt;
            clprintf(CL_LOG_SEV_INFO,&amp;quot;csa101: idle&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }while(!unblockNow);      &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
This code should be very familiar to anyone who has written single threaded &amp;quot;event loop&amp;quot; style code. As can be seen in the code snippet above, the select is given an idle timeout (in a real application the timeout would be much smaller) and the application only calls &amp;lt;code&amp;gt;saAmfDispatch&amp;lt;/code&amp;gt; if the select actually indicates that the there is data in the FD.  Then it falls down into an &amp;quot;if&amp;quot; statement that checks if we are active &amp;quot;if (running)...&amp;quot; and outputs a log if that is the case.&lt;br /&gt;
&lt;br /&gt;
===Customizing the Component MakeFile===&lt;br /&gt;
We have to make a small change to the component &amp;lt;code&amp;gt;MakeFile&amp;lt;/code&amp;gt; so that it knows about our special output library during the build. To do this we add the following lines. This file is located in &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Component MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
&lt;br /&gt;
    SUBDIRS += ev&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Customizing the Application MakeFile===&lt;br /&gt;
We have to make sure that our special output library is built along with our application. To do this we change the line listing the sudirectories to make as follows. This file is located in the directory &amp;lt;code&amp;gt;/home/clovis/projectarea1/ide_workspace/SampleModel/src/app/csa101&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffccaa;&amp;quot; align=&amp;quot;center&amp;quot;|Application MakeFile&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    # ---BEGIN_APPLICATION_CODE---&lt;br /&gt;
    &lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    EXTRA_LDLIBS += $(LIB_DIR)/libeval.a&lt;br /&gt;
&lt;br /&gt;
    # ---END_APPLICATION_CODE---&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are finished customizing our application code!&lt;br /&gt;
&lt;br /&gt;
==Building the csa101 Code==&lt;br /&gt;
&lt;br /&gt;
Now that we have finished customizing the code it is time to build it. The build process is launched using the '''Project &amp;gt; Build Project''' menu item. Once selected the '''Build Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Build Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_BuildConfigDetails.png|frame|center| '''Build Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Build Configuration''' dialog is used to gather specific information about the build we are about to perform. Using this dialog you can rebuild the same model using different cross builds, or including different chassis managers. We don't have to make any changes to this dialog since the default settings make sense for our sample application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]If you have prebuilt the SAFplus Platform libraries then you can check the '''Use pre built SAFplus''' checkbox and include the location of the prebuilt libraries. For more information about pre-building SAFplus Platform libraries, see ''SAFplus Platform SDK User Guide''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]The '''Include SNMP for North Bound Access''' control is checked by default. This just means that Net SNMP will be started along with our system. If you want end-to-end connectivity you will need to supply an SNMP Sub Agent and a MIB. See the ''SAFplus Platform SDK User Guide'' for more details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]In the '''Project''' menu if the '''Build Project''' entry is not highlighted, then click in the right pane i.e. '''Clovis Workspace''' pane and click the '''Project''' menu again. This not highlighting of the '''Build Project''' is because the '''Clovis Workspace''' is not selected properly because of moving focus to some other pane.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Click the '''OK''' button to begin the build. If this is the first time that the project is being built, or if you have made changes to any setting on this screen, you will initially see a progress dialog indicating that the project is being configured. The configuration step is setting up the project for building. After the configuration has completed you will see a progress dialog indicating that the code is being built.&lt;br /&gt;
&lt;br /&gt;
==Creating the csa101 Images==&lt;br /&gt;
&lt;br /&gt;
Making the csa101 images will create software packages that can be deployed on target machines to run the example. The process of creating images is launched using the '''Project &amp;gt; Make Images''' menu item. Once selected the '''Make Images Configuration''' dialog appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Make Images Configuration Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_MakeImagesConfigDetails.png|frame|center| '''Make Images Configuration Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The '''Make Images Configuration''' dialog is used to indicate information about the environment on which the images will be deployed. This information is used to tailor the images to run on that environment. Here we will make the following modificaiton.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''Trap IP'''. This value specifies where the SNMP sub-agent will send traps at runtime. This field is optional but if specified must be a valid IP address. Enter a value of '127.0.0.1' in this field.&lt;br /&gt;
&amp;lt;li&amp;gt;Enter a value for the '''TIPC Net ID'''. This value represents a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster. This field is required and should default to '1340'.&lt;br /&gt;
&amp;lt;li&amp;gt;Check the '''Create Node Specific Images''' and '''Package Images into Tarballs''' check boxes. This will create tarballs of the images making them easy to deploy to various machines.&lt;br /&gt;
&amp;lt;li&amp;gt;The table on this dialog will hold a row for each node instance defined in the model. In our case this is only one...SCNodeI0. For each of these instances we can define the slot number in the chassis on which the node will run and the network interface that the node will use for communication. In our case enter '1' for the Slot Number and 'eth0' for the Network Interface.&lt;br /&gt;
&amp;lt;li&amp;gt;Click '''OK''' to begin the make image process. A dialog box will appear and after a few seconds the the make images process will be complete.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The images will be populated at &amp;lt;project_area&amp;gt;/target/SampleModel/images. Each node-specific image is provided as a directory containing the run-time files (binaries, libraries, prerequisites, and configuration files) as well as a tarball with the same content.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt; For our model containing one node (&amp;lt;code&amp;gt;SCNodeI0&amp;lt;/code&amp;gt;) the following files and directories are generated for deployment on the run-time system.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;project_area&amp;gt;&lt;br /&gt;
   |+target&lt;br /&gt;
       |+&amp;lt;model&amp;gt;&lt;br /&gt;
           |+images&lt;br /&gt;
               |+SCNodeI0&lt;br /&gt;
               |   |+bin&lt;br /&gt;
               |   |+etc&lt;br /&gt;
               |   |+lib&lt;br /&gt;
               |   |+modules&lt;br /&gt;
               |   |+share&lt;br /&gt;
               |-SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rest of the steps in this example are all done from the command line so we can exit the IDE. To do this use the '''File &amp;gt; Exit''' menu item.&lt;br /&gt;
&lt;br /&gt;
==Deploying the csa101 Images==&lt;br /&gt;
Now that the image has been built we must deploy it so that we can run and observe our example. Since we are assuming that the example will be run on the same machine as the images were built this is a fairly trivial exercise. Use the following steps to deploy the runtime image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;First we create a directory where we will install the image. In our case we will use &amp;lt;code&amp;gt;/root/asp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root&lt;br /&gt;
# mkdir asp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Next we navigate to that directory and untar the deployment package.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# tar xzvf /home/clovis/projectarea1/target/SampleModel/images/SCNodeI0.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Controller is now installed and ready to run.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If you were going to run the example on a machine other than the one where the images were built you would first copy the installation tarball to that machine before performing the above steps.&lt;br /&gt;
&lt;br /&gt;
==Running the csa101 Example==&lt;br /&gt;
There are two parts to running the csa101 example. First we must start SAFplus Platform, and then we interact with the system components.&lt;br /&gt;
&lt;br /&gt;
===Starting SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To start SAFplus Platform on System Controller node.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;Run the following commands&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] This assumes that you are running the SAFplus Platform example on the same PC that you are executing these commands. If you are running SAFplus Platform on a different machine then you should first ssh to that machine before executing the commands.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] If SAFplus Platform fails to start properly it could be due to the machine's firewall being enabled. SAFplus Platform will not run on a machine which has firewall enabled. See the ''Environment Related Observation'' section of the ''SAFplus Platform Release Notes'' for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:OpenClovis_Note.png]] By default the network interface used by the Group Membership Service is set to eth0. During the make images phase of the tutorial we also set the ethernet interface for node SCNodeI0 to be eth0. During image generation these configuration parameters are written to two files in the deployment package.&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/clGmsConfig.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/root/asp/etc/asp.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There may be an occasion where you want to switch this interface for a machine on which you are deploying. If you would like to switch this interface on a machine without having to go through the process of rebuilding and redeploying, you can edit these two files and change the 'eth0' references to the interface you would like to use.&lt;br /&gt;
&lt;br /&gt;
===Interacting with the System Components===&lt;br /&gt;
Once SAFplus Platform is up and running the next step is to start csa101 by informing SAFplus Platform that it should start the application. The Evaluation System's model tells SAFplus Platform that csa101 is locked for instantiation. This means that the process will not be started when SAFplus Platform comes up. This method of starting csa's is used for the Evaluation System, allowing users to interact with csa's and clearly see their output/functionality. Usually this would not be the case with applications, where they would run when SAFplus Platform begins.&lt;br /&gt;
&lt;br /&gt;
At this point it would help to be familiar with the Service Availability Forum's notions of  Service Unit, Service Group, and administrative state.  The Service Availability Forum's Application Interface Specification (available from http://www.saforum.org/) is a good place to start.&lt;br /&gt;
&lt;br /&gt;
In brief, the sample applications in the Evaluation System are part of service units which in turn are part of service groups.  Service groups (and the service units that make up the service groups) can be in &amp;quot;administrative&amp;quot; states which include &amp;quot;LockInstantiation&amp;quot;, &amp;quot;LockAssignment&amp;quot;, and &amp;quot;Unlocked&amp;quot;.  There are other states, but these are the ones we care about for the purposes of this Evaluation System.  If the administrative state of a service unit is &amp;quot;LockInstantiation&amp;quot; then the application that is part of that service unit will not even be started.  If the administrative state is &amp;quot;LockAssignment&amp;quot; then the application will be started, but it will not be assigned any work.  If the administrative state is &amp;quot;Unlocked&amp;quot; then it will not only be started, but will have a workload assigned to it, which is to say that it will start doing work (or start providing service), rather than idly sit waiting for work.&lt;br /&gt;
&lt;br /&gt;
The administrative state of a service unit or service group can change from LockInstantiation to LockAssignment, from LockAssignment to Unlocked, or back to LockInstantiation, from Unlocked to LockAssignment.  A picture might help here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;PartialServiceGroupAdministrativeStateDiagram&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; [[File:eval_AdministrativeStateDiagram.png|frame|center| '''Partial Service Group Administrative State Diagram''' ]]&lt;br /&gt;
&lt;br /&gt;
As the figure shows, the administrative state of a service unit (or service group) can change from &amp;quot;LockInstantiation&amp;quot; to &amp;quot;LockAssignment&amp;quot; and from there to &amp;quot;Unlocked&amp;quot;, or back to &amp;quot;LockInstantiation&amp;quot;.  One way to change the administrative state of a service group is with the SAFplus Platform Console command line interface. &lt;br /&gt;
&lt;br /&gt;
To use the SAFplus Platform Console:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a terminal on the Development Machine. (Or ssh into System Controller node as root, if you are running SAFplus Platform on a machine other than the development machine.)&lt;br /&gt;
&amp;lt;li&amp;gt; Change to image bin directory: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# cd /root/asp/bin&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Start the SAFplus Platform Console &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;# ./asp_console&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; From within the SAFplus Platform Console: &amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test]-&amp;gt; setc 1&lt;br /&gt;
cli[Test:SCNodeI0]-&amp;gt; setc cpm&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above changes the administrative state of the group csa101SGI0 from &amp;quot;locked-for-instantiation&amp;quot; to &amp;quot;locked-for-assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]For the command &amp;lt;code&amp;gt;cli[Test]-&amp;gt; setc 1&amp;lt;/code&amp;gt;, the 1 represents the physical slot number of the System Controller within the Chassis. Remember that we set our System Controller to be in slot 1 in the make images dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now lets tail the application log file so that we can see whats going on. In another window, as root, run:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -f /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the following:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00001 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. Initializing&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00002 :   INFO)    &lt;br /&gt;
 IOC Address             : 0x1&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00003 :   INFO)    &lt;br /&gt;
 IOC Port                : 0x81&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00004 :   INFO) &lt;br /&gt;
 csa101: Instantiated as component instance csa101I0.&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:54:38.424 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00005 :   INFO) &lt;br /&gt;
 csa101I0: Waiting for CSI assignment...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Next change the administrative state of the csa101SGI0 service group to  &amp;quot;unlocked&amp;quot; by running (in the SAFplus Platform Console) :&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsUnlock sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the window where you're running the &amp;quot;tail -f&amp;quot; you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00163 :   INFO) &lt;br /&gt;
 csa101: ACTIVE state requested; activating service&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:37.092 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00164 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.094 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00165 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!   .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:39.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00166 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!    .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00167 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!     .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:41.097 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00168 :   INFO) &lt;br /&gt;
 csa101: Threaded Hello World!      .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 11:59:43.095 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00169 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!       .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As you can tell from the output log our component is up and running! It is continuously printing our 'Hello World!' output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Now change the state of the csa101SGI0 service group back to &amp;quot;locked-for-assignment&amp;quot; by running (in the SAFplus Platform Console): &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockAssignment sg csa101SGI0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the tail -f output you should see:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding = &amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot; align = &amp;quot;center&amp;quot; width=&amp;quot;680&amp;quot;&lt;br /&gt;
 ! style=&amp;quot;color:black;background-color:#ffffaa;&amp;quot; align=&amp;quot;center&amp;quot;| /root/asp/var/log/csa101I0Log.latest&lt;br /&gt;
 |-&lt;br /&gt;
 |&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Wed Nov 12 12:07:17.591 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00625 :   INFO) &lt;br /&gt;
 csa101: Unthreaded Hello World!  .&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00626 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Set Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00627 :   INFO) &lt;br /&gt;
 CSI Flags : [Target One]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00628 :   INFO) &lt;br /&gt;
 CSI Name : [csa101CSII0]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00629 :   INFO) &lt;br /&gt;
 HA state : [Quiesced]&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.281 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00630 :   INFO) &lt;br /&gt;
 csa101: Acknowledging new state quiesced&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00632 :   INFO) &lt;br /&gt;
 Component [csa101I0] : PID [10950]. CSI Remove Received&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00633 :   INFO)    &lt;br /&gt;
 CSI                     : csa101CSII0&lt;br /&gt;
&lt;br /&gt;
Wed Nov 12 12:07:19.312 2014 (SCNodeI0.10950 : csa101I0.MAI.---.00634 :   INFO)    &lt;br /&gt;
 CSI Flags               : 0x2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Our component has been put into Lock Assignment state so our 'Hello World!' output has stopped printing to the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;At this point you can either unlock the service group to change its state to &amp;quot;unlocked&amp;quot; or you can lock it for instantiation to change it to state  &amp;quot;locked-for-instantiation&amp;quot;.  The latter will cause the csa101 process to die.  From state &amp;quot;locked-for-assignment&amp;quot;, it is possible to change the state to &amp;quot;locked-for-instantiation&amp;quot; by running (in the SAFplus Platform Console):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cli[Test:SCNodeI0:CPM]-&amp;gt; amsLockInstantiation sg csa101SGI0&lt;br /&gt;
cli[Test:SCNodeI0:CPM] -&amp;gt; end&lt;br /&gt;
cli[Test:SCNodeI0] -&amp;gt; end&lt;br /&gt;
cli[Test] -&amp;gt; bye&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stopping SAFplus Platform===&lt;br /&gt;
&lt;br /&gt;
To stop SAFplus Platform on the System Controller&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a shell.&lt;br /&gt;
&amp;lt;li&amp;gt;ssh into the System Controller node as root.&lt;br /&gt;
&amp;lt;li&amp;gt;Once logged in, run the following command&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /root/asp&lt;br /&gt;
# etc/init.d/asp stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Summary and Next Steps==&lt;br /&gt;
In the csa101 example we learned the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;How to create a system model using the '''SAFplus Platform IDE'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to generate the source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to customize this source code to fit a specific application.&lt;br /&gt;
&amp;lt;li&amp;gt;How to configure and build the customized source code.&lt;br /&gt;
&amp;lt;li&amp;gt;How to make runtime images and deploy them to target machines.&lt;br /&gt;
&amp;lt;li&amp;gt;How to start and stop '''SAFplus'''.&lt;br /&gt;
&amp;lt;li&amp;gt;How to interact with system components using the '''SAFplus Platform Console'''.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next logical step would be to run through the '''SAFplus Platform Evaluation System User Guide'''. This guide goes over more complex system configurations and introduces new concepts.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform IDE''' see the '''SAFplus Platform IDE User Guide'''.&lt;br /&gt;
&lt;br /&gt;
For more in depth information on the '''SAFplus Platform SDK''' see the '''SAFplus Platform SDK User Guide'''.&lt;br /&gt;
&lt;br /&gt;
==Appendix A: target.conf Settings==&lt;br /&gt;
&lt;br /&gt;
Below is a description of the values in the settings in the &amp;lt;code&amp;gt;target.conf&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TRAP_IP''' (Mandatory): Specifies where the SNMP SubAgent should send traps at runtime.  If you do not have an SNMP SubAgent in your model specify '''127.0.0.1''' as the value.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TRAP_IP=127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_IP''' (Mandatory if deployed on an ATCA chassis): Specifies the IP address of the target system's chassis management module or shelf manager. &amp;lt;i&amp;gt;ATCA chassis Example&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_IP=169.254.1.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CMM_USERNAME''' and '''CMM_PASSWORD''' (Mandatory if deployed on an ATCA chassis): Specifies the username and password required for the OpenClovis SAFplus Platform Chassis Manager to connect to the target system's chassis management module. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CMM_USERNAME=root&lt;br /&gt;
CMM_PASSWORD=password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTALL_PREREQUISITES=YES|NO''' (Mandatory): Specifies whether the target images will include 3rd party runtime prerequisites or not.  Say '''YES''' if the target nodes do not meet the target host requirements specified in the Installation section of this document.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTALL_PREREQUISITES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''INSTANTIATE_IMAGES=YES|NO''' (Mandatory): Specifies whether &amp;lt;code&amp;gt;make images&amp;lt;/code&amp;gt; will generate node-instance specific images instead of only generating node-type specific images.  This option is a development optimization for advanced users of SAFplus Platform SDK.  If unsure, say '''YES'''. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
INSTANTIATE_IMAGES=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''CREATE_TARBALLS=YES|NO''' (Mandatory): Specifies whether the node-instance specific images created will be packaged into tarballs for deployment onto the target system.  If unsure, say '''YES'''.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE_TARBALLS=YES&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''TIPC_NETID''' (Mandatory): Specifies a unique identifier used by TIPC to set up interprocess communication across the deployed OpenClovis SAFplus Platform cluster.  This is an unsigned 32-bit integer, and &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be unique for every model that is deployed.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
TIPC_NETID=1340&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Details''': These specify the node-instance specific parameters required for deploying the model. For each node in the model there is a corresponding entry in the file:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SLOT_&amp;lt;node instance name&amp;gt;''' (Mandatory): Specifies which slot the node is located in.  The first slot is slot 1 -- DO NOT USE SLOT NUMBER 0, it is invalid.  When deployed to an ATCA chassis, the physical slot in which the blade is actually installed will override this value.  When deployed to regular (non-ATCA) systems, this is a logical slot and must be unique for every node in the cluster. &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''LINK_&amp;lt;node instance name&amp;gt;''' (Optional): Specifies the ethernet interface used by the node for OpenClovis SAFplus Platform communication with the rest of the cluster.  If unspecified, this defaults to &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH_&amp;lt;node instance name&amp;gt;''' (Optional if '''ARCH''' is specified): Specifies the target architecture of the node as a combination of machine architecture (MACH) and linux kernel version.  This is only required on a per-node basis if the target cluster has heterogeneous architectures across the nodes.  If it is a homogeneous cluster, a single '''ARCH''' parameter (described below) will suffice.  &amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''ARCH''' (Optional if node-specific '''ARCH_''' parameters are specified): Specifies the target architecture of all nodes in a homogeneous cluster as a combination of machine architecture (MACH) and linux kernel version.  Note: The build process automatically populates this variable based on the last target the model is built for.&amp;lt;i&amp;gt;e.g.&amp;lt;/i&amp;gt;:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ARCH=i386/linux-2.6.14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
For example, if we have a three-node cluster with the following details:&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot; width=&amp;quot;600&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; | '''Example Node Instance Detail'''&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Node Name&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Slot Number&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Link Interface&lt;br /&gt;
!style=&amp;quot;color:#66b154; background:#09477c&amp;quot;| Architecture&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|SCNodeI0&lt;br /&gt;
|1&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI0&lt;br /&gt;
|3&lt;br /&gt;
|eth0&lt;br /&gt;
|i386/linux-2.6.14&lt;br /&gt;
|- style=&amp;quot;color:#ffffff; background:#549cc6&amp;quot;&lt;br /&gt;
|PayloadNodeI1&lt;br /&gt;
|4&lt;br /&gt;
|eth1&lt;br /&gt;
|ppc/linux-2.6.9&lt;br /&gt;
|}&lt;br /&gt;
we would specify the node instance details as:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SLOT_SCNodeI0=1&lt;br /&gt;
SLOT_PayloadNodeI0=3&lt;br /&gt;
SLOT_PayloadNodeI1=4&lt;br /&gt;
&lt;br /&gt;
LINK_SCNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI0=eth0&lt;br /&gt;
LINK_PayloadNodeI1=eth1&lt;br /&gt;
&lt;br /&gt;
ARCH_SCNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI0=i386/linux-2.6.14&lt;br /&gt;
ARCH_PayloadNodeI1=ppc/linux-2.6.9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Appendix B: AMF Configuration Details==&lt;br /&gt;
This appendix gives brief descriptions of configuration details for instances of different entities (like Node, Service Group, Service Unit etc) that are present in the '''Clovis''' -&amp;gt; '''AMF Configuration''' dialog box.&lt;br /&gt;
&lt;br /&gt;
===Node Instance===&lt;br /&gt;
This screen displays the node instance that was created by the Node Instance Wizard. This node instance was created because the node type '''SCNode''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Node Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_NodeInstanceDetails.png|frame|center| '''Node Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Instance Name''': This field holds the name of the node instance. This name must be unique. The name that was generated combines the node type (SCNode), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Node Type''': This field holds the node type that was selected on the wizard screen.&lt;br /&gt;
&amp;lt;li&amp;gt;'''MOID''': This is the unique identifier for the node instance. It was generated by the wizard. The format of this ID is a string representing the one and only instance of the chassis (\Chassis:0) defined in the Resource Editor followed by a string representing the first and only instance of the blade type (\SysBlade:0) that was selected in the Node Instance Wizard.&lt;br /&gt;
&amp;lt;br&amp;gt;[[File:OpenClovis_Note.png]]'''MOID''' is an acronym for Managed Object Identifier. It must be unique and is used to identify which hardware chassis and blade type this instance will run on.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Unit Instance===&lt;br /&gt;
This screen displays the service unit instance that was created by the Service Group Instance Wizard. This service unit instance was created because the service unit type is associated with both the selected node type (SCNode) and the selected service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='SU Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SUInstanceDetails.png|frame|center| '''SU Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SU Instance Name''': This field holds the name of the service unit instance. This name must be unique. The name that was generated combines the service unit type (csa101SU), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Unit Type''': This field holds the type of the service unit instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Instance===&lt;br /&gt;
This screen displays the component instance that was created by the Service Group Instance Wizard. This component instance was created because the component type is associated with the created parent service unit type (csa101SU) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_ComponentInstanceDetails.png|frame|center| '''Component Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Instance Name''': This field holds the name of the component instance. This name must be unique. The name that was generated combines the component type (csa101), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Type''': This field holds the type of the component instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Service Group Instance===&lt;br /&gt;
This screen displays the service group instance that was created by the Service Group Instance Wizard. This service group instance was created because the service group type '''csa101SG''' was selected on the wizard screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Group Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SGInstanceDetails.png|frame|center| '''Service Group Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''SG Instance Name''': This field holds the name of the service group instance. This name must be unique. The name that was generated combines the service group type (csa101SG), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceGroup Type''': This field holds the type of the service group instance.&lt;br /&gt;
&amp;lt;li&amp;gt;'''Associated Service Units''': This button is used to associate service unit instances with this service group instance. Creating this association indicates that the selected service unit(s) will run within this service group instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clicking the '''Associated Service Units''' Edit... button will display the following dialog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Associated Service Units Dialog'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SG_SI_Association.png|frame|center| '''Associated Service Units Dialog''' ]]&lt;br /&gt;
&lt;br /&gt;
This dialog lists the service unit instances that can be associated with this service group instance. The list contains only one item, the service unit instance that was created by the wizard. This item is checked indicating that the wizard automatically chose this service unit instance to run within the service group instance.&lt;br /&gt;
&lt;br /&gt;
===Service Instance Instance===&lt;br /&gt;
This screen displays the service instance that was created by the Service Group Instance Wizard. This service instance was created because the service instance type is associated with the parent service group type (csa101SG) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_SIInstanceDetails.png|frame|center| '''Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Service Instance Name''': This field holds the name of the service instance. This name must be unique. The name that was generated combines the service instance type (csa101SI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ServiceInstance Type''': This field holds the type of the service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Component Service Instance Instance===&lt;br /&gt;
This screen displays the component service instance that was created by the Service Group Instance Wizard. This component service instance was created because the component service instance is associated with the parent service instance type (csa101SI) in our model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id='Component Service Instance Details'&amp;gt;&amp;lt;/span&amp;gt;[[File:Tutorial_CSIInstanceDetails.png|frame|center| '''Component Service Instance Details''' ]]&lt;br /&gt;
&lt;br /&gt;
The information on this screen is described below.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Component Service Instance Name''': This field holds the name of the component service instance. This name must be unique. The name that was generated combines the component service instance type (csa101CSI), the letter I (for Instance), and the number 0 (since this is the first instance of this type).&lt;br /&gt;
&amp;lt;li&amp;gt;'''ComponentServiceInstance Type''': This field holds the type of the component service instance.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Workspace_Launcher.png</id>
		<title>File:Workspace Launcher.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Workspace_Launcher.png"/>
				<updated>2014-11-14T07:17:30Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Service_Instance_List_csa101SII0.png</id>
		<title>File:Service Instance List csa101SII0.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Service_Instance_List_csa101SII0.png"/>
				<updated>2014-11-14T07:16:43Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Service_Group_List_csa101SGI0.png</id>
		<title>File:Service Group List csa101SGI0.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Service_Group_List_csa101SGI0.png"/>
				<updated>2014-11-14T07:16:26Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Service_Group_List.png</id>
		<title>File:Service Group List.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Service_Group_List.png"/>
				<updated>2014-11-14T07:16:13Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Service_Group_Details.png</id>
		<title>File:Service Group Details.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Service_Group_Details.png"/>
				<updated>2014-11-14T07:15:55Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:SAF_Service_Type_Name.png</id>
		<title>File:SAF Service Type Name.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:SAF_Service_Type_Name.png"/>
				<updated>2014-11-14T07:14:57Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:SAF_Component_Details.png</id>
		<title>File:SAF Component Details.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:SAF_Component_Details.png"/>
				<updated>2014-11-14T07:14:36Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Resource_Editor.png</id>
		<title>File:Resource Editor.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Resource_Editor.png"/>
				<updated>2014-11-14T07:14:17Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Node_Instance_List.png</id>
		<title>File:Node Instance List.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Node_Instance_List.png"/>
				<updated>2014-11-14T07:13:52Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Node_Instance_Details_SCNodeI0.png</id>
		<title>File:Node Instance Details SCNodeI0.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Node_Instance_Details_SCNodeI0.png"/>
				<updated>2014-11-14T07:13:29Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Node_Instance_Details_csa101SUI0.png</id>
		<title>File:Node Instance Details csa101SUI0.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Node_Instance_Details_csa101SUI0.png"/>
				<updated>2014-11-14T07:13:05Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:Node_Instance_Details_csa101I0.png</id>
		<title>File:Node Instance Details csa101I0.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:Node_Instance_Details_csa101I0.png"/>
				<updated>2014-11-14T07:12:40Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:New_Project_Wizard.png</id>
		<title>File:New Project Wizard.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:New_Project_Wizard.png"/>
				<updated>2014-11-14T07:12:25Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	<entry>
		<id>https://help.openclovis.com/index.php/File:IDE_Welcome_Screen.png</id>
		<title>File:IDE Welcome Screen.png</title>
		<link rel="alternate" type="text/html" href="https://help.openclovis.com/index.php/File:IDE_Welcome_Screen.png"/>
				<updated>2014-11-14T07:12:10Z</updated>
		
		<summary type="html">&lt;p&gt;Prasad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Prasad</name></author>	</entry>

	</feed>