Univention Bugzilla – Bug 47956
Adding drives to VMs fails if there's no vda device
Last modified: 2018-12-05 14:39:21 CET
A customer was unable to add a cd drive to their VM. I can reproduce it on UCS 4.3-2 e270. Internal server error. Server error message: Error defining domain "vheidelb_90": XML error: target 'hda' duplicated for disk sources '/var/lib/libvirt/images/vheidelb_90.qcow2' and '/var/lib/libvirt/images/KVM Windows drivers (virtio 1.1.81).iso' This problem occurs, if there's no drive with device "vda" as target defined. To reproduce: - virsh edit a VM so that there is no drive with "vda" as target device, only "hda" like so: [...] <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/vheidelb_90.qcow2'/> <target dev='hda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> <controller [...] - save XML - open VM in UVMM - add a drive and save - error appears Renaming a target device to vda makes it work again. Also if there's only "vda" and "hdb" as target devices another error appers, when one tries to add a drive via UMC, not sure if such a configuration could ever happen if UVMM is used and the XML isn't edited manually in the first place though. Internal server error. Server error message: Error defining domain "vheidelb_90": unsupported configuration: Found duplicate drive address for disk with target name 'hda' controller='0' bus='0' target='0' unit='0'
The customer had converted the vm affected by this from XEN before by the way. Maybe the migration process does not add a vda target device?
4.3-2] fad60caa20 Bug #47956 uvmm: Fix disk target dev name assignment .../univention-virtual-machine-manager-daemon.yaml | 10 ++ .../debian/changelog | 6 + .../debian/ucslint.overrides | 2 + .../test/test_umc_domain.py | 75 ++++++++++++ .../umc/python/uvmm/domains.py | 131 +++++++++------------ 5 files changed, 147 insertions(+), 77 deletions(-) Package: univention-virtual-machine-manager-daemon Version: 7.0.0-13A~4.3.0.201811271242 Branch: ucs_4.3-0 Scope: errata4.3-2 [4.3-2] c2e6af0e19 Bug #47956: univention-virtual-machine-manager-daemon 7.0.0-13A~4.3.0.201811271242 doc/errata/staging/univention-virtual-machine-manager-daemon.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Created attachment 9759 [details] VM config with reproduceable IDE device As discussed, works great with *v*da devices. I can however reproduce the issue with IDE devices, see attached vm config
Fixed: [4.3-2] 7bef5992f2 Bug #47956: Fix disk target dev name assignment .../univention-virtual-machine-manager-daemon.yaml | 2 +- .../debian/changelog | 6 ++ .../src/univention/uvmm/node.py | 11 ++- .../src/univention/uvmm/protocol.py | 6 +- .../src/univention/uvmm/storage.py | 84 ++++++++++++++++++++++ .../test/{test_umc_domain.py => test_storage2.py} | 21 ++++-- .../umc/python/uvmm/domains.py | 63 ---------------- 7 files changed, 122 insertions(+), 71 deletions(-) Package: univention-virtual-machine-manager-daemon Version: 7.0.0-14A~4.3.0.201811281123 Version: 7.0.0-14A~4.3.0.201811281129 Branch: ucs_4.3-0 Scope: errata4.3-2 [4.3-2] 2cc8ae5f13 Bug #47956: univention-virtual-machine-manager-daemon 7.0.0-14A~4.3.0.201811281129 doc/errata/staging/univention-virtual-machine-manager-daemon.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reopen: As discussed, i can still reproduce the error
[4.3-2] 5e10e60a7d Bug #47956: Fix disk target dev name assignment .../univention-virtual-machine-manager-daemon.yaml | 4 +- .../debian/changelog | 6 +++ .../src/univention/uvmm/node.py | 28 ++++---------- .../src/univention/uvmm/protocol.py | 4 +- .../src/univention/uvmm/storage.py | 44 +++++++++++++++------- .../src/univention/uvmm/xml.py | 41 ++++++++++++++++++++ .../test/test_storage2.py | 17 ++++----- 7 files changed, 96 insertions(+), 48 deletions(-) Package: univention-virtual-machine-manager-daemon Version: 7.0.0-15A~4.3.0.201811281546 Branch: ucs_4.3-0 Scope: errata4.3-2
Verified: I could not produce a manually modified config that caused an error in UVMM when adding and removing additional disks and drives
<http://errata.software-univention.de/ucs/4.3/346.html>