problem
Multi-CD-ROM support makes the KVM agent pre-allocate several CD-ROM drives at the device seqs starting at CDROM_PRIMARY_DEVICE_SEQ. VolumeApiServiceImpl.getDeviceId() and the unmanaged-VM import still reserve only the primary CD-ROM seq, from the single-CD-ROM layout. A data disk can therefore be assigned the same device seq as one of the additional CD-ROM slots. When both devices get the same sd* label (a SATA CD-ROM on UEFI VMs plus SATA/SCSI data disks), the domain XML ends up with two devices on one target. The CD-ROM count is not fixed and there is no per-VM limit on it, so any slot beyond the primary one can conflict.
...
<target dev='sdc' bus='scsi'/>
<serial>d92a661ed0934cd587b8</serial>
</disk>
<disk device='cdrom' type='file'>
<driver name='qemu' type='raw' />
<source file=''/>
<target dev='sdd' bus='sata'/>
</disk>
<disk device='disk' type='file'>
<driver name='qemu' type='qcow2' cache='none' discard='unmap' />
<source file='/mnt/f53286ae-f882-3b10-9142-0992be9ce77d/3f1b719d-d9d4-49dd-b2a9-b3c01e0c695c'/>
<target dev='sde' bus='scsi'/>
<serial>3f1b719dd9d449ddb2a9</serial>
</disk>
<disk device='disk' type='file'>
<driver name='qemu' type='qcow2' cache='none' discard='unmap' />
<source file='/mnt/f53286ae-f882-3b10-9142-0992be9ce77d/c23f9dd4-84cb-4061-8be3-6489536a4794'/>
<target dev='sdf' bus='scsi'/>
<serial>c23f9dd484cb40618be3</serial>
</disk>
<disk device='cdrom' type='file'>
<driver name='qemu' type='raw' />
<source file=''/>
<target dev='sde' bus='sata'/>
</disk>
...
The same target name appears twice, once for a data volume and once for an empty pre-allocated CD-ROM.
BIOS VMs with an IDE CD-ROM (hd*) and virtio data disks (vd*) don't show the problem.
versions
4.23+
The steps to reproduce the bug
- Deploy a VM with bootype UEFI and attach enough data disks that auto-allocation reaches a device seq used by an extra CD-ROM slot. (say 3 data disks)
- Start the VM and check virsh dumpxml.
What to do about it?
no data disk shares a device seq with a pre-allocated CD-ROM slot.
problem
Multi-CD-ROM support makes the KVM agent pre-allocate several CD-ROM drives at the device seqs starting at CDROM_PRIMARY_DEVICE_SEQ. VolumeApiServiceImpl.getDeviceId() and the unmanaged-VM import still reserve only the primary CD-ROM seq, from the single-CD-ROM layout. A data disk can therefore be assigned the same device seq as one of the additional CD-ROM slots. When both devices get the same sd* label (a SATA CD-ROM on UEFI VMs plus SATA/SCSI data disks), the domain XML ends up with two devices on one target. The CD-ROM count is not fixed and there is no per-VM limit on it, so any slot beyond the primary one can conflict.
The same target name appears twice, once for a data volume and once for an empty pre-allocated CD-ROM.
BIOS VMs with an IDE CD-ROM (hd*) and virtio data disks (vd*) don't show the problem.
versions
4.23+
The steps to reproduce the bug
What to do about it?
no data disk shares a device seq with a pre-allocated CD-ROM slot.