Bug 23394 - CDROM-/DVD ISO Images im laufenden Betrieb der VM austauschen (Xen tapdisk2)
CDROM-/DVD ISO Images im laufenden Betrieb der VM austauschen (Xen tapdisk2)
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Virtualization - Xen
UCS 2.4
Other Linux
: P5 enhancement (vote)
: UCS 3.1-1-errata
Assigned To: Philipp Hahn
Felix Botner
:
: 27898 (view as bug list)
Depends on: 21763
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-22 11:15 CEST by Philipp Hahn
Modified: 2016-04-01 10:52 CEST (History)
7 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Ticket number:
Bug group (optional): Release Goal
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2011-08-22 11:15:04 CEST
+++ This bug was initially created as a clone of Bug #21763 +++

Wunsch eines Premium-Partners nach dem Austausch von CDROM-/DVD ISO Images im
laufenden Betrieb einer VM in UVMM. Das geht bei VMware.

In Bug #21763 wurde das für KVM umgesetzt, allerdings funktioniert das nicht mit Xen, wenn tapdisk2 verwendet wird:

# virsh update-device --persistent "$VM" /dev/stdin <<<"<disk type='file' device='cdrom'><target dev='hdb' bus='ide'/><readonly/><source file='/var/lib/libvirt/images/debian-6.0.1a-i386-netinst.iso'/></disk>"

Fehler: Failed to update device from /dev/stdin
Fehler: POST operation failed: xend_post: error from xen daemon: (xend.err 'Device 832 not connected')

# tail /var/log/xen/xend.log
[2011-08-22 10:28:04 5160] ERROR (SrvBase:88) Request device_configure failed.
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/xen/web/SrvBase.py", line 85, in perform
    return op_method(op, req)
  File "/usr/lib/python2.5/site-packages/xen/xend/server/SrvDomain.py", line 202, in op_device_configure
    req)
  File "/usr/lib/python2.5/site-packages/xen/xend/server/SrvDomain.py", line 172, in call
    return FormFn(fn, args)(req.args)
  File "/usr/lib/python2.5/site-packages/xen/xend/Args.py", line 166, in __call__
    return self.call_with_form_args(self.fn, fargs, xargs=xargs)
  File "/usr/lib/python2.5/site-packages/xen/xend/Args.py", line 138, in call_with_form_args
    return fn(*params, **keys)
  File "/usr/lib/python2.5/site-packages/xen/xend/XendDomainInfo.py", line 1218, in device_configure
    raise VmError("Device %s not connected" % devid)
VmError: Device 832 not connected

Bei dem System handelte es sich um ein "Xen-4.0.1" System, das Problem trat aber auch mit Xen-3.4 auf:

# tail /var/log/xen/xend.log
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/xen/web/SrvBase.py", line 85, in perform
    return op_method(op, req)
  File "/usr/lib/python2.5/site-packages/xen/xend/server/SrvDomain.py", line 201, in op_device_configure
    req)
  File "/usr/lib/python2.5/site-packages/xen/xend/server/SrvDomain.py", line 171, in call
    return FormFn(fn, args)(req.args)
  File "/usr/lib/python2.5/site-packages/xen/xend/Args.py", line 166, in __call__
    return self.call_with_form_args(self.fn, fargs, xargs=xargs)
  File "/usr/lib/python2.5/site-packages/xen/xend/Args.py", line 138, in call_with_form_args
    return fn(*params, **keys)
  File "/usr/lib/python2.5/site-packages/xen/xend/XendDomainInfo.py", line 1099, in device_configure
    dev_uuid = dev_control.reconfigureDevice(devid, dev_config)
  File "/usr/lib/python2.5/site-packages/xen/xend/server/blkif.py", line 128, in reconfigureDevice
    (dev, mode) = self.readBackend(devid, 'dev', 'mode')
  File "/usr/lib/python2.5/site-packages/xen/xend/server/DevController.py", line 439, in readBackend
    raise VmError("Device %s not connected" % devid)
VmError: Device 832 not connected


Ändert man das Backend von <driver name="tap2" type="aio"/> auf <driver name="file"/>, funktioniert es:
# virsh update-device --persistent "$VM" /dev/stdin <<<"<disk type='file' device='cdrom'><target dev='hdb' bus='ide'/><readonly/><source file='/var/lib/libvirt/images/debian-6.0.1a-i386-netinst.iso'/></disk>"
Device updated successfully
Comment 1 Philipp Hahn univentionstaff 2012-07-12 16:17:25 CEST
*** Bug 27898 has been marked as a duplicate of this bug. ***
Comment 2 Philipp Hahn univentionstaff 2012-11-14 12:32:17 CET
Angefragt an Ticket #2012072721006183
Zusammenfassung von <http://lists.xen.org/archives/html/xen-users/2012-11/msg00069.html>:
1. tapdisk2 unterstützt keinen Medienwechseln und wird das auch nie tun.
2. Für CDROMs wird file:// empfohlen, was von qemu-dm direkt geöffnet wird. Damit tut auch der Medienwechseln.
3. Offen ist noch die Problematik der benötigten loopback-Devices in der dom0, dier aber nicht benötigt werden, weil bei HV-Domains CDROMs gar nicht über xen-blockfront möglich ist → Bug #28950
Comment 3 Philipp Hahn univentionstaff 2012-11-26 16:47:16 CET
Ungetestet.

