<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi,</p>
    <p>    I am trying to add glance repository to Ovirt using ovirtsdk4
      and i am facing the error below. Below is my code snippet which i
      am running.</p>
    <p>
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
    </p>
    <pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:13.5pt;">connection = sdk.Connection(<span style="color:#660099;">url</span>=conf[<span style="color:#008000;font-weight:bold;">"URL"</span>],<span style="color:#660099;">username</span>=conf[<span style="color:#008000;font-weight:bold;">"UI_USERNAME"</span>], <span style="color:#660099;">password</span>=conf[<span style="color:#008000;font-weight:bold;">"UI_PASSWORD"</span>],
                            <span style="color:#660099;">insecure</span>=<span style="background-color:#e4e4ff;">True</span>, <span style="color:#660099;">debug</span>=<span style="background-color:#e4e4ff;">True</span>)</pre>
    <p>
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
    </p>
    <pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:13.5pt;"><span style="color:#000080;font-weight:bold;">def </span>create_external_providers():
    <span style="background-color:#ffe4ff;">openstack_services</span> = connection.system_service().openstack_image_providers_service()
    openstack_s = <span style="background-color:#e4e4ff;">openstack_services</span>.add(types.OpenStackImageProvider(<span style="color:#660099;">name</span>=<span style="color:#008000;font-weight:bold;">'my_glance_instance'</span>, <span style="color:#660099;">description</span>=<span style="color:#008000;font-weight:bold;">'new'</span>, <span style="color:#660099;">url</span>=<span style="color:#008000;font-weight:bold;">'<a class="moz-txt-link-freetext" href="http://glance.ovirt.org:9292/">http://glance.ovirt.org:9292/</a>'</span>))
    <span style="color:#808080;">openstack_service </span>= <span style="background-color:#e4e4ff;">openstack_services</span>.openstack_service(openstack_s.id)</pre>
    <p><br>
    </p>
    <p>/usr/bin/python2.7
/home/ramakasturinarra/PycharmProjects/hosted_engine_deploy_hc/addresource.py<br>
      Traceback (most recent call last):<br>
        File
"/home/ramakasturinarra/PycharmProjects/hosted_engine_deploy_hc/addresource.py",
      line 169, in &lt;module&gt;<br>
          create_external_providers()<br>
        File
"/home/ramakasturinarra/PycharmProjects/hosted_engine_deploy_hc/addresource.py",
      line 162, in create_external_providers<br>
          openstack_s =
openstack_services.add(types.OpenStackImageProvider(name='my_glance_instance',
      description='new', url='<a class="moz-txt-link-freetext" href="http://glance.ovirt.org:9292/">http://glance.ovirt.org:9292/</a>'))<br>
        File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py",
      line 10265, in add<br>
          self._check_fault(response)<br>
        File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py",
      line 95, in _check_fault<br>
          Service._raise_error(response, fault)<br>
        File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py",
      line 69, in _raise_error<br>
          raise Error(msg)<br>
      ovirtsdk4.Error: Fault reason is "Request syntactically
      incorrect.". Fault detail is "For correct usage, see:
