glance image uplaod using curl is not uploading fulle image size

asked 2016-08-05 11:40:52 -0600

Pavanasam R gravatar image

updated 2016-08-10 09:11:31 -0600

Hi All,

I'm trying to upload a image to glance via Curl. the image is getting uploaded, but only very little part of it (no error or output displayed on screen). For ex, if my image size is around 16GB, its getting uploaded around 500MB only. Below is the command format i've used. Thanks in advance for your help.

url ${OS_GLANCE_URL}/images/$IMAGE_ID/file  -X PUT -H "Content-Type: application/octet-stream" -H "X-Auth-Token: $OS_TOKEN" -d @image1.raw

url ${OS_GLANCE_URL}/images/$IMAGE_ID/file  -X PUT -H "Content-Type: application/octet-stream" -H "X-Auth-Token: $OS_TOKEN" -d @image2.qcow2

Initial image creation:
curl ${OS_GLANCE_URL}/images -s -X POST -H "$(cat ${confDir}/headers.txt)" -d @${confDir}/createImage.json | python -mjson.tool

cat headers.txt
Accept: application/json
X-Auth-Token: <OS-token>

raw format:
cat createImage.json 
"container_format": "bare",
"disk_format": "raw,   
"name": "Image_RAW"

qcow2 format:
cat createImage.json 
"container_format": "bare",
"disk_format": "qcow2",   
"name": "Image_qcow2"
edit retag flag offensive close merge delete


i've used glance V2 api

Pavanasam R gravatar imagePavanasam R ( 2016-08-05 11:50:35 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2016-08-11 21:40:43 -0600

Pavanasam R gravatar image

using --data-binary instead of -d option, solves the issue.

curl ${OS_GLANCE_URL}/images/$BASE_IMAGE_ID/file -X PUT -H "Content-Type: application/octet-stream" -H "X-Auth-Token: $OS_TOKEN" --data-binary @${baseImage} | python -mjson.tool

edit flag offensive delete link more


Hi do you know why this option makes the difference?

jshen28 gravatar imagejshen28 ( 2019-07-05 02:38:00 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-08-05 11:40:52 -0600

Seen: 398 times

Last updated: Aug 11 '16