<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi,</p>
    <p>Sorry for this late reply, i've been busy with some other
      projects in the last weeks.</p>
    <p>I did some log analysing and could find the following in the
      foreman log when trying to add foreman as an external provider for
      oVirt:<br>
    </p>
    <pre>2016-09-08 15:20:03 [app] [I] Started GET "/api/v2" for 10.0.10.10 at 2016-09-08 15:20:03 +0200
2016-09-08 15:20:03 [app] [I] Processing by Api::V2::HomeController#index as JSON
2016-09-08 15:20:03 [app] [I]   Parameters: {"apiv"=&gt;"v2", "home"=&gt;{}}
2016-09-08 15:20:03 [app] [I] Authorized user ovirt(oVirt org)
2016-09-08 15:20:03 [app] [I]   Rendered api/v2/home/index.json.rabl (81.8ms)
2016-09-08 15:20:03 [app] [I] Completed 200 OK in 104ms (Views: 82.3ms | ActiveRecord: 4.6ms)
2016-09-08 15:20:03 [app] [I] Started GET "/api/v2/discovered_hosts" for 10.0.10.10 at 2016-09-08 15:20:03 +0200
2016-09-08 15:20:03 [app] [F] 
 | ActionController::RoutingError (No route matches [GET] "/api/v2/discovered_hosts"):
 |   actionpack (4.2.5.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
 |   actionpack (4.2.5.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
 |   railties (4.2.5.1) lib/rails/rack/logger.rb:38:in `call_app'
</pre>
    <p>It looks like ovirt is calling an api method which doesn't exist
      : /api/v2/discovered_hosts</p>
    <p>an extract from ovirt-engine.log</p>
    <pre>2016-09-08 15:20:00,862 INFO  [org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListVDSCommand] (DefaultQuartzScheduler3) [] FINISH, GlusterVolumesListVDSCommand, return: {d6f938d1-8886-40f3-8210-e5be397f951c=org.ovirt.engine.core.c</pre>
    <pre>ommon.businessentities.gluster.GlusterVolumeEntity@a32edae4, 7ef3b155-47d7-4405-aa70-82a9b8be4033=org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity@d94d8f95, af169181-d72e-4325-9947-d7dd09e512f0=org.ovirt.engine.c</pre>
    <pre>ore.common.businessentities.gluster.GlusterVolumeEntity@2a649db3, 6d3c8561-4e52-4221-9473-88fd48ef4909=org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity@a35e1b82}, log id: 5ffa2bf1</pre>
    <pre>2016-09-08 15:20:03,173 INFO  [org.ovirt.engine.core.bll.provider.ImportProviderCertificateCommand] (default task-24) [146f761a] Running command: ImportProviderCertificateCommand internal: false. Entities affected :  ID: aaa00000-0000-00</pre>
    <pre>00-0000-123456789aaa Type: SystemAction group CREATE_STORAGE_POOL with role type ADMIN</pre>
    <pre>2016-09-08 15:20:03,178 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-24) [146f761a] Correlation ID: 146f761a, Call Stack: null, Custom Event ID: -1, Message: Certificate for provider spfy-dep was imported. (User: admin@internal-authz)</pre>
    <pre>2016-09-08 15:20:03,295 INFO  [org.ovirt.engine.core.bll.provider.TestProviderConnectivityCommand] (default task-23) [6f5d9746] Running command: TestProviderConnectivityCommand internal: false. Entities affected :  ID: aaa00000-0000-0000-0000-123456789aaa Type: SystemAction group CREATE_STORAGE_POOL with role type ADMIN</pre>
    <pre>2016-09-08 15:20:03,955 ERROR [org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy] (default task-23) [6f5d9746] Exception is <a class="moz-txt-link-freetext" href="https://spfy-dep.host.sapify.ch:443/api/v2/discovered_hosts">https://spfy-dep.host.sapify.ch:443/api/v2/discovered_hosts</a> </pre>
    <pre>2016-09-08 15:20:03,955 ERROR [org.ovirt.engine.core.bll.provider.TestProviderConnectivityCommand] (default task-23) [6f5d9746] Command 'org.ovirt.engine.core.bll.provider.TestProviderConnectivityCommand' failed: EngineException: <a class="moz-txt-link-freetext" href="https://spfy-dep.host.sapify.ch:443/api/v2/discovered_hosts">https://spfy-dep.host.sapify.ch:443/api/v2/discovered_hosts</a> (Failed with error PROVIDER_FAILURE and code 5050)</pre>
    <pre>2016-09-08 15:20:04,279 INFO  [org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher] (DefaultQuartzScheduler4) [] Fetched 3 VMs from VDS 'd36d9aff-a953-466b-bdf7-70ba4f63e180'</pre>
    <p><br>
    </p>
    <p>Thanks for any hint/help.</p>
    <p>rgds,<br>
      Arsène<br>
    </p>
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 08/22/2016 08:22 AM, Oved Ourfali
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAJ_kCt5f59kJLTzqUZD-20+cqmWZ7f5XYPyLaiXB=qLwLkGiwg@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">Can you please attach the complete logs of ovirt
        and foreman?
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Aug 17, 2016 at 10:25 AM,
          Martin Perina <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:mperina@redhat.com" target="_blank">mperina@redhat.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div class="gmail_default"
                style="font-family:arial,helvetica,sans-serif">Adding
                Yaniv ...<br>
              </div>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On Wed, Aug 17, 2016 at 9:16
                    AM, Arsène Gschwind <span dir="ltr">&lt;<a
                        moz-do-not-send="true"
                        href="mailto:arsene.gschwind@unibas.ch"
                        target="_blank">arsene.gschwind@unibas.ch</a>&gt;</span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
                      <br>
                      Thanks a lot this did work on the Foreman side
                      using <a class="moz-txt-link-freetext" href="https://">https://</a>&lt;server&gt;/ovirt-engine/<wbr>api/v3
                      .<br>
                      <br>
                      But on the oVirt Side, to define Foreman as an
                      external provider, it still doesn't work, is there
                      also a special URL to enter? I didn't find
                      anything in the docs.<br>
                      <br>
                      Thanks for any hint.<br>
                      <br>
                      Regards,<br>
                      Arsène<br>
                      <br>
                      <br>
                      On 08/16/2016 05:01 PM, Juan Hernández wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        On 08/16/2016 11:58 AM, Arsène Gschwind wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          Hi,<br>
                          <br>
                          has anybody been able to configure Foreman
                          with oVirt 4 ? When trying to<br>
                          add Foreman as an external provider and test
                          the login it always return<br>
                          : Failed to communicate with the external
                          provider, see log for<br>
                          additional details.<br>
                          <br>
                          On the Foreman side i get an SSO failed in the
                          log, the user and<br>
                          password entered are correct.<br>
                          <br>
                          Running version:<br>
                          <br>
                          oVirt Engine Version: 4.0.2.6-1.el7.centos<br>
                          Foreman Version 1.12.1<br>
                          <br>
                          Please find the log extract attached.<br>
                          Thanks for any help/hint.<br>
                          <br>
                          Regards,<br>
                          Arsène<br>
                          <br>
                        </blockquote>
                        There are two important differences in version 4
                        of oVirt<br>
                        <br>
                        1. The URL is now only /ovirt-engine/api (it
                        used to accept /api and<br>
                        /ovirt-engine/api).<br>
                        <br>
                        2. There are two versions of the API now, v3,
                        compatible with oVirt 3,<br>
                        and v4, new and incompatible. Foreman only
                        supports v3.<br>
                        <br>
                        So, I'd suggest you try to use
                        "<a class="moz-txt-link-freetext" href="https://.../ovirt-engine/api/">https://.../ovirt-engine/api/</a><wbr>v3" in the<br>
                        URL. Does that work? If it doesn't, can you
                        provide more details? Log files?<br>
                        <br>
                      </blockquote>
                      <br>
                      ______________________________<wbr>_________________<br>
                      Users mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
                      <a moz-do-not-send="true"
                        href="http://lists.ovirt.org/mailman/listinfo/users"
                        rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman<wbr>/listinfo/users</a><br>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
            <br>
            ______________________________<wbr>_________________<br>
            Users mailing list<br>
            <a moz-do-not-send="true" href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.ovirt.org/mailman/listinfo/users"
              rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>