Failed to upload image to Vmware vcenter backend

Bug #1657095 reported by Tzach Shefi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
New
Undecided
Unassigned

Bug Description

Failing to upload images to vmware vcenter backend on Glance Liberty.

Glance Liberty
python-glance-11.0.1-6.el7ost.noarch
python-glance-store-0.9.1-3.el7ost.noarch
python-glanceclient-1.1.1-2.el7ost.noarch
openstack-glance-11.0.1-6.el7ost.noarch
Vmware vcenter 5.5u3 (VCSA)

Glance config
stores=file,http,vmware (unsure if need to add vmware yes/no?)
default_store = vsphere

vmware_server_host=x.y.z.w
vmware_server_username=root
vmware_server_password=xxxxxxxxx
vmware_datastores=dc1:datastore1
vmware_api_insecure=true
vmware_task_poll_interval=5
vmware_store_image_dir=/openstack_glance

Error I get:
# glance --debug image-create --name test.vmdk --container-format bare --disk-format vmdk --file /root/cirros-0.3.4-x86_64-disk.vmdk
Request returned failure status 500.
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container_format | bare |
| created_at | 2017-01-17T10:50:40Z |
| disk_format | vmdk |
| id | 169ae026-3222-4956-8a14-69309cfa3988 |
| min_disk | 0 |
| min_ram | 0 |
| name | test.vmdk |
| owner | f0f5b951090d497daa62c7bf0cc28dd2 |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updated_at | 2017-01-17T10:50:40Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 688, in main
    args.func(client, args)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/utils.py", line 98, in func_wrapper
    return func(gc, args)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/shell.py", line 85, in do_image_create
    do_image_upload(gc, args)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/shell.py", line 318, in do_image_upload
    gc.images.upload(args.id, image_data, args.size)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 221, in upload
    self.http_client.put(url, headers=hdrs, data=body)
  File "/usr/lib/python2.7/site-packages/keystoneclient/adapter.py", line 179, in put
    return self.request(url, 'PUT', **kwargs)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 333, in request
    return self._handle_response(resp)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 89, in _handle_response
    raise exc.from_response(resp, resp.content)
HTTPInternalServerError: 500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)
500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)

Api.log

2017-01-17 12:50:40.754 12199 ERROR glance.common.wsgi File "/usr/lib/python2.7/site-packages/glance_store/backend.py", line 340, in store_add_to_backend
2017-01-17 12:50:40.754 12199 ERROR glance.common.wsgi context=context)
2017-01-17 12:50:40.754 12199 ERROR glance.common.wsgi File "/usr/lib/python2.7/site-packages/glance_store/capabilities.py", line 226, in op_checker
2017-01-17 12:50:40.754 12199 ERROR glance.common.wsgi return store_op_fun(store, *args, **kwargs)
2017-01-17 12:50:40.754 12199 ERROR glance.common.wsgi File "/usr/lib/python2.7/site-packages/glance_store/_drivers/vmware_datastore.py", line 536, in add
2017-01-17 12:50:40.754 12199 ERROR glance.common.wsgi raise exceptions.BackendException(msg)
2017-01-17 12:50:40.754 12199 ERROR glance.common.wsgi BackendException: Failed to upload content of image 169ae026-3222-4956-8a14-69309cfa3988. The request returned an unexpected status: 3
01.
2017-01-17 12:50:40.754 12199 ERROR glance.common.wsgi The response body:
2017-01-17 12:50:40.754 12199 ERROR glance.common.wsgi None
2017-01-17 12:50:40.754 12199 ERROR glance.common.wsgi

Under vcenter I have a folder called "openstack_glance".

In the recent releases I noticed when I configure Nova/Cinder with vcenter they create a folder under vcenter root called Openstack under which a sub folder called: Project (f0f5b951090d497daa62c7bf0cc28dd2) -> Admin tenant's ID.
Having nothing to lose I also created a sub folder here called openstack_glance.
Tested below two versions as well, same error on image upload.

vmware_store_image_dir='/openstack/Project (f0f5b951090d497daa62c7bf0cc28dd2)/openstack_glance'
vmware_store_image_dir="/openstack/Project (f0f5b951090d497daa62c7bf0cc28dd2)/openstack_glance"

Not ruling out possible config errors on my part either on Openstack or VMware.
I was able to upload images boot instance and created volumes with Glance (kilo) release on this same vmware backend.

Revision history for this message
Tzach Shefi (tshefi) wrote :
Revision history for this message
Tzach Shefi (tshefi) wrote :

While trying to figure this out.
I managed to install a Newton build with VMware vc6.
Image upload works.

These are config options for Newton
stores = file,http,swift,vmware
default_store = vsphere

vmware_server_host = x.y.z.w
vmware_server_username = xxxxxxxxxxxxxxxxxxxxx
vmware_server_password = xxxxxxxxxx
vmware_datastores = DC1:Tigris01_ds1
vmware_insecure = True
vmware_api_retry_count = 10
vmware_store_image_dir = /openstack_glance
vmware_task_poll_interval = 5

Versions:
puppet-glance-9.4.0-2.el7ost.noarch
openstack-glance-13.0.0-1.el7ost.noarch
python-glance-13.0.0-1.el7ost.noarch
python-glance-store-0.18.0-2.el7ost.noarch
python-glanceclient-2.5.0-1.el7ost.noarch

Revision history for this message
Tzach Shefi (tshefi) wrote :

Figured it out, my VMware calls for insecure connection.

I had used on Kilo Liberty and Mitaka:
vmware_api_insecure=true

While I should have used below format, which works in Newton (apparently since Liberty).
vmware_insecure = True

I can now upload images to VMware on both Liberty and Mitaka.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.