From 075b7912bf1d48c881aa06bcde51e6f81d7f79b1 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Tue, 11 Apr 2023 22:43:58 +0200 Subject: [PATCH] qa/suites/rbd: install qemu-utils in addition to qemu-block-extra on Ubuntu qemu-utils is usually pre-installed but, due to what appears to be a Ubuntu packaging bug, it's not upgraded when qemu-block-extra is installed: The following NEW packages will be installed: qemu-block-extra The following packages will be upgraded: qemu-system-common qemu-system-data qemu-system-gui qemu-system-x86 However, the version of the block driver must match exactly the version of the qemu-img tool, so the above leads to: $ qemu-img convert -f qcow2 -O raw /home/ubuntu/cephtest/qemu/base.client.0.0.qcow2 rbd:rbd/client.0.0 Failed to initialize module: /usr/lib/x86_64-linux-gnu/qemu/block-rbd.so Note: only modules from the same build can be loaded. qemu: module block-block-rbd not found, do you want to install qemu-block-extra package? qemu-img: Unknown protocol 'rbd' Fixes: https://tracker.ceph.com/issues/59431 Signed-off-by: Ilya Dryomov (cherry picked from commit c529fdd63a5aae2c598078df05fe9bbef40042dc) --- .../rbd/singleton/all/qemu-iotests-no-cache.yaml | 1 + .../singleton/all/qemu-iotests-writearound.yaml | 1 + .../rbd/singleton/all/qemu-iotests-writeback.yaml | 1 + .../singleton/all/qemu-iotests-writethrough.yaml | 1 + qa/tasks/qemu.py | 15 +++++++++------ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/qa/suites/rbd/singleton/all/qemu-iotests-no-cache.yaml b/qa/suites/rbd/singleton/all/qemu-iotests-no-cache.yaml index 25d124a34f46c..364dd8810479b 100644 --- a/qa/suites/rbd/singleton/all/qemu-iotests-no-cache.yaml +++ b/qa/suites/rbd/singleton/all/qemu-iotests-no-cache.yaml @@ -8,6 +8,7 @@ tasks: - qemu-kvm-block-rbd deb: - qemu-block-extra + - qemu-utils - ceph: fs: xfs conf: diff --git a/qa/suites/rbd/singleton/all/qemu-iotests-writearound.yaml b/qa/suites/rbd/singleton/all/qemu-iotests-writearound.yaml index 908d457e999bd..9757083855205 100644 --- a/qa/suites/rbd/singleton/all/qemu-iotests-writearound.yaml +++ b/qa/suites/rbd/singleton/all/qemu-iotests-writearound.yaml @@ -8,6 +8,7 @@ tasks: - qemu-kvm-block-rbd deb: - qemu-block-extra + - qemu-utils - ceph: fs: xfs conf: diff --git a/qa/suites/rbd/singleton/all/qemu-iotests-writeback.yaml b/qa/suites/rbd/singleton/all/qemu-iotests-writeback.yaml index 9fabbeccfd6ad..9d078c33d691a 100644 --- a/qa/suites/rbd/singleton/all/qemu-iotests-writeback.yaml +++ b/qa/suites/rbd/singleton/all/qemu-iotests-writeback.yaml @@ -8,6 +8,7 @@ tasks: - qemu-kvm-block-rbd deb: - qemu-block-extra + - qemu-utils - ceph: fs: xfs conf: diff --git a/qa/suites/rbd/singleton/all/qemu-iotests-writethrough.yaml b/qa/suites/rbd/singleton/all/qemu-iotests-writethrough.yaml index fedb3cfc5e80e..c5250bb906b88 100644 --- a/qa/suites/rbd/singleton/all/qemu-iotests-writethrough.yaml +++ b/qa/suites/rbd/singleton/all/qemu-iotests-writethrough.yaml @@ -8,6 +8,7 @@ tasks: - qemu-kvm-block-rbd deb: - qemu-block-extra + - qemu-utils - ceph: fs: xfs conf: diff --git a/qa/tasks/qemu.py b/qa/tasks/qemu.py index d4802d0cd5537..b5923b285a73f 100644 --- a/qa/tasks/qemu.py +++ b/qa/tasks/qemu.py @@ -164,19 +164,22 @@ def install_block_rbd_driver(ctx, config): """ Make sure qemu rbd block driver (block-rbd.so) is installed """ - for client, client_config in config.items(): + packages = {} + for client, _ in config.items(): (remote,) = ctx.cluster.only(client).remotes.keys() if remote.os.package_type == 'rpm': - block_rbd_pkg = 'qemu-kvm-block-rbd' + packages[client] = ['qemu-kvm-block-rbd'] else: - block_rbd_pkg = 'qemu-block-extra' - install_package(block_rbd_pkg, remote) + packages[client] = ['qemu-block-extra', 'qemu-utils'] + for pkg in packages[client]: + install_package(pkg, remote) try: yield finally: - for client, client_config in config.items(): + for client, _ in config.items(): (remote,) = ctx.cluster.only(client).remotes.keys() - remove_package(block_rbd_pkg, remote) + for pkg in packages[client]: + remove_package(pkg, remote) @contextlib.contextmanager def generate_iso(ctx, config): -- 2.39.5