Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
The only way to persistently add a disk to a qemu-kvm guest is to manually edit the xml, since qemudDomainAttachDeviceFlags rejects VIR_DOMAIN_DEVICE_MODIFY_CONFIG.
Version-Release number of selected component (if applicable):
libvirt-0.8.1-27.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
[root@ntc164 utils]# qemu-img create /var/lib/libvirt/images/KVM-Guest-2.img 8G
Formatting '/var/lib/libvirt/images/KVM-Guest-2.img', fmt=raw, size=8388608 kB
[root@ntc164 utils]# virsh attach-disk KVM-Guest-1 /var/lib/libvirt/images/KVM-Guest-2.img hdb
error: Failed to attach disk
error: this function is not supported by the connection driver: disk bus 'ide' cannot be hotplugged.
[root@ntc164 utils]# virsh destroy KVM-Guest-1
Domain KVM-Guest-1 destroyed
[root@ntc164 utils]# virsh attach-disk KVM-Guest-1 /var/lib/libvirt/images/KVM-Guest-2.img hdb
error: Failed to attach disk
error: Requested operation is not valid: cannot attach device on inactive domain
[root@ntc164 utils]# virsh attach-disk KVM-Guest-1 /var/lib/libvirt/images/KVM-Guest-2.img hdb --type disk --driver qemu --subdriver raw --mode readonly
error: No support for qemu in command 'attach-disk'
Actual results:
All attempts to use virsh shorthand fail; the only way to add the device is through 'virsh edit' or other full xml editing.
Expected results:
virsh attach-disk --persistent should avoid the need for a manual xml edit
Additional info:
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as an
exception or blocker.
Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.
Fixed upstream (and therefore will be picked up by rebase); upstream patch series includes:
commit f37c29c8aa32390c68eb79614d69c2bc7f6d5e8f
Author: KAMEZAWA Hiroyuki <kamezawa.hiroyu.com>
Date: Fri Apr 22 12:10:28 2011 +0900
libvirt/qemu - support persistent update of disks
Support update of disks by MODIFY_CONFIG
This patch includes changes for qemu's disk to support
virDomainUpdateDeviceFlags() with VIR_DOMAIN_DEVICE_MODIFY_CONFIG.
This patch adds support for CDROM/foppy disk types.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu.com>
Version-Release number of selected component:
libvirt-0.9.2-1.el6.x86_64
qemu-kvm-0.12.1.2-2.165.el6.x86_64
kernel-2.6.32-156.el6.x86_64
Test steps :
1)qemu-img create /var/lib/libvirt/images/test-disk.img 8G
2)When the guest is active ,run the command
#virsh attach-disk fedora14 /var/lib/libvirt/images/test-disk.img vdb --persistent
error: Failed to attach disk
error: operation failed: drive hotplug is not supported
3)destroy the guest
# virsh destroy fedora14
3)When the guest is inactive ,run the command
# virsh attach-disk fedora14 /var/lib/libvirt/images/test-disk.img vdb
error: Failed to attach disk
error: Requested operation is not valid: cannot do live update a device on inactive domain
4)add --persistent option
# virsh attach-disk fedora14 /var/lib/libvirt/images/test-disk.img vdb --persistent
Disk attached successfully
So the --persistent is effective
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2011-1513.html