volume size is smaller than the cache size

Bug #1869314 reported by yenai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
In Progress
Undecided
yenai

Bug Description

Image info:
[stack@localhost devstack]$ glance image-show 270c0ea5-76bc-4b3b-8293-b3562d7a85b5
+------------------+----------------------------------------------------------------------------------+
| Property | Value |
+------------------+----------------------------------------------------------------------------------+
| checksum | 056fcc63eb0e7aa3fc36c2d384e1a45d |
| container_format | bare |
| created_at | 2019-09-13T00:32:27Z |
| disk_format | qcow2 |
| id | 270c0ea5-76bc-4b3b-8293-b3562d7a85b5 |
| min_disk | 0 |
| min_ram | 0 |
| name | CentOS7-1611 |
| os_hash_algo | sha512 |
| os_hash_value | fa5515da171d31580ed3900036676c85345557bfd0bf8076ec4e0e304306422fcbe7ea4b330375cf |
| | 4850887507e01a95b98b257b0464a8baffc5b55114b7084a |
| os_hidden | False |
| owner | d01ec9caf63a4211a7ab47bea3e489e7 |
| protected | False |
| size | 1317994496 |
| status | active |
| tags | [] |
| updated_at | 2019-09-13T00:33:12Z |
| virtual_size | Not available |
| visibility | shared |
+------------------+----------------------------------------------------------------------------------+
[stack@localhost devstack]$ qemu-img info 270c0ea5-76bc-4b3b-8293-b3562d7a85b5
image: 270c0ea5-76bc-4b3b-8293-b3562d7a85b5
file format: qcow2
virtual size: 8.0G (8589934592 bytes)
disk size: 1.2G
cluster_size: 65536
Format specific information:
    compat: 0.10
    refcount bits: 16
[stack@localhost devstack]$

Create a 9GB volume, auto creating a 8GB image cache volume: This is right.
[stack@localhost devstack]$ cinder list --all | grep available
| 59959108-bde2-4477-b6ea-cededdbdb8f7 | d01ec9caf63a4211a7ab47bea3e489e7 | available | - | 9 | yenai-lvm | true | |
| ea5d357c-10a3-46c5-aee6-7e2281717f62 | 4568925a214e48d4ab32bcd71c6faff1 | available | image-270c0ea5-76bc-4b3b-8293-b3562d7a85b5 | 8 | yenai-lvm | false | |
[stack@localhost devstack]$

Create a 1GB volume: Failed(size is not fit). This is right.
[stack@localhost devstack]$ cinder create --image-id 270c0ea5-76bc-4b3b-8293-b3562d7a85b5 --volume-type yenai-lvm 1
ERROR: Invalid input received: Size of specified image 2GB is larger than volume size 1GB. (HTTP 400) (Request-ID: req-a1fddaa0-4f31-46ce-a5a1-4c7da3c0b18c)

★★★★★ Create a 2GB volume: success!!! This is a big problem.
[stack@localhost devstack]$ cinder create --image-id 270c0ea5-76bc-4b3b-8293-b3562d7a85b5 --volume-type yenai-lvm 2
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2019-09-13T02:28:27.000000 |
| description | None |
| encrypted | False |
| id | 48ad9897-5349-4cf8-b393-a8043d2f437b |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | None |
| os-vol-host-attr:host | None |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | d01ec9caf63a4211a7ab47bea3e489e7 |
| replication_status | None |
| size | 2 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| updated_at | None |
| user_id | 83aa2159496d4a20bc83185a56021ef8 |
| volume_type | yenai-lvm |
+--------------------------------+--------------------------------------+
[stack@localhost devstack]$ cinder list --all
+--------------------------------------+----------------------------------+-----------+--------------------------------------------+------+----------------------+----------+--------------------------------------+
| ID | Tenant ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+----------------------------------+-----------+--------------------------------------------+------+----------------------+----------+--------------------------------------+
| 48ad9897-5349-4cf8-b393-a8043d2f437b | d01ec9caf63a4211a7ab47bea3e489e7 | available | - | 2 | yenai-lvm | true | |
| ea5d357c-10a3-46c5-aee6-7e2281717f62 | 4568925a214e48d4ab32bcd71c6faff1 | available | image-270c0ea5-76bc-4b3b-8293-b3562d7a85b5 | 8 | yenai-lvm | false | |
+--------------------------------------+----------------------------------+-----------+--------------------------------------------+------+----------------------+----------+--------------------------------------+

