Functional test fails with a: "Unknown file format 'qcow'" error on Centos8

Bug #1946457 reported by Andre Aranha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Andre Aranha

Bug Description

This issue was discovered on tests with FIPS enabled[1], but without FIPS the same issue happens.
When running glance functional tests on a Centos8 server, the following issue happens:
{1} glance.tests.functional.v2.test_images.TestImages.test_image_upload_qcow_virtual_size_calculation [5.522514s] ... FAILED

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/home/zuul/src/opendev.org/openstack/glance/glance/tests/functional/v2/test_images.py", line 931, in test_image_upload_qcow_virtual_size_calculation
    fn = self._create_qcow(128 * units.Mi)

      File "/home/zuul/src/opendev.org/openstack/glance/glance/tests/functional/v2/test_images.py", line 914, in _create_qcow
    shell=True)

      File "/usr/lib64/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout

      File "/usr/lib64/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)

    subprocess.CalledProcessError: Command 'qemu-img create -f qcow /tmp/glance-unittest-images-5flalm7e.qcow 134217728' returned non-zero exit status 127.
~~~

Trying to run this command manually on a Centos8 server with qemu-img installed (qemu-img-15:4.2.0-48): qemu-img create -f qcow /tmp/glance-unittest-images-5flalm7e.qcow 134217728
Initially it fails due to a gcrypt issue:
~~~
$ qemu-img create -f qcow /tmp/glance-unittest-images-5flalm7e.qcow 134217728
qemu-img: Unable to initialize gcrypt
~~~

There is a bug for this that[2] and the solution is to update the libgcrypt package. Previously I had 'libgcrypt-1.8.3-4' and updated to: 'libgcrypt-1.8.5-4'.
After this, I got the "Unknown file format 'qcow'" error:
~~~
$ qemu-img create -f qcow /tmp/glance-unittest-images-5flalm7e.qcow 134217728
qemu-img: /tmp/glance-unittest-images-5flalm7e.qcow: Unknown file format 'qcow'

$ qemu-img create -f qcow2 /tmp/glance-unittest-images-5flalm7e.qcow 134217728
Formatting '/tmp/glance-unittest-images-5flalm7e.qcow', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16
~~~

Looking at our documentation I believe we don't support qcow format anymore[3], so should we still keep this test? Or maybe, change it to use qcow2 instead of qcow?
I believe that the reason we didn't see this issue on the CI's, is because they are testing on a Ubuntu server (At least for the patch I analysed).

[1] https://zuul.opendev.org/t/openstack/build/4f3a50281bc44ada9fb68ac24236cf1c/console

[2] https://bugzilla.redhat.com/show_bug.cgi?id=1828681

[3] https://docs.openstack.org/glance/train/user/formats.html#disk-format

Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote :

I think we should change it to use qcow2

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/glance/+/813406

Changed in glance:
status: New → In Progress
Andre Aranha (afariasa)
Changed in glance:
assignee: nobody → Andre Aranha (afariasa)
Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote :
Changed in glance:
importance: Undecided → High
Revision history for this message
Dan Smith (danms) wrote :

I'm guessing the qemu on the system you're testing on dropped support for qcow, but maybe it's still in the ubuntu packages. Either way, I definitely meant qcow2 those, so the fix is appropriate :)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.opendev.org/c/openstack/glance/+/813406
Committed: https://opendev.org/openstack/glance/commit/947e541fc0f7c0fc2b759898ab8b9401d152f3d0
Submitter: "Zuul (22348)"
Branch: master

commit 947e541fc0f7c0fc2b759898ab8b9401d152f3d0
Author: Andre Aranha <email address hidden>
Date: Mon Oct 11 10:20:38 2021 +0000

    Update qcow test to use qcow2 instead

    qemu-img package for Centos 8 doesn't support qcow disk format anymore,
    due to this, tests using qcow are failing with
    `Unknown file format 'qcow'`.
    This patch updates the qcow tests for qcow2 instead.

    Closes-Bug: #1946457

    Change-Id: If488ae4299a6cab521eec9c5e9ce4f29f94057e1

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/glance/+/828233

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/glance/+/828240

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/glance/+/828233
Committed: https://opendev.org/openstack/glance/commit/881b24a2ad882ba06e16acd8e5a54eeb9d30e1a5
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 881b24a2ad882ba06e16acd8e5a54eeb9d30e1a5
Author: Andre Aranha <email address hidden>
Date: Mon Oct 11 10:20:38 2021 +0000

    Update qcow test to use qcow2 instead

    qemu-img package for Centos 8 doesn't support qcow disk format anymore,
    due to this, tests using qcow are failing with
    `Unknown file format 'qcow'`.
    This patch updates the qcow tests for qcow2 instead.

    Closes-Bug: #1946457

    Change-Id: If488ae4299a6cab521eec9c5e9ce4f29f94057e1
    (cherry picked from commit 947e541fc0f7c0fc2b759898ab8b9401d152f3d0)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 24.0.0.0rc1

This issue was fixed in the openstack/glance 24.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 23.1.0

This issue was fixed in the openstack/glance 23.1.0 release.

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

Change abandoned by "Cyril Roelandt <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/glance/+/828240
Reason: This branch is too old, we will not merge this.

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.