unable to compose VM from Ubuntu 22.04 pod

Bug #1999403 reported by Christian
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Low
Unassigned

Bug Description

1. Installed a Ubuntu 22.04 physical server via MAAS adding it as KVM host
2. Configured a volume group named vg_os and added it as a KVM logical pool storage so it can be used to create my VM disk devices in it

<pool type='logical'>
  <name>vg_os</name>
  <uuid>xxxxx</uuid>
  <capacity unit='bytes'>3356915400704</capacity>
  <allocation unit='bytes'>68719476736</allocation>
  <available unit='bytes'>3288195923968</available>
  <source>
    <name>vg_os</name>
    <format type='lvm2'/>
  </source>
  <target>
    <path>/dev/vg_os</path>
  </target>
</pool>

3. Refreshed pod from console and can see my vg_os available in MAAS
4. When composing (via API or console):
   - i can see a logical being created in vg_os and the associate volume (virsh vol-list vg_os)
   - domain creation suceeds but later maas tries to attach volumes and fails

Pod unable to compose machine: Unable to compose machine because: Failed talking to pod: Unable to compose test22: Virsh command ['start', '--paused', 'test22'] failed: Failed to start domain test22 error: internal error: qemu unexpectedly closed the monitor: 2022-12-12T14:15:43.356030Z qemu-system-x86_64: -blockdev {"driver":"file","filename":"/dev/vg_os/7ea03407-bdec-4803-8255-d9acc3a7a99c","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}: 'file' driver requires '/dev/vg_os/7ea03407-bdec-4803-8255-d9acc3a7a99c' to be a regular file

This works fine if KVM is running Ubuntu 20.04.

I found that QEMU introduced a breaking change in QEMU 6.0 as stated
in https://gitlab.com/libvirt/libvirt/-/issues/212

"This seems to be a breaking change introduced in QEMU 6.0, as changelog says the following: The file block driver no longer permits use with block devices. Downgrading to QEMU 5.2 allows for domain to successfully boot up.
Judging from current documentation, in order to pass a block device, you have to use raw block driver instead."

Looking at /snap/maas/current/lib/python3.8/site-packages/provisioningserver/drivers/pod/virsh.py (from snap 3.2.6-12016-g.19812b4da - 3.2-stable), i can see maas enforces file driver usage which was working for earlier version of QEMU:

 def attach_local_volume(self, domain, pool, volume, device):
        """Attach `volume` in `pool` to `domain` as `device`."""
        vol_path = self.get_volume_path(pool, volume)
        serial = os.path.basename(vol_path)
        self.run(
            [
                "attach-disk",
                domain,
                vol_path,
                device,
                "--targetbus",
                "virtio",
                "--sourcetype",
                "file",
                "--config",
                "--serial",
                serial,
            ]
        )

Bill Wear (billwear)
Changed in maas:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Adam Collard (adam-collard) wrote :

Let's figure out how we need to adapt the QEMU commands to work with QEMU and libvirt in Jammy

Changed in maas:
milestone: none → 3.5.0
Changed in maas:
milestone: 3.5.0 → 3.5.x
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.