[Pacemaker] Extending CTS with other tests

Vit Pelcak vpelcak at suse.cz
Tue Nov 23 07:19:59 EST 2010


Hello.

I have prepared several scripts for automation of HA testing.

I'd like to ask for some help with porting them into CTS, or at least 
part of them. As there is no documentation for CTS and I'm just learning 
Python, I could use some help here and there while trying to figure out 
how to do that.

If I understand it right, CIB.py contains configuration of resources and 
new ones are added like:
     stonith_sbd_resource_template = """
<resources>
<primitive class="stonith" id="sbd_stonith" type="external/sbd">
<meta_attributes id="sbd_stonith-meta_attributes">
<nvpair id="sbd_stonith-meta_attributes-target-role" name="target-role" 
value="Started"/>
</meta_attributes>
<operations>
<op id="sbd_stonith-monitor-1" name="monitor" interval="120s" 
prereq="nothing" timeout="300s"/>
<op id="sbd_stonith-monitor-2" name="start" prereq="nothing"  
timeout="120s"/>
<op id="sbd_stonith-monitor-3" name="stop" timeout="120s"/>
</operations>
</operations>
<instance_attributes id="sbd_stonith-instance_attributes">
<nvpair id="sbd_stonith-instance_attributes-sbd_device" 
name="sbd_device" value="%s"/>
</instance_attributes>
</primitive>
</resources>"""

Could this be replaced just by running crm configure .... ? I think, 
that is would be better (but I can be wrong, of course).

Then I would call something like:
stonith_resource = self.stonith_sbd_resource_template % (p_value)

Is that right?

In the process of SBD creation, I need to call:
sbd -d $sbd_disk create

on one of nodes, and

sbd -d $sbd_disk allocate $(hostname)

on every node. How can I do that?

I assume, that CTS can handle formatting of disks for correct fs easily 
by running mkfs or any other commands just as bash would. But how can I 
make it do so on one specific machine while other machines would do 
something else?

Thanks for any help.

Regards
Vit Pelcak





More information about the Pacemaker mailing list