diff --git a/branches/ucs-2.4/ucs/virtualization/univention-virtual-machine-manager-daemon/umc/modules/univention/management/console/handlers/uvmm/wizards.py b/branches/ucs-2.4/ucs/virtualization/univention-virtual-machine-manager-daemon/umc/modules/univention/management/console/handlers/uvmm/wizards.py
index 1cb8a32..2b580fd 100644
--- a/branches/ucs-2.4/ucs/virtualization/univention-virtual-machine-manager-daemon/umc/modules/univention/management/console/handlers/uvmm/wizards.py
+++ b/branches/ucs-2.4/ucs/virtualization/univention-virtual-machine-manager-daemon/umc/modules/univention/management/console/handlers/uvmm/wizards.py
@@ -615,7 +615,7 @@ class DriveWizard( umcd.IWizard ):
 				configRegistry = ucr.ConfigRegistry()
 				configRegistry.load()
 				# Use tapdisk2 by default, but not for empty CDROM drives
-				if r.vol_path is not None and configRegistry.is_true('uvmm/xen/images/tap2', True):
+				if r.vol_path is not None and configRegistry.is_true('uvmm/xen/images/tap2', True) and r.drive_type == 'disk':
 					disk.driver = 'tap2'
 					if r.driver_type == 'raw':
 						disk.driver_type = 'aio'
Comment 4 Philipp Hahn univentionstaff 2013-05-24 20:34:26 CEST
Xen-Bug: The function to change the media is called with a *string*, but internally the value is stored as an *integr*:
XendDomainInfo:1176 devid='768'
XendDomainInfo:1433 dev=768

/usr/lib/python2.6/dist-packages/xen/xend/server/SrvDomain.py:
    def op_device_configure(self, _, req):
        return self.call(self.dom.device_configure,
                         [['config', 'sxpr'],
                          ['dev',    'str']],
                         req)

A similar bug was fixed 2007 in deviceDestory:
<http://lists.xen.org/archives/html/xen-devel/2007-08/msg00038.html>

Patch send upstream: <http://lists.xen.org/archives/html/xen-devel/2013-05/msg02478.html>
Similar report: <https://bugzilla.novell.com/show_bug.cgi?id=288460>
Comment 5 Philipp Hahn univentionstaff 2013-05-26 20:59:33 CEST
UCS-3.1-2:
  xen-4.1_4.1.3-11.33.201305262031
  univention-xen_4.0.1-1.65.201305262029
  univention-virtual-machine-manager-daemon_2.0.40-1.444.201305262039
  svn40846
  \item CD-ROM media changes is now also supported with Xen-HVM domains (\ucsBug{23394}).
Comment 6 Philipp Hahn univentionstaff 2013-05-27 14:25:32 CEST
errata3.1-1:
  Backport: svn40866..40890

  univention-virtual-machine-manager-daemon_2.0.36-7.445.201305271400
  univention-xen_4.0.0-4.66.201305271359
  xen-4.1_4.1.3-9+1.34.201305271402

  yaml: r40895
   ucs-3.1-1/doc/errata/2013-05-27-univention-virtual-machine-manager-daemon.yaml
   ucs-3.1-1/doc/errata/2013-05-27-univention-xen.yaml
   ucs-3.1-1/doc/errata/2013-05-27-xen-4.1.yaml
Comment 7 Philipp Hahn univentionstaff 2013-05-29 15:38:55 CEST
svn41042: version number changed to 4.1.3-10~1 
§ dpkg --compare-versions 4.1.3-9.31.201305101308  lt 4.1.3-10~1 ; echo $?
0
$ dpkg --compare-versions 4.1.3-10~1 lt 4.1.3-10; echo $?
0

svn41044: 2013-05-27-xen-4.1.yaml updated
Comment 8 Felix Botner univentionstaff 2013-05-30 09:40:19 CEST
Tested with HVM UCS and Windows

OK - errata3.1-1
OK - yaml

OK - ucs3.1-2
OK - changelog
Comment 9 Janek Walkenhorst univentionstaff 2013-06-13 14:38:03 CEST
http://errata.univention.de/ucs/3.1/125.html
Comment 10 Janek Walkenhorst univentionstaff 2013-06-13 14:39:02 CEST
http://errata.univention.de/ucs/3.1/126.html
Comment 11 Janek Walkenhorst univentionstaff 2013-06-13 14:39:20 CEST
http://errata.univention.de/ucs/3.1/127.html
Comment 12 Philipp Hahn univentionstaff 2016-04-01 10:52:01 CEST
(In reply to Philipp Hahn from comment #4)
> Patch send upstream:
> <http://lists.xen.org/archives/html/xen-devel/2013-05/msg02478.html>

Wrong URL; correct one is
<http://lists.xen.org/archives/html/xen-devel/2013-05/msg02496.html>