VMware:Copy volume to image by non-admin user fails with error "ImageNotAuthorized"

Bug #1437319 reported by Vipin Balachandran
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Vipin Balachandran

Bug Description

Cinder command "cinder upload-to-image " by non-admin user always fails with:

2015-03-27 05:41:38.134 ERROR oslo_vmware.image_transfer [-] Error occurred while writing image: 30e80ace-1048-4198-b4e6-134fa797e21e
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer Traceback (most recent call last):
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer File "/opt/stack/oslo.vmware/oslo_vmware/image_transfer.py", line 152, in _inner
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer data=self._input_file)
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer File "/opt/stack/cinder/cinder/image/glance.py", line 325, in update
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer _reraise_translated_image_exception(image_id)
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer File "/opt/stack/cinder/cinder/image/glance.py", line 323, in update
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer **image_meta)
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer File "/opt/stack/cinder/cinder/image/glance.py", line 176, in call
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer return getattr(client.images, method)(*args, **kwargs)
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer File "/opt/stack/python-glanceclient/glanceclient/v1/images.py", line 360, in update
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer resp, body = self.client.put(url, headers=hdrs, data=image_data)
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer File "/opt/stack/python-glanceclient/glanceclient/common/http.py", line 268, in put
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer return self._request('PUT', url, **kwargs)
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer File "/opt/stack/python-glanceclient/glanceclient/common/http.py", line 230, in _request
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer raise exc.from_response(resp, resp.text)
2015-03-27 05:41:38.134 TRACE oslo_vmware.image_transfer ImageNotAuthorized: Not authorized for image 30e80ace-1048-4198-b4e6-134fa797e21e.

Tags: drivers vmware
Changed in cinder:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/168333

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/168333
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=f73c9e527810bfd2c5e9c95af02bad5fb9cd0891
Submitter: Jenkins
Branch: master

commit f73c9e527810bfd2c5e9c95af02bad5fb9cd0891
Author: Vipin Balachandran <email address hidden>
Date: Fri Mar 27 06:09:04 2015 -0700

    VMware: Fix ImageNotAuthorized during copy volume

    Copy volume to image by non-admin user fails with ImageNotAuthorized.
    This is because we are setting image's is_public meta-data to True
    while calling image update (for writing to image). This patch fixes
    this by setting is_public using the image-meta passed in by Cinder.

    This bug was introduced by commit 960cbb21e359a3526e9ff9bf4ca78db1eca3a743.

    Note: The oslo.vmware API which we use for upload requires is_public
    meta-data which may not be needed at all for writing to image.
    Till we update oslo.vmware API, we have to pass a value for is_public.

    Change-Id: Ib7778b6c7a3e8dd501216173a26d7ba246aa85e4
    Closes-Bug: #1437319

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → kilo-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-rc1 → 2015.1.0
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.