create a volume from image Error

Bug #1240346 reported by Hyun Ha
This bug report is a duplicate of:  Bug #1252549: Havana cinder requires glance API V2. Edit Remove
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned

Bug Description

creating a volume from image Failed with Following trace:

2013-10-16 14:27:06.318 25540 DEBUG glanceclient.common.http [-] curl -i -X GET -H 'X-Auth-Token: 55243ec067634b43b738b7a3ad3e81a4' -H 'Content-Type: application/json' -H 'User-Agent: python-glanceclient' http://10.10.10.24:9292/v2/images/b10e9e92-128f-459a-95fe-054272da86fb log_curl_request /usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py:140

2013-10-16 14:27:06.413 25540 DEBUG cinder.volume.flows.create_volume [req-6c385d9e-eb57-411b-97f7-d65804187eb3 e68844e2afb14001a4e322e76c0ded99 469289b44db3489fb635083f2000cf4e] Volume 1df8b3f1-bc8f-479c-ae24-d3538a3ea344: re-scheduled _post_reschedule /opt/openstack/cinder/cinder/volume/flows/create_volume/__init__.py:933
2013-10-16 14:27:06.414 25540 ERROR cinder.volume.flows.create_volume [req-6c385d9e-eb57-411b-97f7-d65804187eb3 e68844e2afb14001a4e322e76c0ded99 469289b44db3489fb635083f2000cf4e] Unexpected build error:
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume Traceback (most recent call last):
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume File "/opt/openstack/cinder/cinder/taskflow/patterns/linear_flow.py", line 172, in run_it
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume result = runner(context, *args, **kwargs)
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume File "/opt/openstack/cinder/cinder/taskflow/utils.py", line 260, in __call__
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume self.result = self.task(*args, **kwargs)
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume File "/opt/openstack/cinder/cinder/volume/flows/create_volume/__init__.py", line 1162, in __call__
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume image_id),
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume File "/opt/openstack/cinder/cinder/image/glance.py", line 241, in get_location
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume _reraise_translated_image_exception(image_id)
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume File "/opt/openstack/cinder/cinder/image/glance.py", line 239, in get_location
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume image_meta = client.call(context, 'get', image_id)
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume File "/opt/openstack/cinder/cinder/image/glance.py", line 159, in call
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume return getattr(client.images, method)(*args, **kwargs)
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 69, in get
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume resp, body = self.http_client.json_request('GET', url)
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 249, in json_request
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume resp, body_iter = self._http_request(url, method, **kwargs)
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 233, in _http_request
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume raise exc.from_response(resp, body_str)
2013-10-16 14:27:06.414 25540 TRACE cinder.volume.flows.create_volume HTTPInternalServerError: HTTPInternalServerError (HTTP 500)

glanceclient always call 'v2' API because of this source code:

==> cinder/image/glance.py

    def get_location(self, context, image_id):
        """Returns the direct url representing the backend storage location,
        or None if this attribute is not shown by Glance.
        """
        try:
            # direct_url is returned by v2 api
            client = GlanceClientWrapper(version=2)
            image_meta = client.call(context, 'get', image_id)

I saw the bug report that glance api didn't implemented v2 yet. so I think "version=2" need to fix '2' to '1'. Is it correct?

please check this and answer to me . Thank you.

Tags: drivers nfs
Hyun Ha (raymon-ha)
summary: - create volume from image Error
+ create a volume from image Error
description: updated
Hyun Ha (raymon-ha)
description: updated
Hyun Ha (raymon-ha)
description: updated
Revision history for this message
Jordan Pittier (jordan-pittier) wrote :

Yes I can confirm this. The change was made here : https://github.com/openstack/cinder/commit/688c515b9d662486395d36c303ca599376a1dc0d

Though "create a volume from image" works on devstack.

We are using NFS here ? Do you use NFS too ?

Is your setup an upgrade from grizzly or you started from scratch ?

tags: added: drivers nfs
Revision history for this message
Hyun Ha (raymon-ha) wrote :

I installed havana source version with git clone command.

and I'm using loop device and lvm for test cinder volume.

actually I succeeded "create a volume from image" just modifying that code (version=2 to verson=1) in my test node.

it works. So, I can't understand this.

It doesn't working at 'version=2' but 'version=1' is ok.

Revision history for this message
Jordan Pittier (jordan-pittier) wrote :

 This has been fixed in : Bug #1252549 Havana cinder requires glance API V2

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.