Virtual size not computed when creating an image

Bug #1665037 reported by Cyril Roelandt
6
This bug affects 1 person
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 | 4b61c7892eefc23b71d4931bdcc3f1f1 |
| container_format | bare |
| created_at | 2017-02-15T16:45:07Z |
| disk_format | qcow2 |
| id | 430da280-857a-4fe0-9447-a2b42bc24fe8 |
| min_disk | 0 |
| min_ram | 0 |
| name | test |
| owner | a645c608c70b4fecb7dc42f2bcddbc9a |
| protected | False |
| size | 52824064 |
| status | active |
| tags | [] |
| updated_at | 2017-02-15T16:45:08Z |
| 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)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/479015

Changed in glance:
status: New → In Progress
Revision history for this message
Erno Kuvaja (jokke) wrote :

As the images API reference states null is valid value for virtual_size. Glance does not promise on any image format or backend basis to provide virtual size as integer.

Changed in glance:
status: In Progress → Invalid
Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

> How should we fix this?

We discussed this at today's Glance meeting. It's not a bug, but could be addressed by a spec-lite. Issues to consider are mentioned in the meeting log:
http://eavesdrop.openstack.org/meetings/glance/2017/glance.2017-11-16-14.01.log.html#l-68

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (master)

Change abandoned by "Abhishek Kekane <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/glance/+/479015
Reason: Not required any more

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.