<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 09/20/2017 10:40 AM, Tiemen Ruiten
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAAegNz3=Csy_1_jVBK6ETc9710na6QaAC7_D0YT_C8HV_4XyHA@mail.gmail.com">
      <div dir="ltr">Thank you very much for the detailed explanation.
        We will look for another way to determine master/slave status of
        this application then.</div>
    </blockquote>
    <br>
    What you still could try is to write kind of an ocf-wrapper for your
    systemd-service<br>
    so that you can leave starting/stopping to systemd (controlled via
    systemctl) and<br>
    do what is needed on top to control master/slave-state in the
    ocf-Resource-Agent.<br>
    iirc there have been threads about creating ocf-wrappers of
    systemd-services<br>
    on this mailing-list.<br>
    <br>
    Regards,<br>
    Klaus<br>
    <br>
    <blockquote type="cite"
cite="mid:CAAegNz3=Csy_1_jVBK6ETc9710na6QaAC7_D0YT_C8HV_4XyHA@mail.gmail.com">
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 20 September 2017 at 09:20, Tomas
          Jelinek <span dir="ltr"><<a
              href="mailto:tojeline@redhat.com" target="_blank"
              moz-do-not-send="true">tojeline@redhat.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
            <br>
            Dne 20.9.2017 v 09:03 Tomas Jelinek napsal(a):<span class=""><br>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">
                Hi,<br>
                <br>
                systemd resources cannot be used as master/slave
                resources. In order to use a resource as a master/slave,
                the resource must support promote and demote actions
                [1], which systemd resources don't.<br>
                <br>
                # pcs resource create test systemd:postfix<br>
                # pcs resource master test<br>
                # pcs cluster verify -V<br>
                    error: native_unpack:        Resource test:0 is of
                type systemd and therefore cannot be used as a
                master/slave resource<br>
                    error: create_child_clone:   Failed unpacking
                resource test<br>
                    error: unpack_resources:     Failed unpacking master
                test-master<br>
                Errors found during check: config not valid<br>
                <br>
                You need to use an ocf resource agent (with promote and
                demote actions implemented) for your resource for this
                to work.<br>
                <br>
                Because the resource cannot be unpacked by pacemaker, it
                is not shown in the "pcs status" output - pcs doesn't
                get any info about it from pacemaker. This issue has
                been already discussed. Pacemaker will provide info when
                such errors occur so pcs will be able to display it. [2]<br>
                <br>
                The resource may not be running but it is still defined
                in the configuration:<br>
                # pcs resource --full<br>
                  Master: test-master<br>
                   Resource: test (class=systemd type=postfix)<br>
                    Operations: monitor interval=60 timeout=100
                (test-monitor-interval-60)<br>
                                start interval=0s timeout=100
                (test-start-interval-0s)<br>
                                stop interval=0s timeout=100
                (test-stop-interval-0s)<br>
                <br>
                That's why you get an error that the id already exists.<br>
                <br>
                <br>
                I'm going to file a bug against pcs so it won't be
                possible to master/slave systemd resources as it is not
                supported anyway.<br>
              </blockquote>
              <br>
            </span><a
              href="https://bugzilla.redhat.com/show_bug.cgi?id=1493416"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://bugzilla.redhat.com/sh<wbr>ow_bug.cgi?id=1493416</a>
            <div class="HOEnZb">
              <div class="h5"><br>
                <br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <br>
                  Regards,<br>
                  Tomas<br>
                  <br>
                  [1]: <a
href="http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Pacemaker_Explained/index.html#_requirements_for_multi_state_resource_agents"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">http://clusterlabs.org/doc/en-<wbr>US/Pacemaker/1.1-pcs/html-sing<wbr>le/Pacemaker_Explained/index.<wbr>html#_requirements_for_multi_<wbr>state_resource_agents</a>
                  <br>
                  [2]: <a
                    href="https://bugzilla.redhat.com/show_bug.cgi?id=1447951"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">https://bugzilla.redhat.com/sh<wbr>ow_bug.cgi?id=1447951</a><br>
                  <br>
                  <br>
                  Dne 19.9.2017 v 17:13 Tiemen Ruiten napsal(a):<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    Hello,<br>
                    <br>
                    We have a 3-node cluster (CentOS 7.4) with several
                    systemd resources configured. One of them I would
                    like to create as a master/slave resource, so
                    following the RedHat documentation:<br>
                    <br>
                    pcs resource create ivr systemd:japp@ivr - works,
                    the service is started on one of the nodes.<br>
                    pcs resource master ivr-master ivr - doesn't work as
                    expected: the service is stopped and the output of
                    pcs resource show doesn't list it anymore. However,
                    if I try the command again, I get an error saying
                    the resource ivr already exists! I have to delete
                    the resource and recreate it to get the service to
                    run.<br>
                    <br>
                    pacemaker-libs-1.1.16-12.el7_4<wbr>.2.x86_64<br>
                    pacemaker-cluster-libs-1.1.16-<wbr>12.el7_4.2.x86_64<br>
                    pacemaker-1.1.16-12.el7_4.2.x8<wbr>6_64<br>
                    pacemaker-cli-1.1.16-12.el7_4.<wbr>2.x86_64<br>
                    corosynclib-2.4.0-9.el7_4.2.x8<wbr>6_64<br>
                    corosync-2.4.0-9.el7_4.2.x86_6<wbr>4<br>
                    <br>
                    Am I doing something wrong?<br>
                    <br>
                    -- <br>
                    Tiemen Ruiten<br>
                    Systems Engineer<br>
                    R&D Media<br>
                    <br>
                    <br>
                    ______________________________<wbr>_________________<br>
                    Users mailing list: <a
                      href="mailto:Users@clusterlabs.org"
                      target="_blank" moz-do-not-send="true">Users@clusterlabs.org</a><br>
                    <a
                      href="http://lists.clusterlabs.org/mailman/listinfo/users"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true">http://lists.clusterlabs.org/m<wbr>ailman/listinfo/users</a><br>
                    <br>
                    Project Home: <a href="http://www.clusterlabs.org"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true">http://www.clusterlabs.org</a><br>
                    Getting started: <a
                      href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true">http://www.clusterlabs.org/doc<wbr>/Cluster_from_Scratch.pdf</a><br>
                    Bugs: <a href="http://bugs.clusterlabs.org"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true">http://bugs.clusterlabs.org</a><br>
                    <br>
                  </blockquote>
                  <br>
                  ______________________________<wbr>_________________<br>
                  Users mailing list: <a
                    href="mailto:Users@clusterlabs.org" target="_blank"
                    moz-do-not-send="true">Users@clusterlabs.org</a><br>
                  <a
                    href="http://lists.clusterlabs.org/mailman/listinfo/users"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">http://lists.clusterlabs.org/m<wbr>ailman/listinfo/users</a><br>
                  <br>
                  Project Home: <a href="http://www.clusterlabs.org"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">http://www.clusterlabs.org</a><br>
                  Getting started: <a
                    href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">http://www.clusterlabs.org/doc<wbr>/Cluster_from_Scratch.pdf</a><br>
                  Bugs: <a href="http://bugs.clusterlabs.org"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">http://bugs.clusterlabs.org</a><br>
                </blockquote>
                <br>
                ______________________________<wbr>_________________<br>
                Users mailing list: <a
                  href="mailto:Users@clusterlabs.org" target="_blank"
                  moz-do-not-send="true">Users@clusterlabs.org</a><br>
                <a
                  href="http://lists.clusterlabs.org/mailman/listinfo/users"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true">http://lists.clusterlabs.org/m<wbr>ailman/listinfo/users</a><br>
                <br>
                Project Home: <a href="http://www.clusterlabs.org"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true">http://www.clusterlabs.org</a><br>
                Getting started: <a
                  href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true">http://www.clusterlabs.org/doc<wbr>/Cluster_from_Scratch.pdf</a><br>
                Bugs: <a href="http://bugs.clusterlabs.org"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true">http://bugs.clusterlabs.org</a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature" data-smartmail="gmail_signature">
          <div dir="ltr">Tiemen Ruiten<br>
            Systems Engineer<br>
            R&D Media<br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list: <a class="moz-txt-link-abbreviated" href="mailto:Users@clusterlabs.org">Users@clusterlabs.org</a>
<a class="moz-txt-link-freetext" href="http://lists.clusterlabs.org/mailman/listinfo/users">http://lists.clusterlabs.org/mailman/listinfo/users</a>

Project Home: <a class="moz-txt-link-freetext" href="http://www.clusterlabs.org">http://www.clusterlabs.org</a>
Getting started: <a class="moz-txt-link-freetext" href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a>
Bugs: <a class="moz-txt-link-freetext" href="http://bugs.clusterlabs.org">http://bugs.clusterlabs.org</a>
</pre>
    </blockquote>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Klaus Wenninger

Senior Software Engineer, EMEA ENG Openstack Infrastructure

Red Hat

<a class="moz-txt-link-abbreviated" href="mailto:kwenning@redhat.com">kwenning@redhat.com</a>   
</pre>
  </body>
</html>