yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #17536
[Bug 1347376] [NEW] create a volume from a image raise AttributeError
Public bug reported:
I'm working under RHEL7 + ICEHOUSE 2014.1
For glance, image is stored in local file system.
I want to create a volume from an image.
So I run command "cinder create --image-id ${image_id} --display-name ${name} ${size}"
But then, I get error "glanceclient AttributeError: container_format" in ciner api debug info.
log_http_response /usr/lib/python2.7/site-packages/glanceclient/common/http.py:152
2014-07-22 17:25:32.310 15514 ERROR cinder.api.middleware.fault [req-0a2334ec-11a0-4356-89b4-492a2a59b302 fafa6d26b7644056bcdd920f2a667785 c78d023501b34820b5bcd9e2db85a2bf - - -] Caught error: container_format
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault Traceback (most recent call last):
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/api/middleware/fault.py", line 75, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return req.get_response(self.application)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/request.py", line 1296, in send
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault application, catch_exc_info=False)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/request.py", line 1260, in call_application
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault app_iter = application(self.environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return resp(environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/keystoneclient/middleware/auth_token.py", line 615, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return self.app(env, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return resp(environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return resp(environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/routes/middleware.py", line 131, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault response = self.app(environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return resp(environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault resp = self.call_func(req, *args, **self.kwargs)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return self.func(req, *args, **kwargs)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/api/openstack/wsgi.py", line 895, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault content_type, body, accept)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/api/openstack/wsgi.py", line 943, in _process_stack
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault action_result = self.dispatch(meth, request, action_args)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/api/openstack/wsgi.py", line 1019, in dispatch
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return method(req=request, **action_args)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/api/v1/volumes.py", line 432, in create
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault new_volume = self.volume_api.create(context,
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/volume/api.py", line 189, in create
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault flow_engine.run()
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/engine.py", line 89, in run
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault for _state in self.run_iter():
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/engine.py", line 137, in run_iter
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault misc.Failure.reraise_if_any(failures.values())
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/taskflow/utils/misc.py", line 797, in reraise_if_any
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault failures[0].reraise()
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/taskflow/utils/misc.py", line 804, in reraise
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault six.reraise(*self._exc_info)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/executor.py", line 34, in _execute_task
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault result = task.execute(**arguments)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/volume/flows/api/create_volume.py", line 341, in execute
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault self._check_image_metadata(context, image_id, size)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/volume/flows/api/create_volume.py", line 180, in _check_image_metadata
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault image_meta = self.image_service.show(context, image_id)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 228, in show
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault base_image_meta = self._translate_from_glance(image)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 336, in _translate_from_glance
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault image_meta = _extract_attributes(image)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 434, in _extract_attributes
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault output[attr] = getattr(image, attr)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/glanceclient/common/base.py", line 95, in __getattr__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return self.__getattr__(k)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/glanceclient/common/base.py", line 97, in __getattr__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault raise AttributeError(k)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault AttributeError: container_format
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault
2014-07-22 17:25:32.361 15514 INFO cinder.api.middleware.fault [req-0a2334ec-11a0-4356-89b4-492a2a59b302 fafa6d26b7644056bcdd920f2a667785 c78d023501b34820b5bcd9e2db85a2bf - - -] http://127.0.0.1:8776/v1/c78d023501b34820b5bcd9e2db85a2bf/volumes returned with HTTP 500
2014-07-22 17:25:32.362 15514 INFO eventlet.wsgi.server [req-0a2334ec-11a0-4356-89b4-492a2a59b302 fafa6d26b7644056bcdd920f2a667785 c78d023501b34820b5bcd9e2db85a2bf - - -] 127.0.0.1 - - [22/Jul/2014 17:25:32] "POST /v1/c78d023501b34820b5bcd9e2db85a2bf/volumes HTTP/1.1" 500 401 5.034834
Then I find out, the value of this image's container_format is null in mysql.
Before this, I used glance cli to upload the image
"glance image-create --name imgtest --disk-format qcow2 --is-public false --copy-from 'http://10.43.179.2:8081/files/linux/cirros-0.3.0-x86_64-disk.img'"
But use dashboard to upload an image, the value of container_format is
default to BARE.
When we create a volume with an image, in glanceclient it checked the
Attribute container_format. But in glance, when we use cli to upload an
image, it did not check the attribute of container_format or used
default value as it did in dashboard.
In order to maintain consistent, i think in glance cli, the default
value of container_format should also be provided.
** Affects: glance
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1347376
Title:
create a volume from a image raise AttributeError
Status in OpenStack Image Registry and Delivery Service (Glance):
New
Bug description:
I'm working under RHEL7 + ICEHOUSE 2014.1
For glance, image is stored in local file system.
I want to create a volume from an image.
So I run command "cinder create --image-id ${image_id} --display-name ${name} ${size}"
But then, I get error "glanceclient AttributeError: container_format" in ciner api debug info.
log_http_response /usr/lib/python2.7/site-packages/glanceclient/common/http.py:152
2014-07-22 17:25:32.310 15514 ERROR cinder.api.middleware.fault [req-0a2334ec-11a0-4356-89b4-492a2a59b302 fafa6d26b7644056bcdd920f2a667785 c78d023501b34820b5bcd9e2db85a2bf - - -] Caught error: container_format
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault Traceback (most recent call last):
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/api/middleware/fault.py", line 75, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return req.get_response(self.application)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/request.py", line 1296, in send
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault application, catch_exc_info=False)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/request.py", line 1260, in call_application
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault app_iter = application(self.environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return resp(environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/keystoneclient/middleware/auth_token.py", line 615, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return self.app(env, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return resp(environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return resp(environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/routes/middleware.py", line 131, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault response = self.app(environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return resp(environ, start_response)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault resp = self.call_func(req, *args, **self.kwargs)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return self.func(req, *args, **kwargs)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/api/openstack/wsgi.py", line 895, in __call__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault content_type, body, accept)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/api/openstack/wsgi.py", line 943, in _process_stack
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault action_result = self.dispatch(meth, request, action_args)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/api/openstack/wsgi.py", line 1019, in dispatch
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return method(req=request, **action_args)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/api/v1/volumes.py", line 432, in create
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault new_volume = self.volume_api.create(context,
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/volume/api.py", line 189, in create
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault flow_engine.run()
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/engine.py", line 89, in run
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault for _state in self.run_iter():
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/engine.py", line 137, in run_iter
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault misc.Failure.reraise_if_any(failures.values())
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/taskflow/utils/misc.py", line 797, in reraise_if_any
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault failures[0].reraise()
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/taskflow/utils/misc.py", line 804, in reraise
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault six.reraise(*self._exc_info)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/executor.py", line 34, in _execute_task
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault result = task.execute(**arguments)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/volume/flows/api/create_volume.py", line 341, in execute
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault self._check_image_metadata(context, image_id, size)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/volume/flows/api/create_volume.py", line 180, in _check_image_metadata
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault image_meta = self.image_service.show(context, image_id)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 228, in show
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault base_image_meta = self._translate_from_glance(image)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 336, in _translate_from_glance
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault image_meta = _extract_attributes(image)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 434, in _extract_attributes
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault output[attr] = getattr(image, attr)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/glanceclient/common/base.py", line 95, in __getattr__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault return self.__getattr__(k)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault File "/usr/lib/python2.7/site-packages/glanceclient/common/base.py", line 97, in __getattr__
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault raise AttributeError(k)
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault AttributeError: container_format
2014-07-22 17:25:32.310 15514 TRACE cinder.api.middleware.fault
2014-07-22 17:25:32.361 15514 INFO cinder.api.middleware.fault [req-0a2334ec-11a0-4356-89b4-492a2a59b302 fafa6d26b7644056bcdd920f2a667785 c78d023501b34820b5bcd9e2db85a2bf - - -] http://127.0.0.1:8776/v1/c78d023501b34820b5bcd9e2db85a2bf/volumes returned with HTTP 500
2014-07-22 17:25:32.362 15514 INFO eventlet.wsgi.server [req-0a2334ec-11a0-4356-89b4-492a2a59b302 fafa6d26b7644056bcdd920f2a667785 c78d023501b34820b5bcd9e2db85a2bf - - -] 127.0.0.1 - - [22/Jul/2014 17:25:32] "POST /v1/c78d023501b34820b5bcd9e2db85a2bf/volumes HTTP/1.1" 500 401 5.034834
Then I find out, the value of this image's container_format is null in mysql.
Before this, I used glance cli to upload the image
"glance image-create --name imgtest --disk-format qcow2 --is-public false --copy-from 'http://10.43.179.2:8081/files/linux/cirros-0.3.0-x86_64-disk.img'"
But use dashboard to upload an image, the value of container_format is
default to BARE.
When we create a volume with an image, in glanceclient it checked the
Attribute container_format. But in glance, when we use cli to upload
an image, it did not check the attribute of container_format or used
default value as it did in dashboard.
In order to maintain consistent, i think in glance cli, the default
value of container_format should also be provided.
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1347376/+subscriptions
Follow ups
References