Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: linux-ha by panjiam from 
      ([email protected])
   2. Linux-HA CVS: cts by panjiam from 
      ([email protected])
   3. Linux-HA CVS: cts by panjiam from 
      ([email protected])
   4. Linux-HA CVS: cts by panjiam from 
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Sat, 25 Mar 2006 09:38:27 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: linux-ha by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Module  : linux-ha

Dir     : linux-ha


Modified Files:
        configure.in 


Log Message:
new master-slave dummy RA
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/configure.in,v
retrieving revision 1.496
retrieving revision 1.497
diff -u -3 -r1.496 -r1.497
--- configure.in        23 Mar 2006 02:36:59 -0000      1.496
+++ configure.in        25 Mar 2006 16:38:26 -0000      1.497
@@ -10,7 +10,7 @@
 AC_INIT(heartbeat.spec.in)
 
 AC_CONFIG_AUX_DIR(.)
-AC_REVISION($Revision: 1.496 $) dnl cvs revision
+AC_REVISION($Revision: 1.497 $) dnl cvs revision
 AC_CANONICAL_HOST
 
 
@@ -2505,7 +2505,7 @@
        cts/extracttests.py                                     \
        cts/OCFIPraTest.py                                      \
        cts/CIB.py                                              \
-       cts/OCFDummy2                                           \
+       cts/OCFMSDummy                                          \
        cts/LSBDummy                                            \
 crm/Makefile                                                   \
        crm/cib/Makefile                                        \




------------------------------

Message: 2
Date: Sat, 25 Mar 2006 09:52:07 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cts by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Project : linux-ha
Module  : cts

Dir     : linux-ha/cts


Added Files:
        OCFMSDummy.in 


Log Message:
the original RA (OCFDummy2) keeps resource instance status in a file,
this is ok except when a host with some resource instances running 
is stonithed. After reboot the resource instances are still 'running' 
because they are still in the file.
This RA starts a process for a resource instance.






------------------------------

Message: 3
Date: Sat, 25 Mar 2006 09:53:30 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cts by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Project : linux-ha
Module  : cts

Dir     : linux-ha/cts


Modified Files:
        Makefile.am 


Log Message:
install testing RAs to cts directory, and use OCFMSDummy instead of OCFDummy2
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- Makefile.am 23 Mar 2006 02:34:35 -0000      1.11
+++ Makefile.am 25 Mar 2006 16:53:29 -0000      1.12
@@ -36,9 +36,9 @@
 
 hard_DATA =            README
 
-ocfdir                 =       $(OCF_RA_DIR)/heartbeat/
-ocf_SCRIPTS            =       OCFDummy2
+ocfdir                 =       $(libdir)/heartbeat/cts
+ocf_SCRIPTS            =       OCFMSDummy
 
-lsbdir                 =       /etc/init.d/
+lsbdir                 =       $(libdir)/heartbeat/cts
 lsb_SCRIPTS            =       LSBDummy
                        




------------------------------

Message: 4
Date: Sat, 25 Mar 2006 09:55:18 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cts by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Project : linux-ha
Module  : cts

Dir     : linux-ha/cts


Modified Files:
        CIB.py.in 


Log Message:
1,better indent. 2,added lsb&master-slave resources, in full pathname
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CIB.py.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- CIB.py.in   13 Mar 2006 09:42:42 -0000      1.4
+++ CIB.py.in   25 Mar 2006 16:55:17 -0000      1.5
@@ -13,226 +13,234 @@
 from CM_hb import HeartbeatCM
 
 class CIB:
