<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Thanks very much for the info and the help.<div><br></div><div>For my problem I have decided to use systemd and its dependency management to create an "instance" service for each clone instance, that then starts the "main" service on a node if any instance service is started. Hopefully works without any coding required...</div><div><br></div><div>I still might have a try at extending the attribute resource. One question though: Is incrementing and decrementing the count robust enough? I would think a solution that actually counts the running instances each time so we don't get any drift would be preferable. But what would be the best way for the agent to get this count?<br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On 17. Oct 2024, at 16:50, Ken Gaillot <kgaillot@redhat.com> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">On Thu, 2024-10-17 at 16:34 +0200, Jochen wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" style="font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">Thanks for the help!<br><br>Before I break out my editor and start writing custom resource<br>agents, one question: Is there a way to use a cloned<br>ocf:pacemaker:attribute resource to set a clone-specific attribute on<br>a node? I.e. attribute "started-0=1" and "started-1=1", depending on<br>the clone ID? For this I would need e.g. a rule to configure a clone<br>specific resource parameter, or is there something like variable<br>substitution in resource parameters?<br></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">No, ocf:pacemaker:attribute won't work properly as a unique clone. If</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">one instance is started and another stopped, it will get the status of</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">one of them wrong.</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">I noticed that yesterday and came up with an idea for a general</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">solution if you feel like tackling it:</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><a href="https://projects.clusterlabs.org/T899" style="font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">https://projects.clusterlabs.org/T899</a><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" style="font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br><blockquote type="cite">On 16. Oct 2024, at 16:22, Ken Gaillot <kgaillot@redhat.com> wrote:<br><br>On Mon, 2024-10-14 at 18:49 +0200, Jochen wrote:<br><blockquote type="cite">Hi, I have two cloned resources in my cluster that have the<br>following<br>properties:<br><br>* There are a maximum of two instances of R1 in the cluster, with<br>a<br>maximum of two per node<br>* When any instance of R1 is started on a node, exactly one<br>instance<br>of R2 should run on that node<br><br>When I configure this, and verify the configuration with<br>"crm_verify<br>-LV", I get the following error:<br><br>clone_rsc_colocation_rh)<span class="Apple-converted-space"> </span><span class="Apple-tab-span" style="white-space: pre;"> </span>error: Cannot interleave R2-clone and<br>R1-clone because they do not support the same number of instances<br>per<br>node<br><br>How can I make this work? Any help would be greatly appreciated.<br></blockquote><br>Hi,<br><br>I believe the number of instances has to be the same because each<br>instance pair on a single node is interleaved.<br><br>There's no direct way to configure what you want, but it might be<br>possible with a custom OCF agent for R1 and attribute-based rules.<br><br>On start, the R1 agent could set a custom node attribute to some<br>value.<br>On stop, it could check whether any other instances are active<br>(assuming that's possible), and if not, clear the attribute. Then,<br>R2<br>could have a location rule enabling it only on nodes where the<br>attribute has the desired value.<br><br>R2 wouldn't stop until *after* the last instance of R1 stops, which<br>could be a problem depending on the particulars of the service.<br>There<br>might also be a race condition if two instances are stopping at the<br>same time, so it might be worthwhile to set ordered=true on the<br>clone.<br><br><blockquote type="cite"><br>Current configuration is as follows:<br><br><resources><br><clone id="R1-clone"><br> <meta_attributes id="R1-clone-meta_attributes"><br> <nvpair name="interleave" value="true" id="R1-clone-<br>meta_attributes-interleave"/><br> <nvpair name="resource-stickiness" value="0" id="R1-clone-<br>meta_attributes-resource-stickiness"/><br> <nvpair name="clone-max" value="2" id="R1-clone-<br>meta_attributes-clone-max"/><br> <nvpair name="clone-node-max" value="2" id="R1-clone-<br>meta_attributes-clone-node-max"/><br> <nvpair name="globally-unique" value="true" id="R1-clone-<br>meta_attributes-globally-unique"/><br> <nvpair name="failure-timeout" value="300" id="R1-clone-<br>meta_attributes-failure-timeout"/><br> <nvpair name="migration-threshold" value="0" id="R1-clone-<br>meta_attributes-migration-threshold"/><br> <nvpair id="R1-clone-meta_attributes-target-role"<br>name="target-<br>role" value="Stopped"/><br> </meta_attributes><br></clone><br><clone id="R2-clone"><br> <meta_attributes id="R2-clone-meta_attributes"><br> <nvpair name="interleave" value="true" id="R2-clone-<br>meta_attributes-interleave"/><br> <nvpair name="resource-stickiness" value="0" id="R2-clone-<br>meta_attributes-resource-stickiness"/><br> <nvpair name="failure-timeout" value="300" id="R2-clone-<br>meta_attributes-failure-timeout"/><br> <nvpair name="migration-threshold" value="0" id="R2-clone-<br>meta_attributes-migration-threshold"/><br> <nvpair id="R2-clone-meta_attributes-target-role"<br>name="target-<br>role" value="Stopped"/><br> </meta_attributes><br></clone><br></resources><br><br><constraints><br><rsc_order id="R1-order" kind="Mandatory" first="R1-clone"<br>then="R2-clone"/><br><rsc_colocation id="R2-clone-colocation" score="INFINITY"<br>rsc="R2-<br>clone" with-rsc="R1-clone"/><br></constraints><br><br><br></blockquote>--<span class="Apple-converted-space"> </span><br>Ken Gaillot <kgaillot@redhat.com><br><br>_______________________________________________<br>Manage your subscription:<br>https://lists.clusterlabs.org/mailman/listinfo/users<br><br>ClusterLabs home: https://www.clusterlabs.org/<br></blockquote><br>_______________________________________________<br>Manage your subscription:<br><a href="https://lists.clusterlabs.org/mailman/listinfo/users">https://lists.clusterlabs.org/mailman/listinfo/users</a><br><br>ClusterLabs home:<span class="Apple-converted-space"> </span><a href="https://www.clusterlabs.org/">https://www.clusterlabs.org/</a><br></blockquote><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">--<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Ken Gaillot <</span><a href="mailto:kgaillot@redhat.com" style="font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">kgaillot@redhat.com</a><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">></span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Manage your subscription:</span><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><a href="https://lists.clusterlabs.org/mailman/listinfo/users" style="font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">https://lists.clusterlabs.org/mailman/listinfo/users</a><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">ClusterLabs home:<span class="Apple-converted-space"> </span></span><a href="https://www.clusterlabs.org/" style="font-family: Verdana; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">https://www.clusterlabs.org/</a></div></blockquote></div><br></div></body></html>