Description of problem:
When adding hardware(type storage) for a running guest by using virt-manager manually, it will pop-up a dialog box said "This device could not be attached to the running machine. Would you like to make the device available after the next VM shutdown?" which means that it does not support hotplug. It includes on adding IDE disk, IDE cdrom, Floppy disk, usb, virto disk, SCSI.
Now libvirt supports hotplug.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
This is on IDE cdrom adding. The others are similar
1.Launch virt-manager: #virt-manager
2.Double-click a vm and click the Run button in the Virtual Machine Details window.
3.Click the Hardware tab.
4.Click Add Hardware button
5.Select Storage in Hardware type droplist and click Forward.
6.Select managed or other existing storage and then click Browse to find a iso.
7.Select IDE cdrom in Device type then click Forward.
8.Click Finish button.
1. After step8, a dialog box pup-up to tell you that the device could not be attached to the running machine until next reboot.
1. After step8, new virtual disk is added and can be used well in the guest.
Can you provide ~/.virt-manager/virt-manager.log or reproduce running with the --debug flag?
Certain disk types can't hotplug AIUI (like IDE, Floppy device, ...). At least virtio and USB should work. virt-manager doesn't really care though, it will always attempt a hotplug and only show that 'attach after reboot' dialog if the hotplug failed. The log should show us the relevant hotplug failure errors.
We should probably show a little 'details' expander if the hotplug fails so the user can see an error message though.
The ~/.virt-manager/virt-manager.log is as follow on usb adding:
[Tue, 13 Jul 2010 09:44:46 virt-manager 4733] DEBUG (addhardware:1060) Starting background file allocate process
[Tue, 13 Jul 2010 09:44:46 virt-manager 4733] DEBUG (addhardware:1062) Allocation completed
[Tue, 13 Jul 2010 09:44:46 virt-manager 4733] DEBUG (addhardware:1022) Adding device:
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<target dev='sda' bus='usb'/>
[Tue, 13 Jul 2010 09:44:46 virt-manager 4733] DEBUG (addhardware:1029) Device could not be hotplugged: internal error unable to execute QEMU command 'drive_add': The command drive_add has not been found
It is similar with virto disk adding.
I find the similar bug 573946 about virtio hotplug on libvirt, I think the usb hotplug also has the same problem. As Cole said that there should be an error show to us when hotplug failed, but it doesn't have now.
Okay, not a critical RFE then. Moving to 6.1
Does the 'dev' in summary involve the cpu ? I found the same issue on cpu hotplug with a libvirt Bug 573597.
It can. Changing the desc.
what about the scsi hotplug? Should it be supported?
SCSI isn't supported for RHEL6 AFAIU.
Fixed in virt-manager-0.8.6-1.el6
Verified with passed in virt-manager-0.8.6-1.el6
# uname -a
Linux dhcp-65-85.nay.redhat.com 2.6.32-99.el6.x86_64 #1 SMP Fri Jan 14 10:46:00
EST 2011 x86_64 x86_64 x86_64 GNU/Linux
Now virtio disk can support hotplug/unplug in virt-manager.Others like IDE,IDE-CDROM, Floppy will display error message when hotplug/unplug as following:
** Error message for hotplug with disk type as IDE-CDROM **
This device could not be attached to the running machine. Would you like to make the device available after the next VM shutdown?
internal error No device with bus 'ide' and target 'hdc'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/addhardware.py", line 911, in add_device
File "/usr/share/virt-manager/virtManager/domain.py", line 1159, in attach_device
File "/usr/lib64/python2.6/site-packages/libvirt.py", line 263, in attachDevice
if ret == -1: raise libvirtError ('virDomainAttachDevice() failed', dom=self)
libvirtError: internal error No device with bus 'ide' and target 'hdc'
** Error message for hotunplug disk type as IDE-CDROM **
Device could not be removed from the running machine
This change will take effect after the next VM reboot.
unsupported configuration: This type of device cannot be hot unplugged
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/details.py", line 1776, in remove_device
File "/usr/share/virt-manager/virtManager/domain.py", line 1169, in detach_device
File "/usr/lib64/python2.6/site-packages/libvirt.py", line 353, in detachDevice
if ret == -1: raise libvirtError ('virDomainDetachDevice() failed', dom=self)
libvirtError: unsupported configuration: This type of device cannot be hot unplugged
Verified this bug passed with virt-manager-0.8.6-3.el6
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.