[Pacemaker] Extending CTS with other tests
Andrew Beekhof
andrew at beekhof.net
Tue Nov 30 10:21:23 UTC 2010
On Thu, Nov 25, 2010 at 1:36 PM, Vit Pelcak <vpelcak at suse.cz> wrote:
> Hello everyone.
>
> I ran into problem.
>
> I cannot format ocfs2 partition with pcmk until "primitive o2cb
> ocf:ocfs2:o2cb" is running. Right?
Probably
> I was thinking the way, that I would create scripts which would prepare
> cluster for my specific scenario and then CTS would add resources and do the
> testing itself.
Yep, this is the general idea.
> Now I'm quite unsure. I could prepare ocfs2 partition with pcmk and just
> reuse it, but maybe you will come up with better idea.
>
> I added script I use for adding ocfs2 resource (cluster is expected to be
> running and have some stonith ready) to attachment. It works fine so far.
>
> Frankly, I'm quite clueless how to get this into CTS as I'm not much into
> Python. Maybe if somebody could help me how to get some easier scenario into
> CTS, I'd be able to figure out other scenarios as well.
The script is fine up to the point where you add ocf:heartbeat:Filesystem.
It can stop after you do the mkfs.
Copy the HASI class (which already has the logic for adding the dlm
and o2cb resources) in CIB.py and add the Filesystem resource line to
the end of add_resources().
You'll probably need to add the cmirror and clvm parts there too.
>
> I have put into attachment the one reasonably easy. It is about mounting
> ext3 partition into mysql dir and then running mysql.
>
> Problem here is, that doing so is not enough. I spotted, that is is needed
> to manually restart mysql when that ext3 partition is mounted (and chmod
> needs to run before it as well, otherwise mysql has not write permission
> there and crashes). Only after that resource starts and works properly.
>
> So far, I have created:
>
> class MYSQL(CIB10):
> def add_resources(self):
> self._create('''primitive fs1 ocf:heartbeat:Filesystem op monitor
> interval="20" timeout="40" start-delay="10" params device="%s"
> directory="%s" fstype="%s"''')
you're using "...=%s", but then not passing in any value. thats not
going to work.
think of it like a printf
> self._create('''property no-quorum-policy="ignore" op monitor
> interval="10" timeout="120" start-delay="10 params binary="%s" pid="%s''')
> self._create('''primitive sql1 ocf:heartbeat:mysql''')
> self._create('''colocation col-sql1 +inf: sql1 fs1''')
> self._create('''order order-sql1 +inf: fs1 sql1''')
Where are your ocfs2 resources?
>
> in CIB.py. Then, maybe I should call that class in
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs:
> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>
>
More information about the Pacemaker
mailing list