Description of problem: A e.g. CDROM needs to be connected to a VM before it can be changed using change-media. If no CDROM (source file) is connected then any change-media call will have no effect and virsh doesn't even complain about it! Version-Release number of selected component (if applicable): How reproducible: always Steps to Reproduce: 1. Define a VM with a ide cdrom but no connected file 2. use virsh --connect='qemu:///system' change-media dom-abc --path hdc --source /whatever/iso --force (with or without force) 3. Actual results: The cdrom file doesn't change Expected results: The cdrom file is changed Additional info:
I suppose virt-managre works because it's using it's own change-media thingy. ...
I can get this working by assigning a dummy file as a source to a fresh VM initially, but this is not very nice and I haven't got this possibility in my scenario. So does someone maybe know a workaround?
Did you try it with specifying the "--insert" flag along with others you tried?
Hey Peter, yes I did, I tried several combinations, let me list them: $ sudo virsh --connect='qemu:///system' change-media --domain default-i-i2FFoKDTc2 --path hdc --source /var/tmp/igor/boot.iso --insert succeeded to complete action insert on media $ sudo virsh --connect='qemu:///system' change-media --domain default-i-i2FFoKDTc2 --path hdc --source /var/tmp/igor/boot.iso --insert --force succeeded to complete action insert on media $ sudo virsh --connect='qemu:///system' change-media --domain default-i-i2FFoKDTc2 --path hdc --source /var/tmp/igor/boot.iso --update succeeded to complete action update on media $ sudo virsh --connect='qemu:///system' change-media --domain default-i-i2FFoKDTc2 --path hdc --source /var/tmp/igor/boot.iso --update --force succeeded to complete action update on media $ sudo virsh --connect='qemu:///system' change-media --domain default-i-i2FFoKDTc2 --path hdc --source /var/tmp/igor/boot.iso --live succeeded to complete action update on media $ sudo virsh --connect='qemu:///system' change-media --domain default-i-i2FFoKDTc2 --path hdc --source /var/tmp/igor/boot.iso --live --force succeeded to complete action update on media But the media never changed
Any news or hints on this?
This seems to be a bug in the qemu driver or qemu. We will need to investigate this further.
Hey Peter, I suppose the problem was that i created a block device: <disk type='block' device='cdrom'> <driver name='qemu' type='raw'/> <target dev='hdc' bus='ide' tray='open'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> </disk> it works when using type='file'
This is fixed upstream, but needs backport to F18 and F19: commit 7729a16814d5bf3aebd248c9af00296ae2773818 Author: Guannan Ren <gren> Date: Mon Jul 22 15:38:43 2013 +0800 virsh: fix change-media bug on disk block type Resolves:https://bugzilla.redhat.com/show_bug.cgi?id=923053 When cdrom is block type, the virsh change-media failed to insert source info because virsh uses "<source block='/dev/sdb'/>" while the correct name of the attribute for block disks is "dev".
Thanks for this update. I'm looking forward to this change!
libvirt-0.10.2.8-1.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/libvirt-0.10.2.8-1.fc18
Package libvirt-0.10.2.8-1.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing libvirt-0.10.2.8-1.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-17305/libvirt-0.10.2.8-1.fc18 then log in and leave karma (feedback).
libvirt-0.10.2.8-1.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.