<a class="moz-txt-link-freetext" href="https://rhev-engine1.lab.eng.blr.redhat.com/ovirt-engine/api/v4/model#services/openstack-image-providers/methods/add">https://rhev-engine1.lab.eng.blr.redhat.com/ovirt-engine/api/v4/model#services/openstack-image-providers/methods/add</a>".
      HTTP response code is 400.<br>
      <br>
      Process finished with exit code 1</p>
    <p><br>
    </p>
    <p>I see the following error in the engine.log:</p>
    <p>=================================</p>
    <p>2016-09-13 07:11:09,882 ERROR
      [org.ovirt.engine.api.restapi.resource.validation.IOExceptionMapper]
      (default task-11) [] IO exception while processing "POST" request
      for path "/openstackimageproviders"</p>
    <p>Caused by: javax.xml.bind.UnmarshalException: unexpected element
      (uri:"", local:"open_stack_image_provider"). Expected elements are
      &lt;{}action&gt;,&lt;{}affinity_group&gt;,&lt;{}affinity<br>
 _groups&gt;,&lt;{}affinity_label&gt;,&lt;{}affinity_labels&gt;,&lt;{}agent&gt;,&lt;{}agent_configuration&gt;,&lt;{}agent_configurations&gt;,&lt;{}agents&gt;,&lt;{}api&gt;,&lt;{}api_summaries&gt;,&lt;{}api_summary&gt;,&lt;{}api_summar<br>
 y_item&gt;,&lt;{}api_summary_items&gt;,&lt;{}apis&gt;,&lt;{}application&gt;,&lt;{}applications&gt;,&lt;{}authorized_key&gt;,&lt;{}authorized_keys&gt;,&lt;{}balance&gt;,&lt;{}balances&gt;,&lt;{}bios&gt;,&lt;{}bioss&gt;,&lt;{}block_statistic<br>
 &gt;,&lt;{}block_statistics&gt;,&lt;{}body&gt;,&lt;{}bonding&gt;,&lt;{}bondings&gt;,&lt;{}bookmark&gt;,&lt;{}bookmarks&gt;,&lt;{}boot&gt;,&lt;{}boot_menu&gt;,&lt;{}boot_menus&gt;,&lt;{}boots&gt;,&lt;{}brick&gt;,&lt;{}brick_memoryinfo&gt;,&lt;{}brick_p<br>
 rofile_detail&gt;,&lt;{}brick_profile_details&gt;,&lt;{}bricks&gt;,&lt;{}cdrom&gt;,&lt;{}cdroms&gt;,&lt;{}certificate&gt;,&lt;{}certificates&gt;,&lt;{}cloud_init&gt;,&lt;{}cloud_inits&gt;,&lt;{}cluster&gt;,&lt;{}cluster_level&gt;,&lt;{}clu<br>
 ster_levels&gt;,&lt;{}clusters&gt;,&lt;{}configuration&gt;,&lt;{}configurations&gt;,&lt;{}console&gt;,&lt;{}consoles&gt;,&lt;{}core&gt;,&lt;{}cores&gt;,&lt;{}cpu&gt;,&lt;{}cpu_profile&gt;,&lt;{}cpu_profiles&gt;,&lt;{}cpu_topologies&gt;,&lt;{}cpu<br>
 _topology&gt;,&lt;{}cpu_tune&gt;,&lt;{}cpu_tunes&gt;,&lt;{}cpu_type&gt;,&lt;{}cpu_types&gt;,&lt;{}cpus&gt;,&lt;{}creation&gt;,&lt;{}creation_states&gt;,&lt;{}custom_properties&gt;,&lt;{}custom_property&gt;,&lt;{}data_center&gt;,&lt;{}data_<br>
 centers&gt;,&lt;{}detailedLink&gt;,&lt;{}detailedLinks&gt;,&lt;{}device&gt;,&lt;{}devices&gt;,&lt;{}disk&gt;,&lt;{}disk_attachment&gt;,&lt;{}disk_attachments&gt;,&lt;{}disk_profile&gt;,&lt;{}disk_profiles&gt;,&lt;{}disk_snapshot&gt;,&lt;{}<br>
 disk_snapshots&gt;,&lt;{}disks&gt;,&lt;{}display&gt;,&lt;{}displays&gt;,&lt;{}dns&gt;,&lt;{}dnss&gt;,&lt;{}domain&gt;,&lt;{}domains&gt;,&lt;{}entity_profile_detail&gt;,&lt;{}entity_profile_details&gt;,&lt;{}error_handling&gt;,&lt;{}error_h<br>
 andlings&gt;,&lt;{}event&gt;,&lt;{}events&gt;,&lt;{}external_compute_resource&gt;,&lt;{}external_compute_resources&gt;,&lt;{}external_discovered_host&gt;,&lt;{}external_discovered_hosts&gt;,&lt;{}external_host&gt;,&lt;{}e<br>
      &lt;kasturi&gt;
xternal_host_group&gt;,&lt;{}external_host_groups&gt;,&lt;{}external_host_provider&gt;,&lt;{}external_host_providers&gt;,&lt;{}external_hosts&gt;,&lt;{}external_provider&gt;,&lt;{}external_providers&gt;,&lt;{}fault&gt;<br>
 ,&lt;{}faults&gt;,&lt;{}fencing_policies&gt;,&lt;{}fencing_policy&gt;,&lt;{}file&gt;,&lt;{}files&gt;,&lt;{}filter&gt;,&lt;{}filters&gt;,&lt;{}floppies&gt;,&lt;{}floppy&gt;,&lt;{}fop_statistic</p>
    <p>engine version : ovirt4.0.3</p>
    <p>sdkversion : python-ovirt-engine-sdk4-4.0.0-0.6.a6.fc23.x86_64</p>
    <p><br>
    </p>
    <p>Can some one please help me to resolve this issue?</p>
    <p>Thanks</p>
    <p>kasturi<br>
    </p>
  </body>
</html>