New OCF edition of o2cb
Hi,
Here is an OCF-compliant edition of o2cb for use by cluster managers to control userspace-based OCFS2 installations.
It defaults to using the pcmk stack, but can also be configured to use cman.
I believe the correct location for it is vendor/common
Oh, and if the license is an issue, it can be changed.
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: o2cb.ocf.sh
Type: application/octet-stream
Size: 11056 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20081118/9c3e6005/attachment.obj
Quoted 4 lines · Andrew Beekhof
Here is an OCF-compliant edition of o2cb for use by cluster managers to control userspace-based OCFS2 installations.
It defaults to using the pcmk stack, but can also be configured to use cman.
I'm guessing this is basically the same as o2cb.init, but using
configuration and constants used by OCF? Coolness.
Why does it need to 'default' to any stack? o2cb.init gets the
answer out of /etc/sysconfig/o2cb, and I would assume OCF would have a similar sort of thing.
Quoted 1 line
I believe the correct location for it is vendor/common
Yes.
Quoted 1 line
Oh, and if the license is an issue, it can be changed.
GPLv2 is exactly what we use. You can remove the paragraph
about "If you didn't receive a copy of the GPL"; the FSF has moved, and they recommend removing that paragraph. Regarding Copyright, much of the code comes from o2cb.init, which is Copyright Oracle 2005,2008. Please add that copyright.
Joel
Signature · 9 lines
"The question of whether computers can think is just like the question of whether submarines can swim." - Edsger W. Dijkstra Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127
Quoted 10 lines · Joel Becker
Quoted 6 lines · Andrew Beekhof
Here is an OCF-compliant edition of o2cb for use by cluster managers to
control userspace-based OCFS2 installations.
It defaults to using the pcmk stack, but can also be configured to use
cman.I'm guessing this is basically the same as o2cb.init, but using
configuration and constants used by OCF? Coolness.
right
Quoted 4 lines
Why does it need to 'default' to any stack? o2cb.init gets the
answer out of/etc/sysconfig/o2cb, and I would assume OCF would have a similar sort of thing.
Actually not.
OCF expects any options to be supplied in the form of environment variables (which are specified as part of the cluster resource definition and the list of supported ones is described in the script's metadata). Options can also be mandatory or optional (also indicated in the metadata).
eg. this is what an IP address looks like in a cluster configuration:
<primitive id="myFirstIP" class="ocf" type="IPaddr"
provider="heartbeat">
<instance_attributes id="attrs-myFirstIP">
<nvpair id="netmask-myFirstIP" name="cidr_netmask"
value="32"/>
<nvpair id="ip-myFirstIP" name="ip" value="1.2.3.4"/>
</instance_attributes>
</primitive>The cluster manager then translates that into:
OCF_RESKEY_ip=1.2.3.4 OCF_RESKEY_netmask=32 /usr/lib/ocf/
resource.d/heartbeat/IPaddr {action}
where {action} is one of the usual suspects: start, stop, monitor, etc
Note that we didn't specify a value for "nic", so the script will figure out which interface to use.
We could have also left out the netmask and the script would have used the one from the interface.
(Tangent: Obviously the above XML is in Pacemaker syntax, but although cman uses different syntax, it effectively does the same thing)
Applying that to the current topic, the cman version of the resource would be:
<primitive id="o2cb-cman" class="ocf" type="o2cb"
provider="ocfs2">
<instance_attributes id="o2cb-cman-attrs">
<nvpair id="cman-stack" name="stack" value="cman"/>
</instance_attributes>
</primitive>and the Pacemaker version (which can use the advertised default for "stack") would be:
<primitive id="o2cb-pcmk" class="ocf" type="o2cb"
provider="ocfs2"/>
If I had knowledge of cman, its likely I could automatically work out the "right" stack to use instead of just defaulting to pcmk. But for the initial cut, I thought it best to provide a manual setting (that happened to favor the author :-) rather than an automatic one that was probably only half right.
Does that all make sense?
Quoted 8 lines
Quoted 3 lines
I believe the correct location for it is vendor/common
Yes.
Quoted 1 line
Oh, and if the license is an issue, it can be changed.
Quoted 8 lines
GPLv2 is exactly what we use. You can remove the paragraph
about "If you didn't receive a copy of the GPL"; the FSF has moved, and
they recommend removing that paragraph. Regarding Copyright, much of the
code comes from o2cb.init, which is Copyright Oracle 2005,2008. Please
add that copyright.
Np.
Do you want to fix that when you commit or shall I resend?
Quoted 5 lines · Andrew Beekhof
Quoted 3 lines
Why does it need to 'default' to any stack? o2cb.init gets the
answer out of/etc/sysconfig/o2cb, and I would assume OCF would have a similar sort of thing.Actually not.
<snip>
Quoted 9 lines
<primitive id="o2cb-cman" class="ocf" type="o2cb" provider="ocfs2"> <instance_attributes id="o2cb-cman-attrs"> <nvpair id="cman-stack" name="stack" value="cman"/> </instance_attributes> </primitive>and the Pacemaker version (which can use the advertised default for "stack") would be:
Quoted 8 lines
<primitive id="o2cb-pcmk" class="ocf" type="o2cb"provider="ocfs2"/>
If I had knowledge of cman, its likely I could automatically work out the "right" stack to use instead of just defaulting to pcmk. But for the initial cut, I thought it best to provide a manual setting (that happened to favor the author :-) rather than an automatic one that was probably only half right.
Well, if you are just trying to figure out the value to stick in/sys/fs/ocfs2/cluster_stack, the answer is "cman", because I wrote those bits in ocfs2-tools ;-)
Quoted 2 lines
Np.
Do you want to fix that when you commit or shall I resend?
Why don't you resend so we don't have me stomping on it?
Thanks,
Joel
Signature · 9 lines
"Every day I get up and look through the Forbes list of the richest
people in America. If I'm not there, I go to work."
- Robert Orben
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127Quoted 4 lines · Joel Becker
Well, if you are just trying to figure out the value to stick in
/sys/fs/ocfs2/cluster_stack, the answer is "cman", because I wrote those
bits in ocfs2-tools ;-)
Yeah, but pcmk is the future man :)
Quoted 4 lines
Quoted 2 lines
Np.
Do you want to fix that when you commit or shall I resend?Why don't you resend so we don't have me stomping on it?
attached
I'll get together with Lon at some point and get the cman/pcmk auto- detection working - will send a patch when its done.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: o2cb.ocf
Type: application/octet-stream
Size: 10885 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20081119/0db265cd/attachment.obj
-------------- next part --------------
Just wondering what the status of this (and the other non-lsb patches) is... you're not waiting on me to commit are you?
Quoted 26 lines · Andrew Beekhof
Quoted 3 lines · Joel Becker
Well, if you are just trying to figure out the value to stick in
/sys/fs/ocfs2/cluster_stack, the answer is "cman", because I wrote those bits in ocfs2-tools ;-)Yeah, but pcmk is the future man :)
Quoted 4 lines
Quoted 2 lines
Np.
Do you want to fix that when you commit or shall I resend?Why don't you resend so we don't have me stomping on it?
attached
I'll get together with Lon at some point and get the cman/pcmk auto-detection working - will send a patch when its done._______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
http://oss.oracle.com/mailman/listinfo/ocfs2-devel