conversion_format should assign as the input parameter

Bug #1592212 reported by haobing1
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Invalid
Undecided
Unassigned

Bug Description

when use the command of 'glance task-create --type --input' to create a image, if we want to convert the image's format, we have to set the conversion_format in the glance-api.conf file,such as 'conversion_format = raw'. I think this is inconvenient,we should set the conversion_format as the input parameter. such as 'glance task-create --type import --input '{"import_from":"http://10.43.176.8/images/cirros-0.3.1-x86_64-disk.img","import_from_format": "", "conversion_format": "raw", "image_properties":{"disk_format":"raw","container_format":"bare","name":"test-hb_1"}}'

haobing1 (haobing1)
description: updated
Revision history for this message
Victoria Martinez de la Cruz (vkmc) wrote :

IMO this should go to python-glanceclient rather than in Glance.

affects: glance → python-glanceclient
Revision history for this message
SamP (sampath-priyankara) wrote :

Hi,

 Before triage this as bug or not,
 if you want to do this as haobing1 said above,
 then we have to change glance and add _Convert task to import flow, seems not done yet.
 Now, glanceclient pass everything to glance in "input" as below,

REQ: curl -g -i -X POST http://192.168.50.5:9292/v2/tasks -H "User-Agent: python-glanceclient" -H "Content-Type: application/json" -H "X-Auth-Token: {SHA1}a53eeb8f45be909a59b870db5ddc1f2718321c70" -d '{"input": {"image_properties": {"container_format": "bare", "disk_format": "raw", "name": "testsam3"}, "import_from_format": "", "import_from": "http://192.168.50.14/img.crissos", "conversion_format": "raw"}, "type": "import"}'

On client side, glanceclient can not do more than this, otherwise glance task API changed.
Therefore, IMHO, this issue affects glance rather than glaceclient.
Anyway, I leave this for bug-team (or others) to decide.

Before, proceeding much further I would like to discuss why we need to set "conversion_format" via API? If you need glance to convert your images to given format before add it to store, then IMHO this is not the correct way to do it.
AFAIK (may be wrong), "conversion_format" is used for convert the images to image-backend compatible file formats. You may find the relevant codes at "glance/async/flows/convert.py"
Pls refer to # NOTE(flaper87): on the above code for more info.

Revision history for this message
Ian Cordasco (icordasc) wrote :

This doesn't appear to be a client issue.

Changed in python-glanceclient:
status: New → Invalid
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.