Virtual size not computed when creating an image
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Invalid
|
Undecided
|
Pranali Deore |
Bug Description
$ qemu-img info dsl-4.11.rc2.qcow2
image: dsl-4.11.rc2.qcow2
file format: qcow2
virtual size: 50M (52824064 bytes)
disk size: 50M
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
Note that qemu-img reports that the virtual size of this qcow2 image is 50M. Now, let's create an image in Glance:
$ glance image-create --name test --file dsl-4.11.rc2.iso --disk-format qcow2 --container-format bare
+------
| Property | Value |
+------
| checksum | 4b61c7892eefc23
| container_format | bare |
| created_at | 2017-02-
| disk_format | qcow2 |
| id | 430da280-
| min_disk | 0 |
| min_ram | 0 |
| name | test |
| owner | a645c608c70b4fe
| protected | False |
| size | 52824064 |
| status | active |
| tags | [] |
| updated_at | 2017-02-
| virtual_size | None |
| visibility | shared |
+------
Here, the virtual size is "None". This is not just a bug with displaying the values:
mysql> use glance;
...
mysql> select name, virtual_size from images where name='test' and deleted=0;
+------
| name | virtual_size |
+------
| test | NULL |
+------
The value is the "wrong" one in the database as well.
The size is computed during the treatment of the PUT request, but the virtual size is never computed anywhere. This might be a job for glance_store though. The "_Introspect" flow does this computation, but since the task API has been deprecated, I do not think we should attempt to use this code.
How should we fix this?
Changed in glance: | |
assignee: | nobody → Pranali Deore (pranali-deore) |
Fix proposed to branch: master /review. openstack. org/479015
Review: https:/