This is a multi-part message in MIME format.
--------------89393413F57E7342FFE0026E
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi,
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.
connection =
sdk.Connection(url=conf["URL"],username=conf["UI_USERNAME"],password=conf["UI_PASSWORD"],
insecure=True,debug=True)
def create_external_providers():
openstack_services =
connection.system_service().openstack_image_providers_service()
openstack_s
=openstack_services.add(types.OpenStackImageProvider(name='my_glance_instance',description='new',url='http://glance.ovirt.org:9292/'))
openstack_service =openstack_services.openstack_service(openstack_s.id)
/usr/bin/python2.7
/home/ramakasturinarra/PycharmProjects/hosted_engine_deploy_hc/addresource.py
Traceback (most recent call last):
File
"/home/ramakasturinarra/PycharmProjects/hosted_engine_deploy_hc/addresource.py",
line 169, in <module>
create_external_providers()
File
"/home/ramakasturinarra/PycharmProjects/hosted_engine_deploy_hc/addresource.py",
line 162, in create_external_providers
openstack_s =
openstack_services.add(types.OpenStackImageProvider(name='my_glance_instance',
description='new', url='http://glance.ovirt.org:9292/'))
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py", line
10265, in add
self._check_fault(response)
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line
95, in _check_fault
Service._raise_error(response, fault)
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line
69, in _raise_error
raise Error(msg)
ovirtsdk4.Error: Fault reason is "Request syntactically incorrect.".
Fault detail is "For correct usage, see:
https://rhev-engine1.lab.eng.blr.redhat.com/ovirt-engine/api/v4/model#ser...;.
HTTP response code is 400.
Process finished with exit code 1
I see the following error in the engine.log:
=================================
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"
Caused by: javax.xml.bind.UnmarshalException: unexpected element
(uri:"", local:"open_stack_image_provider"). Expected elements are
<{}action>,<{}affinity_group>,<{}affinity
_groups>,<{}affinity_label>,<{}affinity_labels>,<{}agent>,<{}agent_configuration>,<{}agent_configurations>,<{}agents>,<{}api>,<{}api_summaries>,<{}api_summary>,<{}api_summar
y_item>,<{}api_summary_items>,<{}apis>,<{}application>,<{}applications>,<{}authorized_key>,<{}authorized_keys>,<{}balance>,<{}balances>,<{}bios>,<{}bioss>,<{}block_statistic
,<{}block_statistics>,<{}body>,<{}bonding>,<{}bondings>,<{}bookmark>,<{}bookmarks>,<{}boot>,<{}boot_menu>,<{}boot_menus>,<{}boots>,<{}brick>,<{}brick_memoryinfo>,<{}brick_p
rofile_detail>,<{}brick_profile_details>,<{}bricks>,<{}cdrom>,<{}cdroms>,<{}certificate>,<{}certificates>,<{}cloud_init>,<{}cloud_inits>,<{}cluster>,<{}cluster_level>,<{}clu
ster_levels>,<{}clusters>,<{}configuration>,<{}configurations>,<{}console>,<{}consoles>,<{}core>,<{}cores>,<{}cpu>,<{}cpu_profile>,<{}cpu_profiles>,<{}cpu_topologies>,<{}cpu
_topology>,<{}cpu_tune>,<{}cpu_tunes>,<{}cpu_type>,<{}cpu_types>,<{}cpus>,<{}creation>,<{}creation_states>,<{}custom_properties>,<{}custom_property>,<{}data_center>,<{}data_
centers>,<{}detailedLink>,<{}detailedLinks>,<{}device>,<{}devices>,<{}disk>,<{}disk_attachment>,<{}disk_attachments>,<{}disk_profile>,<{}disk_profiles>,<{}disk_snapshot>,<{}
disk_snapshots>,<{}disks>,<{}display>,<{}displays>,<{}dns>,<{}dnss>,<{}domain>,<{}domains>,<{}entity_profile_detail>,<{}entity_profile_details>,<{}error_handling>,<{}error_h
andlings>,<{}event>,<{}events>,<{}external_compute_resource>,<{}external_compute_resources>,<{}external_discovered_host>,<{}external_discovered_hosts>,<{}external_host>,<{}e
<kasturi>
xternal_host_group>,<{}external_host_groups>,<{}external_host_provider>,<{}external_host_providers>,<{}external_hosts>,<{}external_provider>,<{}external_providers>,<{}fault>
,<{}faults>,<{}fencing_policies>,<{}fencing_policy>,<{}file>,<{}files>,<{}filter>,<{}filters>,<{}floppies>,<{}floppy>,<{}fop_statistic
engine version : ovirt4.0.3
sdkversion : python-ovirt-engine-sdk4-4.0.0-0.6.a6.fc23.x86_64
Can some one please help me to resolve this issue?
Thanks
kasturi
--------------89393413F57E7342FFE0026E
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
<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 <module><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/v...;.
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
<{}action>,<{}affinity_group>,<{}affinity<br>
_groups>,<{}affinity_label>,<{}affinity_labels>,<{}agent>,<{}agent_configuration>,<{}agent_configurations>,<{}agents>,<{}api>,<{}api_summaries>,<{}api_summary>,<{}api_summar<br>
y_item>,<{}api_summary_items>,<{}apis>,<{}application>,<{}applications>,<{}authorized_key>,<{}authorized_keys>,<{}balance>,<{}balances>,<{}bios>,<{}bioss>,<{}block_statistic<br>
>,<{}block_statistics>,<{}body>,<{}bonding>,<{}bondings>,<{}bookmark>,<{}bookmarks>,<{}boot>,<{}boot_menu>,<{}boot_menus>,<{}boots>,<{}brick>,<{}brick_memoryinfo>,<{}brick_p<br>
rofile_detail>,<{}brick_profile_details>,<{}bricks>,<{}cdrom>,<{}cdroms>,<{}certificate>,<{}certificates>,<{}cloud_init>,<{}cloud_inits>,<{}cluster>,<{}cluster_level>,<{}clu<br>
ster_levels>,<{}clusters>,<{}configuration>,<{}configurations>,<{}console>,<{}consoles>,<{}core>,<{}cores>,<{}cpu>,<{}cpu_profile>,<{}cpu_profiles>,<{}cpu_topologies>,<{}cpu<br>
_topology>,<{}cpu_tune>,<{}cpu_tunes>,<{}cpu_type>,<{}cpu_types>,<{}cpus>,<{}creation>,<{}creation_states>,<{}custom_properties>,<{}custom_property>,<{}data_center>,<{}data_<br>
centers>,<{}detailedLink>,<{}detailedLinks>,<{}device>,<{}devices>,<{}disk>,<{}disk_attachment>,<{}disk_attachments>,<{}disk_profile>,<{}disk_profiles>,<{}disk_snapshot>,<{}<br>
disk_snapshots>,<{}disks>,<{}display>,<{}displays>,<{}dns>,<{}dnss>,<{}domain>,<{}domains>,<{}entity_profile_detail>,<{}entity_profile_details>,<{}error_handling>,<{}error_h<br>
andlings>,<{}event>,<{}events>,<{}external_compute_resource>,<{}external_compute_resources>,<{}external_discovered_host>,<{}external_discovered_hosts>,<{}external_host>,<{}e<br>
<kasturi>
xternal_host_group>,<{}external_host_groups>,<{}external_host_provider>,<{}external_host_providers>,<{}external_hosts>,<{}external_provider>,<{}external_providers>,<{}fault><br>
,<{}faults>,<{}fencing_policies>,<{}fencing_policy>,<{}file>,<{}files>,<{}filter>,<{}filters>,<{}floppies>,<{}floppy>,<{}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>
--------------89393413F57E7342FFE0026E--