[ovirt-users] problem adding OpenStackImage Provider with python-ovirt-engine-sdk4
knarra
knarra at redhat.com
Tue Sep 13 11:34:49 UTC 2016
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#services/openstack-image-providers/methods/add".
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20160913/4de306c0/attachment-0001.html>
More information about the Users
mailing list