Skip to content

KVM agent logs the Ceph key when a qemu-img copy to RBD fails #14933

In review

Description

@bhouse-nexthop

problem

When a qemu-img convert to or from an RBD pool fails, the KVM agent logs the image URI with the cephx key in it, for example at ERROR from LibvirtStorageAdaptor.copyPhysicalDisk:

Failed to convert from /mnt/<secondary>/<template>.qcow2 to rbd:<pool>/<image>:mon_host=<mon>:auth_client_required=cephx:id=<user>:key=<the key>:rbd_default_format=2:client_mount_timeout=30 the error was: ...

qemu-img repeats the URI in its own error output, so Script logs the key a second time at WARN ("Process [...] encountered the error"). Script already masks an argument that starts with rbd:, but not an rbd URI inside --image-opts, inside the comma-joined disk list passed to nasbackup.sh, or the rbd du ... --key <key> command run for every RBD snapshot (logged at DEBUG). Some of these messages are also returned to the management server in the Answer.

versions

4.22 and main, KVM with Ceph RBD primary storage.

The steps to reproduce the bug

  1. Register a QCOW2 template whose image cannot be read (for example a corrupt L1 table).
  2. Deploy a VM from it on an RBD primary storage pool, so the agent copies the template to RBD with qemu-img convert.
  3. The copy fails; agent.log holds the cephx key in the ERROR line and in the Script WARN line.

What to do about it?

Mask the key wherever a command line, its output, a qemu-img error or an RBD file name is logged or returned, as key=******.

Activity

  1. added this to the 4.22.3 milestone on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions