← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1665037] Re: Virtual size not computed when creating an image

 

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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1665037

Title:
  Virtual size not computed when creating an image

Status in Glance:
  Invalid

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?

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1665037/+subscriptions


References