Bug 1049394
| Summary: | Creating an image from CLI without --container format queued the image and fails with 400. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat OpenStack | Reporter: | Eduardo Warszawski <ewarszaw> | ||||
| Component: | openstack-glance | Assignee: | Jon Bernard <jobernar> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | Dafna Ron <dron> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 4.0 | CC: | eglynn, fpercoco, iheim, jobernar, scohen, sgotliv, yeylon | ||||
| Target Milestone: | Upstream M3 | ||||||
| Target Release: | 6.0 (Juno) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2015-01-27 08:46:29 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
Looks like a bug indeed. A bit weird, though. The image data deseralization / validation happens before the image creation. https://github.com/openstack/glance/blob/master/glance/api/v1/images.py#L1084 The create method in Controller (not ImageDeserializer) is being called: https://github.com/openstack/glance/blob/master/glance/api/v1/images.py#L726 The exception is raised as it should, but the image has already made it into the list/table at this point, even though create() raises an exception. I need to investigate the tempest test failures to determine if it's worth pursuing this further. Pushing to 6.0 for now. Agreed in last week's meeting that this change could break backward compability in the v1 api and is not worth it at this point in v1's life cycle as v2 will hopefully become the default soon. This is a v1 only issue, which won't land now that we're focusing just on v2. Closing. |
Created attachment 846698 [details] create-image debug output Description of problem: Creating an image from CLI without --container format queued the image and fails with 400. Request returned failure status. 400 Bad Request Invalid container format 'None' for image. (HTTP 400) Version-Release number of selected component (if applicable): How reproducible: # glance --debug image-create --name rhel_65 --disk-format qcow2 --file /root/rhel-guest-image-6-6.5-20131115.0-1.qcow2 --progress Actual results: # glance --debug image-create --name rhel_65 --disk-format qcow2 --file /root/rhel-guest-image-6-6.5-20131115.0-1.qcow2 --progress <snip. See attached file> [=============================>] 100% HTTP/1.1 400 Bad Request date: Tue, 07 Jan 2014 14:13:54 GMT content-length: 64 content-type: text/plain; charset=UTF-8 x-openstack-request-id: req-11b4ecad-3a8d-4e44-9c37-a4d843805889 400 Bad Request Invalid container format 'None' for image. # glance image-list +--------------------------------------+---------+-------------+------------------+-----------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+---------+-------------+------------------+-----------+--------+ | b2490dd2-b535-4b98-8647-cca428a63e01 | rhel_65 | qcow2 | | 307962880 | queued | | f1367012-3ca3-4bbc-954d-0a1a4352b928 | rhel_65 | qcow2 | | 307962880 | queued | | 54e7bfa4-35a3-46c2-b604-23b3ef568482 | rhel_65 | qcow2 | | 307962880 | queued | +--------------------------------------+---------+-------------+------------------+-----------+--------+ *** All these are failed images. *** Expected results: Should fail without queing anything. Additional info: Debug info is attach.