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.
Bug 658713 - virsh attach-disk --persistent unsupported on kvm
Summary: virsh attach-disk --persistent unsupported on kvm
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-01 03:36 UTC by Eric Blake
Modified: 2018-11-28 21:42 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.9.2-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 10:52:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1513 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-12-06 01:23:30 UTC

Description Eric Blake 2010-12-01 03:36:24 UTC
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:

Comment 2 Suzanne Logcher 2011-03-28 21:14:59 UTC
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.

Comment 4 Eric Blake 2011-06-20 16:43:36 UTC
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>

Comment 5 Daniel Veillard 2011-06-23 02:41:09 UTC
This should be fixed by the libvirt-0.9.2-1.el6 rebase

Comment 8 Huang Wenlong 2011-06-23 06:12:14 UTC
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

Comment 10 Rita Wu 2011-07-06 10:28:39 UTC
Set it as VERIFIED per comment8

Comment 11 errata-xmlrpc 2011-12-06 10:52:53 UTC
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


Note You need to log in before you can comment on or make changes to this bug.