LVM info:
[stack@localhost devstack]$ sudo lvs
  LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
  root cl -wi-ao---- <35.00g
  swap cl -wi-ao---- 4.00g
  stack-volumes-lvmdriver-1-pool stack-volumes-lvmdriver-1 twi-aotz-- 22.80g 0.00 10.50
  _snapshot-5f9d0432-5251-407a-959c-53be0c6505db yenai_vg Vwi-a-tz-k 1.00g yenai_vg-pool volume-d3c610b8-615b-4f42-bc9d-2d4d1fd663df 8.87
  volume-48ad9897-5349-4cf8-b393-a8043d2f437b yenai_vg Vwi-a-tz-- 8.00g yenai_vg-pool volume-ea5d357c-10a3-46c5-aee6-7e2281717f62 100.00
  volume-ea5d357c-10a3-46c5-aee6-7e2281717f62 yenai_vg Vwi-a-tz-- 8.00g yenai_vg-pool 100.00
  yenai_vg-pool yenai_vg twi-aotz-- 190.00g 4.26 12.62
[stack@localhost devstack]$

Just see the log, whitout any size check:
Sep 13 10:28:27 localhost.localdomain cinder-volume[120486]: DEBUG cinder.image.cache [None req-e3bccb29-dbef-4500-b060-5e82ab7d1bbf None None] Found image-volume cache entry: {'last_used':
datetime.datetime(2019, 9, 13, 2, 28, 27, 750938), 'image_updated_at': datetime.datetime(2019, 9, 13, 0, 33, 12), 'image_id': u'270c0ea5-76bc-4b3b-8293-b3562d7a85b5', 'host': u'localhost.loc
aldomain@yenai-lvm#yenai-lvm', 'volume_id': u'ea5d357c-10a3-46c5-aee6-7e2281717f62', 'id': 7, 'size': 8}. {{(pid=120585) get_entry /opt/stack/cinder/cinder/image/cache.py:65}}
Sep 13 10:28:27 localhost.localdomain cinder-volume[120486]: DEBUG cinder.image.cache [None req-e3bccb29-dbef-4500-b060-5e82ab7d1bbf None None] Image-volume cache entry image_update_at = 201
9-09-13 00:33:12+00:00, requested image updated_at = 2019-09-13 00:33:12+00:00. {{(pid=120585) _should_update_entry /opt/stack/cinder/cinder/image/cache.py:227}}
Sep 13 10:28:27 localhost.localdomain cinder-volume[120486]: DEBUG cinder.volume.flows.manager.create_volume [None req-e3bccb29-dbef-4500-b060-5e82ab7d1bbf None None] Found cache entry for i
mage = 270c0ea5-76bc-4b3b-8293-b3562d7a85b5 on host localhost.localdomain@yenai-lvm#yenai-lvm. {{(pid=120585) _prepare_image_cache_entry /opt/stack/cinder/cinder/volume/flows/manager/create_
volume.py:647}}
Sep 13 10:28:27 localhost.localdomain cinder-volume[120486]: DEBUG cinder.coordination [None req-e3bccb29-dbef-4500-b060-5e82ab7d1bbf None None] Lock "cinder-270c0ea5-76bc-4b3b-8293-b3562d7a
85b5" released by "_prepare_image_cache_entry" :: held 0.010s {{(pid=120585) _synchronized /opt/stack/cinder/cinder/coordination.py:162}}
Sep 13 10:28:27 localhost.localdomain cinder-volume[120486]: DEBUG cinder.volume.flows.manager.create_volume [None req-0b52c6f7-334b-42da-834e-9fb6c4d2e875 None None] Attempting to retrieve
cache entry for image = 270c0ea5-76bc-4b3b-8293-b3562d7a85b5 on host localhost.localdomain@yenai-lvm#yenai-lvm. {{(pid=120585) _create_from_image_cache /opt/stack/cinder/cinder/volume/flows/
manager/create_volume.py:602}}
Sep 13 10:28:27 localhost.localdomain cinder-volume[120486]: DEBUG cinder.image.cache [None req-0b52c6f7-334b-42da-834e-9fb6c4d2e875 None None] Found image-volume cache entry: {'last_used':
datetime.datetime(2019, 9, 13, 2, 28, 27, 760700), 'image_updated_at': datetime.datetime(2019, 9, 13, 0, 33, 12), 'image_id': u'270c0ea5-76bc-4b3b-8293-b3562d7a85b5', 'host': u'localhost.loc
aldomain@yenai-lvm#yenai-lvm', 'volume_id': u'ea5d357c-10a3-46c5-aee6-7e2281717f62', 'id': 7, 'size': 8}. {{(pid=120585) get_entry /opt/stack/cinder/cinder/image/cache.py:65}}
Sep 13 10:28:27 localhost.localdomain cinder-volume[120486]: DEBUG cinder.image.cache [None req-0b52c6f7-334b-42da-834e-9fb6c4d2e875 None None] Image-volume cache entry image_update_at = 201
9-09-13 00:33:12+00:00, requested image updated_at = 2019-09-13 00:33:12+00:00. {{(pid=120585) _should_update_entry /opt/stack/cinder/cinder/image/cache.py:227}}
Sep 13 10:28:27 localhost.localdomain cinder-volume[120486]: DEBUG cinder.volume.flows.manager.create_volume [None req-0b52c6f7-334b-42da-834e-9fb6c4d2e875 None None] Creating from source im
age-volume ea5d357c-10a3-46c5-aee6-7e2281717f62 {{(pid=120585) _create_from_image_cache /opt/stack/cinder/cinder/volume/flows/manager/create_volume.py:615}}
Sep 13 10:28:27 localhost.localdomain cinder-volume[120486]: DEBUG oslo_concurrency.processutils [None req-0b52c6f7-334b-42da-834e-9fb6c4d2e875 None None] Running cmd (subprocess): sudo cind
er-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvs --noheadings --unit=g -o vg_name,name,size --nosuffix yenai_vg/volume-ea5d357c-10a3-46c5-aee6-7e2281717f62 {{(pid=120585) execute /usr/
lib/python2.7/site-packages/oslo_concurrency/processutils.py:372}}
Sep 13 10:28:27 localhost.localdomain sudo[123128]: stack : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvs --noheadings --un
it=g -o vg_name,name,size --nosuffix yenai_vg/volume-ea5d357c-10a3-46c5-aee6-7e2281717f62
Sep 13 10:28:28 localhost.localdomain cinder-volume[120486]: DEBUG oslo_concurrency.processutils [None req-0b52c6f7-334b-42da-834e-9fb6c4d2e875 None None] CMD "sudo cinder-rootwrap /etc/cind
er/rootwrap.conf env LC_ALL=C lvs --noheadings --unit=g -o vg_name,name,size --nosuffix yenai_vg/volume-ea5d357c-10a3-46c5-aee6-7e2281717f62" returned: 0 in 0.233s {{(pid=120585) execute /us
r/lib/python2.7/site-packages/oslo_concurrency/processutils.py:409}}
Sep 13 10:28:28 localhost.localdomain cinder-volume[120486]: DEBUG oslo_concurrency.processutils [None req-0b52c6f7-334b-42da-834e-9fb6c4d2e875 None None] Running cmd (subprocess): sudo cind
er-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvcreate --name volume-48ad9897-5349-4cf8-b393-a8043d2f437b --snapshot yenai_vg/volume-ea5d357c-10a3-46c5-aee6-7e2281717f62 {{(pid=120585)
execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:372}}
Sep 13 10:28:28 localhost.localdomain sudo[123138]: stack : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvcreate --name volum
e-48ad9897-5349-4cf8-b393-a8043d2f437b --snapshot yenai_vg/volume-ea5d357c-10a3-46c5-aee6-7e2281717f62
Sep 13 10:28:28 localhost.localdomain cinder-volume[120486]: DEBUG oslo_concurrency.processutils [None req-0b52c6f7-334b-42da-834e-9fb6c4d2e875 None None] CMD "sudo cinder-rootwrap /etc/cind
er/rootwrap.conf env LC_ALL=C lvcreate --name volume-48ad9897-5349-4cf8-b393-a8043d2f437b --snapshot yenai_vg/volume-ea5d357c-10a3-46c5-aee6-7e2281717f62" returned: 0 in 0.261s {{(pid=120585) execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:409}}

The size is wrong in cinder DB, actually we must not allow to create a volume smaller then 8GB.
In my ceph env, it will do extend(reduce the size) which causing creating a smaller and unusable boot volume.
It's terrible!!!

yenai (yenai2008)
Changed in cinder:
assignee: nobody → yenai (yenai2008)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/715358

Changed in cinder:
status: New → In Progress
Revision history for this message
Rajat Dhasmana (whoami-rajat) wrote :

As i see from the image info,
the virtual size exists in the qemu-img output

virtual size: 8.0G (8589934592 bytes)

but doesn't exist in the image data

| virtual_size | Not available |

This looks more of a glance side problem than cinder.

Revision history for this message
yenai (yenai2008) wrote :

@Rajat Dhasmana:
As far as I know this value was entered by the uploader...

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.