-       cib_option_template = '''
-       <nvpair id="c-pref-1" name="transition_idle_timeout" value="3m"/>
-       <nvpair id="c-pref-2" name="symmetric_cluster" value="true"/>
-       <nvpair id="c-pref-3" name="short_resource_names" value="%d"/>
-       <nvpair id="c-pref-4" name="stop_orphan_resources" value="false"/>
-       <nvpair id="c-pref-5" name="stop_orphan_actions" value="false"/>
-       <nvpair id="c-pref-6" name="remove_after_stop" value="false"/>
-       <nvpair id="c-pref-7" name="is_managed_default" value="true"/>
-       <nvpair id="c-pref-8" name="no_quorum_policy" value="stop"/>
-       <nvpair id="c-pref-9" name="default_resource_stickiness" value="0"/> 
''' 
-
-
-       ipaddr_resource_template = '''
-       <primitive id="DcIPaddr" class="%s" type="IPaddr" provider="heartbeat" 
is_managed="1">
-         <operations>
-           <op id="DcIPaddr-1" name="monitor" interval="5s" timeout="20s"/>
-           <op id="DcIPaddr-2" name="start" timeout="40s"/>
-         </operations>
-         <instance_attributes>
-           <attributes>
-              <nvpair id="DcIPaddr-1" name="%s" value="%s"/>
-           </attributes>
-         </instance_attributes>
-       </primitive> '''
-       
-       clustermon_resource_template = '''
-       <primitive id="cluster_mon" class="ocf" type="ClusterMon" 
provider="heartbeat" is_managed="1">
-         <operations>
-           <op id="cluster_mon-1" name="monitor" interval="5s" timeout="20s" 
prereq="nothing"/>
-           <op id="cluster_mon-2" name="start" timeout="20s" prereq="nothing"/>
-         </operations>
-         <instance_attributes>
-           <attributes>
-             <nvpair id="cluster_mon-1" name="htmlfile" 
value="/suse/abeekhof/Export/cluster.html"/>
-             <nvpair id="cluster_mon-2" name="update" value="10"/>
-             <nvpair id="cluster_mon-3" name="extra_options" value="-n -r"/>
-             <nvpair id="cluster_mon-4" name="user" value="abeekhof"/>
-           </attributes>
-         </instance_attributes>
-       </primitive> ''' 
-
-       ipaddr_location_constraint = '''
-       <rsc_location id="run_DcIPaddr" rsc="DcIPaddr">
-         <rule id="cant_run_DcIPaddr" score="-INFINITY" boolean_op="and">
-           <expression id="dc_ip_expr" attribute="#is_dc" operation="eq" 
value="false"/>
-         </rule>
-       </rsc_location> '''
-
-       clustermon_location_constraint = '''
-       <rsc_location id="run_cluster_mon" rsc="cluster_mon">
-         <rule id="cant_run_cluster_mon" score="-INFINITY" boolean_op="and">
-           <expression id="mon_expr" attribute="#is_dc" operation="eq" 
value="false"/>
-         </rule>
-       </rsc_location> '''
-
-       resource_group_template = '''
-       <group id="group-1">
-         <primitive id="%s" class="%s" type="IPaddr" provider="heartbeat">
-           <operations>
-             <op id="%s-1" name="monitor" interval="5s" timeout="20s"/>
-           </operations>
-           <instance_attributes>
-             <attributes>
-               <nvpair id="%s-1" name="%s" value="%s"/>
-             </attributes>
-           </instance_attributes>
-         </primitive>
-         <primitive id="%s" class="%s" type="IPaddr" provider="heartbeat">
-           <operations>
-             <op id="%s-1" name="monitor" interval="5s" timeout="20s"/>
-           </operations>
-           <instance_attributes>
-             <attributes>
-               <nvpair id="%s-1" name="%s" value="%s"/>
+    cib_option_template = '''
+        <nvpair id="c-pref-1" name="transition_idle_timeout" value="3m"/>
+        <nvpair id="c-pref-2" name="symmetric_cluster" value="true"/>
+        <nvpair id="c-pref-3" name="short_resource_names" value="%d"/>
+        <nvpair id="c-pref-4" name="stop_orphan_resources" value="false"/>
+        <nvpair id="c-pref-5" name="stop_orphan_actions" value="false"/>
+        <nvpair id="c-pref-6" name="remove_after_stop" value="false"/>
+        <nvpair id="c-pref-7" name="is_managed_default" value="true"/>
+        <nvpair id="c-pref-8" name="no_quorum_policy" value="stop"/>
+        <nvpair id="c-pref-9" name="default_resource_stickiness" value="0"/> 
''' 
+
+
+    dc_ipaddr_resource_template = ''' 
+        <primitive id="DcIPaddr" class="ocf" type="IPaddr" 
provider="heartbeat" is_managed="1">
+          <operations>
+             <op id="DcIPaddr-1" name="monitor" interval="5s" timeout="20s"/>
+             <op id="DcIPaddr-2" name="start" timeout="40s"/>
+          </operations>
+          <instance_attributes>
+             <attributes>
+               <nvpair id="DcIPaddr-1" name="ip" value="%s"/>
+             </attributes>
+          </instance_attributes>
+        </primitive> '''
+    
+    clustermon_resource_template = ''' 
+        <primitive id="cluster_mon" class="ocf" type="ClusterMon" 
provider="heartbeat" is_managed="1">
+          <operations>
+            <op id="cluster_mon-1" name="monitor" interval="5s" timeout="20s" 
prereq="nothing"/>
+            <op id="cluster_mon-2" name="start" timeout="20s" 
prereq="nothing"/>
+          </operations>
+          <instance_attributes>
+            <attributes>
+               <nvpair id="cluster_mon-1" name="htmlfile" 
value="/suse/abeekhof/Export/cluster.html"/>
+               <nvpair id="cluster_mon-2" name="update" value="10"/>
+               <nvpair id="cluster_mon-3" name="extra_options" value="-n -r"/>
+               <nvpair id="cluster_mon-4" name="user" value="abeekhof"/>
+           </attributes>
+          </instance_attributes>
+        </primitive> ''' 
+
+    dc_ipaddr_location_constraint = ''' 
+        <rsc_location id="run_DcIPaddr" rsc="DcIPaddr">
+          <rule id="cant_run_DcIPaddr" score="-INFINITY" boolean_op="and">
+             <expression id="dc_ip_expr" attribute="#is_dc" operation="eq" 
value="false"/>
+          </rule>
+        </rsc_location> '''
+
+    clustermon_location_constraint = ''' 
+        <rsc_location id="run_cluster_mon" rsc="cluster_mon">
+          <rule id="cant_run_cluster_mon" score="-INFINITY" boolean_op="and">
+             <expression id="mon_expr" attribute="#is_dc" operation="eq" 
value="false"/>
+          </rule>
+        </rsc_location> '''
+
+    lsb_resource = ''' 
+        <primitive id="lsb_dummy" class="lsb" 
type="@libdir@/heartbeat/cts/LSBDummy" provider="heartbeat">
+          <operations>
+            <op id="ocf_lsb_monitor" name="monitor" interval="5s" 
timeout="20s"/>
+          </operations>
+        </primitive> '''
+
+    master_slave_resource = ''' 
+        <master_slave id="master_rsc_1">
+          <instance_attributes>
+            <attributes>
+              <nvpair id="clone_max_1" name="clone_max" value="%d"/>
+              <nvpair id="clone_node_max_2" name="clone_node_max" value="%d"/>
+              <nvpair id="master_max_3" name="master_max" value="%d"/>
+              <nvpair id="master_node_max_4" name="master_node_max" 
value="%d"/>
+            </attributes>
+          </instance_attributes>
+          <primitive id="ocf_msdummy" class="ocf" 
type="@libdir@/heartbeat/cts/OCFMSDummy" provider="heartbeat">
+            <operations>
+              <op id="ocf_msdummy_monitor" name="monitor" interval="5s" 
timeout="10s"/>
+            </operations>
+            <instance_attributes>
+              <attributes>
+                <nvpair id="logfile_id_1" name="logfile" 
value="/var/log/cts_ocfdummy.log"/>
               </attributes>
