Hi Max, hi all,

for all who want to follow up, attached the needed files:
* cluster-options.xml : all options explicit
* r-A.xml (resource definition and constraints for resource A)
* r-B.xml (resource definition and constraints for resource B)

* WARNING: My nodes are called db01 and db02. You have to grep
for that in the files an replace it accordingly.

* load the files
* all resources do have target_role=stopped
* try to start r_B (target_role=started)
* it doesn't start here.


Have fun
Andreas Mock


<cib>
  <configuration>
    <crm_config>
      <cluster_property_set id="cib-bootstrap-options">
        <attributes>
          <!-- What to do when the cluster does not have quorum  Allowed values: stop, freeze, ignore -->
          <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="stop" />
          <!-- All resources can run anywhere by default -->
          <nvpair id="cib-bootstrap-options-symmetric-cluster" name="symmetric-cluster" value="true" />
          <!-- Failed nodes are STONITH'd -->
          <nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false" />
          <!-- Action to send to STONITH device  Allowed values: reboot, poweroff -->
          <nvpair id="cib-bootstrap-options-stonith-action" name="stonith-action" value="reboot" />
          <!-- no comment available -->
          <nvpair id="cib-bootstrap-options-default-resource-stickiness" name="default-resource-stickiness" value="50" />
          <!-- no comment available -->
          <nvpair id="cib-bootstrap-options-default-resource-failure-stickiness" name="default-resource-failure-stickiness" value="-201" />
          <!-- Should the cluster start/stop resources as required -->
          <nvpair id="cib-bootstrap-options-is-managed-default" name="is-managed-default" value="true" />
          <!-- The "correct" value will depend on the speed and load of your network and cluster nodes. -->
          <nvpair id="cib-bootstrap-options-cluster-delay" name="cluster-delay" value="60s" />
          <!-- How long to wait for actions to complete -->
          <nvpair id="cib-bootstrap-options-default-action-timeout" name="default-action-timeout" value="20s" />
          <!-- Should deleted resources be stopped -->
          <nvpair id="cib-bootstrap-options-stop-orphan-resources" name="stop-orphan-resources" value="true" />
          <!-- Should deleted actions be cancelled -->
          <nvpair id="cib-bootstrap-options-stop-orphan-actions" name="stop-orphan-actions" value="true" />
          <!-- Zero to disable, -1 to store unlimited. -->
          <nvpair id="cib-bootstrap-options-pe-error-series-max" name="pe-error-series-max" value="-1" />
          <!-- Zero to disable, -1 to store unlimited. -->
          <nvpair id="cib-bootstrap-options-pe-warn-series-max" name="pe-warn-series-max" value="-1" />
          <!-- Zero to disable, -1 to store unlimited. -->
          <nvpair id="cib-bootstrap-options-pe-input-series-max" name="pe-input-series-max" value="-1" />
          <!-- Advanced Use Only!  Not using the default is very unsafe! -->
          <nvpair id="cib-bootstrap-options-startup-fencing" name="startup-fencing" value="true" />
          <!-- The "correct" value will depend on the speed and load of your network. -->
          <nvpair id="cib-bootstrap-options-dc_deadtime" name="dc_deadtime" value="10s" />
          <!-- The Cluster is primarily event driven, however the configuration can have elements that change based on time.  To ensure these changes take effect, we can optionally poll the cluster's status for changes.  Allowed values: Zero disables polling.  Positive values are an interval in seconds (unless other SI units are specified. eg. 5min) -->
          <nvpair id="cib-bootstrap-options-cluster_recheck_interval" name="cluster_recheck_interval" value="0" />
          <!-- If need to adjust this value, it probably indicates the presence of a bug. -->
          <nvpair id="cib-bootstrap-options-election_timeout" name="election_timeout" value="2min" />
          <!-- If need to adjust this value, it probably indicates the presence of a bug. -->
          <nvpair id="cib-bootstrap-options-shutdown_escalation" name="shutdown_escalation" value="20min" />
          <!-- If need to adjust this value, it probably indicates the presence of a bug. -->
          <nvpair id="cib-bootstrap-options-crmd-integration-timeout" name="crmd-integration-timeout" value="3min" />
          <!-- If need to adjust this value, it probably indicates the presence of a bug. -->
          <nvpair id="cib-bootstrap-options-crmd-finalization-timeout" name="crmd-finalization-timeout" value="10min" />
        </attributes>
      </cluster_property_set>
    </crm_config>
  </configuration><!-- CAUTION CAUTION CAUTION:
        1) Put this output to a file.
        2) Change the values you need to change.
        3) Load this content to the cib with 'cibadmin -C -o crm_config -x thisfile.xml'
         -->
</cib>
<?xml version="1.0" ?>
<cib>
    <configuration>
        <resources>
            <primitive class="ocf" id="r_A" provider="heartbeat" type="Dummy">
                <operations>
                    <op id="r_A_mon" interval="20" name="monitor" timeout="30"/>
                    <op id="r_A_start" name="start" timeout="30"/>
                    <op id="r_A_stop" name="stop" timeout="30"/>
                </operations>
                <instance_attributes id="r_A">
                    <attributes>
                        <nvpair id="r_A_target_role" name="target_role" value="stopped"/>
                    </attributes>
                </instance_attributes>
            </primitive>
        </resources>
        <constraints>
            <rsc_location id="r_A_prefer_db01" rsc="r_A">
                <rule id="r_A_prefer_db01_rule" score="100">
                    <expression attribute="#uname" id="r_A_prefer_db01_expr" operation="eq" value="db01"/>
                </rule>
            </rsc_location>
        </constraints>
    </configuration>
</cib>
<?xml version="1.0" ?>
<cib>
    <configuration>
        <resources>
            <primitive class="ocf" id="r_B" provider="heartbeat" type="Dummy">
                <operations>
                    <op id="r_B_mon" interval="20" name="monitor" timeout="30"/>
                    <op id="r_B_start" name="start" timeout="30"/>
                    <op id="r_B_stop" name="stop" timeout="30"/>
                </operations>
                <instance_attributes id="r_B">
                    <attributes>
                        <nvpair id="r_B_target_role" name="target_role" value="stopped"/>
                    </attributes>
                </instance_attributes>
            </primitive>
        </resources>
        <constraints>
             <rsc_colocation id="cl_r_B_on_r_A" from="r_B" to="r_A" score="INFINITY" />
        </constraints>
    </configuration>
</cib>
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to