[Kimchi-devel] [PATCH v2 0/3] Download remote image to storage pool

Crístian Viana vianac at linux.vnet.ibm.com
Thu Sep 4 15:58:29 UTC 2014


Hi Hongliang. Thanks for testing this patchset!

I don't understand why this isn't working for you. I just executed the 
same command here on my laptop and it worked fine. Take a look at my 
commands:

$ curl -k -u vianac:<password> -H "Content-Type: application/json" -H  
"Accept: application/json" 
https://127.0.0.1:8001/storagepools/default/storagevolumes -X POST -d 
'{"name": "CorePure64-5.3.iso", "url": 
"http://distro.ibiblio.org/tinycorelinux/5.x/x86_64/release/CorePure64-5.3.iso"}'
{
   "status":"running",
   "message":"OK",
   "id":"2",
   "target_uri":""
}
$ curl -k -u vianac:<password> -H "Content-Type: application/json" -H  
"Accept: application/json" https://127.0.0.1:8001/tasks/2
{
   "status":"running",
   "message":"4194304/10772480",
   "id":"2"
}
$ curl -k -u vianac:<password> -H "Content-Type: application/json" -H  
"Accept: application/json" https://127.0.0.1:8001/tasks/2
{
   "status":"running",
   "message":"5242880/10772480",
   "id":"2"
}

And there was no error stack trace on the console.

Are you sure you have these 3 patches applied? Could you please check if 
the function "_create_volume_with_url" is defined at 
src/kimchi/model/storagevolumes.py, line 129? The exception you 
mentioned is supposed to be raised when that function doesn't exist.

On 04-09-2014 12:40, Hongliang Wang wrote:
> Hi Cristian, seems something wrong when I send a request to create 
> volume from remote URL.
>
> Remote Address:9.123.141.150:8001
> Request URL:https://9.123.141.150:8001/storagepools/ISO/storagevolumes
> Request Method:POST
> Status Code:400 Bad Request
>
> Request Payload:
> {
>   name: "CorePure64-5.3.iso"
>   url: 
> "http://distro.ibiblio.org/tinycorelinux/5.x/x86_64/release/CorePure64-5.3.iso"
> }
>
> The response:
>
> {
>   "reason":"KCHVOL0019E: Creating volume from url is not supported",
>   "code":"400 Bad Request"
> }
>
> On 09/04/2014 09:46 PM, Crístian Viana wrote:
>> Changelog from previous version (v1):
>>
>> - Remove the text "downloading" from the download task status message.
>>    Now it only contains the data: <downloaded size>/<total size>.
>>
>> Crístian Viana (3):
>>    storagevolume: Download remote images to a storage pool
>>    storagevolume: Check storage pool before adding a volume
>>    storagevolume: Add download progress to task
>>
>>   docs/API.md                        |  1 +
>>   src/kimchi/mockmodel.py            | 39 ++++++++++++++++++++++-----
>>   src/kimchi/model/storagevolumes.py | 54 
>> +++++++++++++++++++++++++++++++++++---
>>   tests/test_model.py                | 24 +++++++++++++++++
>>   tests/test_rest.py                 | 14 +++++++++-
>>   5 files changed, 120 insertions(+), 12 deletions(-)
>>
>




More information about the Kimchi-devel mailing list