-           </instance_attributes>
-         </primitive>
-         <primitive id="%s" class="%s" type="IPaddr" provider="heartbeat">
-           <operations>
-             <op id="%s-1" name="monitor" interval="5s" timeout="20s"/>
-           </operations>
-           <instance_attributes>
-             <attributes>
-               <nvpair id="%s-1" name="%s" value="%s"/>
-             </attributes>
-           </instance_attributes>
-         </primitive>
-       </group> '''  
-
-
-       per_node_resource_template = '''
-       <primitive id="%s" class="%s" type="IPaddr" provider="heartbeat" 
is_managed="1">
-         <operations>
-           <op id="%s-1" name="monitor" interval="5s" timeout="20s"/>
-           <op id="%s-2" name="start" timeout="40s"/>
-         </operations>
-         <instance_attributes>
-           <attributes>
-             <nvpair id="%s-1" name="%s" value="%s"/>
-           </attributes>
-         </instance_attributes>
-       </primitive> '''
-
-       per_node_constraint_template = ''' 
-       <rsc_location id="run_%s" rsc="%s">
-         <rule id="pref_run_%s" score="100" boolean_op="and">
-           <expression id="%s_loc_expr" attribute="#uname" operation="eq" 
value="%s"/>
-         </rule>
-       </rsc_location>
-       ''' 
-
-
-       stonith_resource_template = """
-       <clone id="DoFencing">
-         <instance_attributes>
-           <attributes>
-             <nvpair id="DoFencing-1" name="clone_max" value="%d"/>
-             <nvpair id="DoFencing-2" name="clone_node_max" value="1"/>
-           </attributes>
-         </instance_attributes>
-         <primitive id="child_DoFencing" class="stonith" type="ssh">
-           <operations>
-             <op id="DoFencing-1" name="monitor" interval="20s" timeout="40s" 
prereq="nothing"/>
-             <op id="DoFencing-2" name="start" timeout="20s" prereq="nothing"/>
-           </operations>
-           <instance_attributes>
-             <attributes>
-               <nvpair id="child_DoFencing-1" name="hostlist" value="%s"/>
-             </attributes>
-           </instance_attributes>
-         </primitive>
-       </clone>"""
-
-       cib_fencing = """
-       <nvpair id="stonith_enabled" name="stonith_enabled" value="true"/> """
-
-       cib_template ='''
-       <cib cib_feature_revision="1" have_quorum="false">
-         <configuration>
-           <crm_config>  %s </crm_config>
-           <nodes/>
-           <resources> %s </resources>
-           <constraints> %s </constraints>
-         </configuration>
-         <status/>
-       </cib> '''
-
-       def __init__(self, CM):
-               self.CM = CM
-
-               #make up crm config
-               cib_options = self.cib_option_template % self.CM.use_short_names
-               if CM.Env["DoFencing"] == 1:
-                       cib_options += self.cib_fencing
-
-               #create resources and their constraints
-               resources = ""
-               constraints = ""
-
-               rsc_class = self.CM.Env["ResourceClass"]
-               keyname = ""
-               if rsc_class =="ocf":
-                       keyname = "ip"
-               elif rsc_class=="heartbeat":
-                       keyname = "1"
-               else:
-                       raise "Unknown resource class, aborted."
-
-               if self.CM.Env["CIBResource"] == 1:
-                       self.CM.log("Enabling DC resource")
-                       resources += self.ipaddr_resource_template % \
-                               (rsc_class, keyname, self.CM.Env["IPBase"])
-                       constraints += self.ipaddr_location_constraint
-                       if self.CM.cluster_monitor == 1:
-                               resources += self.clustermon_resource_template
-                               constraints += 
self.clustermon_location_constraint
-
-               fields = string.split(self.CM.Env["IPBase"], '.')
-               fields[3] = str(int(fields[3])+1)
-               ip1 = string.join(fields, '.')
-               fields[3] = str(int(fields[3])+1)
-               ip2 = string.join(fields, '.')
-               fields[3] = str(int(fields[3])+1)
-               ip3 = string.join(fields, '.')
-               self.CM.Env["IPBase"] = ip3
-
-               resources += self.resource_group_template % \
-                               ("child_"+ip1, rsc_class, "child_"+ip1, 
-                               "child_"+ip1, keyname, ip1,     # primitive 1
-                               "child_"+ip2, rsc_class, "child_"+ip2, 
-                               "child_"+ip2, keyname, ip2,     # primitive 2
-                               "child_"+ip3, rsc_class, "child_"+ip3, 
-                               "child_"+ip3, keyname, ip3)     # primitive 3
-
-               # per node resource
-               fields = string.split(self.CM.Env["IPBase"], '.')
-               for node in self.CM.Env["nodes"]:
-                       fields[3] = str(int(fields[3])+1)
-                       ip = string.join(fields, '.')
-                       self.CM.Env["IPBase"] = ip
-                       per_node_resources = self.per_node_resource_template % \
-                               ("rsc_"+node, rsc_class,
-                               "rsc_"+node, "rsc_"+node, "rsc_"+node, keyname, 
ip)     
-                       
-                       per_node_constraint = self.per_node_constraint_template 
% \
-                               ("rsc_"+node, "rsc_"+node, "rsc_"+node, 
"rsc_"+node, node)
-
-                       resources += per_node_resources
-                       constraints += per_node_constraint
+            </instance_attributes>
+          </primitive>
+        </master_slave>'''
+
+    resource_group_template = ''' 
+        <group id="group-1">
+          <primitive id="ocf_child" class="ocf" type="IPaddr" 
provider="heartbeat">
+            <operations>
+              <op id="ocf_child_monitor" name="monitor" interval="5s" 
timeout="20s"/>
+            </operations>
+            <instance_attributes>
+              <attributes>
+                <nvpair id="ocf_child_ip_1" name="ip" value="%s"/>
+              </attributes>
+            </instance_attributes>
+          </primitive>
+          <primitive id="heartbeat_child" class="heartbeat" type="IPaddr" 
provider="heartbeat">
+            <operations>
+              <op id="heartbeat_child_monitor" name="monitor" interval="5s" 
timeout="20s"/>
+            </operations>
+            <instance_attributes>
+              <attributes>
+                <nvpair id="heartbeat_child_ip_1" name="1" value="%s"/>
+              </attributes>
+            </instance_attributes>
+          </primitive>
+        </group> '''  
+
+
+    per_node_resource_template = ''' 
+        <primitive id="%s" class="ocf" type="IPaddr" provider="heartbeat" 
is_managed="1">
+          <operations>
+            <op id="%s-1" name="monitor" interval="5s" timeout="20s"/>
+            <op id="%s-2" name="start" timeout="40s"/>
+          </operations>
+          <instance_attributes>
+            <attributes>
+              <nvpair id="%s-1" name="ip" value="%s"/>
+            </attributes>
+          </instance_attributes>
+        </primitive> '''
+
+    per_node_constraint_template = ''' 
+        <rsc_location id="run_%s" rsc="%s">
+          <rule id="pref_run_%s" score="100" boolean_op="and">
+            <expression id="%s_loc_expr" attribute="#uname" operation="eq" 
value="%s"/>
+          </rule>
+        </rsc_location> ''' 
+
+    stonith_resource_template = """ 
+        <clone id="DoFencing">
+          <instance_attributes>
+            <attributes>
+              <nvpair id="DoFencing-1" name="clone_max" value="%d"/>
+              <nvpair id="DoFencing-2" name="clone_node_max" value="1"/>
+            </attributes>
+          </instance_attributes>
+          <primitive id="child_DoFencing" class="stonith" type="ssh">
+            <operations>
+              <op id="DoFencing-1" name="monitor" interval="20s" timeout="40s" 
prereq="nothing"/>
+              <op id="DoFencing-2" name="start" timeout="20s" 
prereq="nothing"/>
+            </operations>
+            <instance_attributes>
+              <attributes>
+                <nvpair id="child_DoFencing-1" name="hostlist" value="%s"/>
+              </attributes>
+            </instance_attributes>
+          </primitive>
+        </clone>"""
+
+    cib_fencing = """
+        <nvpair id="stonith_enabled" name="stonith_enabled" value="true"/> """
+
+    cib_template ='''
+<cib cib_feature_revision="1" have_quorum="false">
+  <configuration>
+     <crm_config>  %s 
+     </crm_config>
+     <nodes/>
+     <resources> %s 
+     </resources>
+     <constraints> %s 
+     </constraints>
+    </configuration>
+    <status/>
+</cib> '''
+
+    def NextIP(self):
+        fields = string.split(self.CM.Env["IPBase"], '.')
+        fields[3] = str(int(fields[3])+1)
+        ip = string.join(fields, '.')
+        self.CM.Env["IPBase"]=ip
+        return ip
+
+    def __init__(self, CM):
+        self.CM = CM
+
+        #make up crm config
+        cib_options = self.cib_option_template % self.CM.use_short_names
+        if CM.Env["DoFencing"] == 1:
+            cib_options += self.cib_fencing
+
+        #create resources and their constraints
+        resources = ""
+        constraints = ""
+
+        if self.CM.Env["CIBResource"] == 1:
+            self.CM.log("Enabling DC resource")
+            resources += self.dc_ipaddr_resource_template % 
self.CM.Env["IPBase"]
+            constraints += self.dc_ipaddr_location_constraint
+            if self.CM.cluster_monitor == 1:
+                resources += self.clustermon_resource_template
+                constraints += self.clustermon_location_constraint
+
+       ip1=self.NextIP()
+       ip2=self.NextIP()
+        resources += self.resource_group_template % (ip1, ip2)
+
+       # lsb resource
+       resources += self.lsb_resource
+
+        # per node resource
+        fields = string.split(self.CM.Env["IPBase"], '.')
+        for node in self.CM.Env["nodes"]:
+            ip = self.NextIP()
+            per_node_resources = self.per_node_resource_template % \
+                ("rsc_"+node, "rsc_"+node, "rsc_"+node, "rsc_"+node, ip)    
+            
+            per_node_constraint = self.per_node_constraint_template % \
+                ("rsc_"+node, "rsc_"+node, "rsc_"+node, "rsc_"+node, node)
+
+            resources += per_node_resources
+            constraints += per_node_constraint
+    
+        # fencing resource
+        nodelist = ""
+        len = 0
+        for node in self.CM.Env["nodes"]:
+            nodelist += node + " "
+            len = len + 1
+        stonith_resource = self.stonith_resource_template % (len, nodelist)
+        resources += stonith_resource
        
-               # fencing resource
-               nodelist = ""
-               len = 0
-               for node in self.CM.Env["nodes"]:
-                       nodelist += node + " "
-                       len = len + 1
-               stonith_resource = self.stonith_resource_template % (len, 
nodelist)
-               resources += stonith_resource
+       #master slave resource
+       resources += self.master_slave_resource % (2*len, 2, len, 1)
 
-               self.cts_cib = self.cib_template %  (cib_options, resources, 
constraints)
+       # generate cib
+        self.cts_cib = self.cib_template %  (cib_options, resources, 
constraints)
 
-       def cib(self):
-               return self.cts_cib
+    def cib(self):
+        return self.cts_cib




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 28, Issue 59
********************************************

Reply via email to