Bug 47956 - Adding drives to VMs fails if there's no vda device
Adding drives to VMs fails if there's no vda device
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Virtualization - UVMM
UCS 4.3
Other Linux
: P5 normal (vote)
: UCS 4.3-2-errata
Assigned To: Philipp Hahn
Erik Damrose
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-10-11 11:34 CEST by Valentin Heidelberger
Modified: 2018-12-05 14:39 CET (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.137
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted after Product Owner Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
VM config with reproduceable IDE device (2.60 KB, text/xml)
2018-11-27 17:34 CET, Erik Damrose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Valentin Heidelberger univentionstaff 2018-10-11 11:34:59 CEST
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'
Comment 1 Valentin Heidelberger univentionstaff 2018-10-11 12:30:46 CEST
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?
Comment 2 Philipp Hahn univentionstaff 2018-11-27 12:44:38 CET
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(-)
Comment 3 Erik Damrose univentionstaff 2018-11-27 17:34:38 CET
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
Comment 4 Philipp Hahn univentionstaff 2018-11-28 11:32:28 CET
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(-)
Comment 5 Erik Damrose univentionstaff 2018-11-28 13:23:44 CET
Reopen: As discussed, i can still reproduce the error
Comment 6 Philipp Hahn univentionstaff 2018-11-28 15:47:57 CET
[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
Comment 7 Erik Damrose univentionstaff 2018-11-28 16:07:47 CET
Verified: I could not produce a manually modified config that caused an error in UVMM when adding and removing additional disks and drives
Comment 8 Arvid Requate univentionstaff 2018-12-05 14:39:21 CET
<http://errata.software-univention.de/ucs/4.3/346.html>