Comment 6 for bug 1226089

Revision history for this message
Zhi Yan Liu (lzy-dev) wrote :

Current our most store driver's 'get_size()' method does not raise exception when it meet exception but return '0' directly, for http driver https://github.com/openstack/glance/blob/master/glance/store/http.py#L151 , so for store's upper layer such as https://github.com/openstack/glance/blob/master/glance/api/v1/images.py#L469 will active image with zero size since 'location' is provided.

There is a workaround under current design, you can tell glance image's size when you create it like following, but you will also meet exception when you consuming it such as trigger provisioning since http store can not receive remote image with a unusable network link.

glance image-create --name cirros --is-public true --container-format bare --disk-format qcow2 --location https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img --size 123456

I'm not sure this is a defect but from end user's perspective this behavior is strange, so probably we need import an exception mechanism (and related up layer handling) for store 'get_size()'. any thoughts?