create a volume from an image raise AttributeError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Invalid
|
Wishlist
|
Zhang Hao |
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.
First,I use glance cli to upload an image
"glance image-create --name imgtest --disk-format qcow2 --is-public false --copy-from 'http://
Then,I run command
"cinder create --image-id ${image_id} --display-name ${name} ${size}"
But I get error "glanceclient AttributeError: container_format" ,in ciner-api debug info:
-------
2014-07-22 17:25:32.310 15514 TRACE cinder.
2014-07-22 17:25:32.310 15514 TRACE cinder.
2014-07-22 17:25:32.310 15514 TRACE cinder.
2014-07-22 17:25:32.310 15514 TRACE cinder.
2014-07-22 17:25:32.310 15514 TRACE cinder.
2014-07-22 17:25:32.310 15514 TRACE cinder.
2014-07-22 17:25:32.310 15514 TRACE cinder.
-------
Then I find out, using glance cli to upload an image, the value of this image's container_format is 'None' in mysql.
But use dashboard to upload an image, the value of container_format is default to 'Bare'.
When we create a volume from an image, glanceclient checks the Attribute container_format. So we get this error.
summary: |
- create a volume from a image raise AttributeError + create a volume from an image raise AttributeError |
description: | updated |
Changed in glance: | |
assignee: | nobody → Zhang Hao (zhang-hao16) |
description: | updated |
description: | updated |
I add a check in glance\ api\v1\ images. py: Controller. create( ), if the value of container_format is 'None', default to set the value 'Bare'.
Then I create a volume from an image successfully.
In order to maintain consistent, as far as i am concern, the default value of container_format in glance cli should also be provided like it does in dashboard.