Description of problem: Getting Warning message for glance create process: "resize-before-write for each chunk" this is slowing down the image creation process. Version-Release number of selected component (if applicable): openstack-glance-16.0.1-5.el7ost.noarch puppet-glance-12.5.0-4.el7ost.noarch python2-glanceclient-2.10.0-1.el7ost.noarch python2-glance-store-0.23.1-0.20180213060248.ad7df98.el7ost.noarch python-glance-16.0.1-5.el7ost.noarch How reproducible: Yes Steps to Reproduce: Execute: $ date && time glance --os-image-api-version 2 image-create --progress --visibility public --file <RAW_FILE_PATH> --name <IMAGE_NAME> --container-format bare --disk-format raw Actual results: Every time, the image is getting "resize-before-write" which we believe slowing down the process. From looking at glance log (/var/log/containers/glance/api.log), I've noticed the following messages each time i upload a new image: 2019-03-11 15:30:07.332 80 WARNING glance_store._drivers.rbd [req-305d8a77-657e-4d9c-8bf8-1a5834ca6f68 6e0fef500dcd4c3ba94dee6036e3e978 7ef5effdfbc145daa3104dd985b93cbc - default default] since image size is zero we will be doing resize-before-write for each chunk which will be considerably slower than normal [root@controller-0 ~]# time openstack image create "test" --file /root/images/test.raw --disk-format raw --container-format bare --public +------------------+--------------------------------------------------------------------------------------------------------------------+ | Field | Value | +------------------+--------------------------------------------------------------------------------------------------------------------+ | checksum | 97598938c7d4acfb7a71bb97a956a53d | | container_format | bare | | created_at | 2019-03-12T08:59:28Z | | disk_format | raw | | file | /v2/images/538ce5ca-4ab6-415f-b0e4-184a2a94b970/file | | id | 538ce5ca-4ab6-415f-b0e4-184a2a94b970 | | min_disk | 0 | | min_ram | 0 | | name | test | | owner | 7ef5effdfbc145daa3104dd985b93cbc | | properties | direct_url='rbd://30095f51-c118-47ea-8841-e2796c2bad40/devops_os_images/538ce5ca-4ab6-415f-b0e4-184a2a94b970/snap' | | protected | False | | schema | /v2/schemas/image | | size | 44023414784 | | status | active | | tags | | | updated_at | 2019-03-12T09:05:24Z | | virtual_size | None | | visibility | public | +------------------+--------------------------------------------------------------------------------------------------------------------+ real 5m58.891s user 0m7.672s sys 0m20.771s Expected results: "resize-before-write" is not expected to happen in API v2 Additional info: This is similar to [1] but for RHSOP-13 version. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1377796
I added the upstream bug and code review to the external references where this is being addressed.
So apparently, this is no longer an issue when using the new image import process. I'm not sure whether this is going to be fixed upstream, or even easy to backport to 13 :/
@Abhishek: the spec you mentioned has been abandoned. Is https://review.opendev.org/#/c/741121/ a way to solve this bz?
(In reply to Cyril Roelandt from comment #15) > @Abhishek: the spec you mentioned has been abandoned. Is > https://review.opendev.org/#/c/741121/ a way to solve this bz? No the spec you mentioned is to calculate virtual size of image. We need to check at rbd store whether we can use virtual size to reduce/resolve this issue.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Red Hat OpenStack Platform (RHOSP) 16.2 enhancement advisory), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2021:3483