Bug 662908
| Summary: | virsh attach-disk doesn't work well for xenpv guest | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | koka xiong <kxiong> |
| Component: | libvirt | Assignee: | Osier Yang <jyang> |
| Status: | CLOSED WONTFIX | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | 5.7 | CC: | berrange, dallan, dyuan, eblake, gren, hjiang, jyang, llim, mjenner, virt-maint, weizhan, xen-maint, yoyzhang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-0.8.2-18.el5 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-06-09 15:36:53 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
koka xiong
2010-12-14 06:42:31 UTC
run virsh attach-disk xenpv /var/lib/xen/foo.img xvdb also output the following error: error: Failed to attach disk error: Requested operation is not valid: Xm driver only supports modifying persistent config Are you sure the guest was still running when you invoked 'attach-disk'? I somewhat suspect it was not, because it it was running this would have been handled by 'XenD' rather than 'Xm'. yes,the guest is running when I invoked attach-disk If I attach the disk by virt-manager,I can attach disk successfully. but by the virsh attach-disk command,it can't work well. so, that should be some problem in virsh, please keep your machine, I'd like to have a look, thanks. - Osier run virsh detach-device rhel5.5 hotplug_nic.xml has the same problem error: Failed to detach device from hotplug_nic.xml error: Requested operation is not valid: Xm driver only supports modifying persistent config Actually attach-device also will be failed sometimes, that's caused by "domainAttachDevice" of "xenDaemonDriver" will be failed, so the code goes on invoking "domainAttachDevice" of "xenXMDriver".
And it's a little surprised that "domainAttachDevice" of "xenDaemonDriver" invokes "reConfigureDevice", attaching device will be failed when it trys
to invoke "reConfigureDevice", and will be success if not. I'm still curious
why it sometime invokes "reConfigureDevice", sometimes not. Will it detect
it later.
[root@dhcp-93-194 ~]# cat /var/log/xen/xend.log
[2010-12-15 08:19:00 xend 4182] DEBUG (blkif:27) exception looking up device number for xvdb: [Errno 2] No such file or directory: '/dev/xvdb'
[2010-12-15 08:19:00 xend 4182] ERROR (SrvBase:88) Request device_configure failed.
Traceback (most recent call last):
File "/usr/lib64/python2.4/site-packages/xen/web/SrvBase.py", line 85, in perform
return op_method(op, req)
File "/usr/lib64/python2.4/site-packages/xen/xend/server/SrvDomain.py", line 186, in op_device_configure
req)
File "/usr/lib64/python2.4/site-packages/xen/xend/server/SrvDomain.py", line 158, in call
return FormFn(fn, args)(req.args)
File "/usr/lib64/python2.4/site-packages/xen/xend/Args.py", line 166, in __call__
return self.call_with_form_args(self.fn, fargs, xargs=xargs)
File "/usr/lib64/python2.4/site-packages/xen/xend/Args.py", line 138, in call_with_form_args
return fn(*params, **keys)
File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2754, in device_configure
self.reconfigureDevice(deviceClass, devid, dev_config)
File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 1526, in reconfigureDevice
return self.getDeviceController(deviceClass).reconfigureDevice(
File "/usr/lib64/python2.4/site-packages/xen/xend/server/blkif.py", line 126, in reconfigureDevice
raise VmError('Refusing to reconfigure device %s:%d to %s' %
VmError: Refusing to reconfigure device vbd:51728 to ['vbd', ['dev', 'xvdb'], ['uname', 'phy:/var/lib/xen/foo.img'], ['mode', 'w']]
if the target device already exists, xend driver will update the existed device config, IMHO this should be prevented, as we already provide "update device" API there. If this idea is fine, I'd like post patch upstream. - Osier patch was posted to upstream 1 month ago: http://www.redhat.com/archives/libvir-list/2010-December/msg00816.html but no feedback, will resend it. patch pushed into upstream: http://www.redhat.com/archives/libvir-list/2011-February/msg00217.html http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-February/msg01075.html patch posted internally. move to POST I test it on libvirt-0.8.2-18.el5 xen-libs-3.0.3-127.el5 xen-3.0.3-127.el5 The problem seems still exist. So I reopen this bug. Could reproduce this bug on the following components of rh5.6: xen-libs-3.0.3-120.el5 kernel-xen-2.6.18-238.el5 libvirt-0.8.2-15.el5 xen-3.0.3-120.el5 Steps: 1.qemu-img create -f raw foo.img 10M Formatting 'foo.img', fmt=raw, size=10240 kB 2.Start a guest 3.#virsh attach-disk a foo.img xvdb --driver tap --subdriver raw --type aio --mode readonly --persistent --sourcetype file error: Failed to attach disk error: Requested operation is not valid: Xm driver only supports modifying persistent config 4.# virsh attach-disk a foo.img xvdb error: Failed to attach disk error: Requested operation is not valid: Xm driver only supports modifying persistent config Osier, this bug still can reproduce this bug on libvirt-0.8.2-20.el5, could you please take a look ? # virsh attach-disk xenpv foo.img xvdb error: Failed to attach disk error: Requested operation is not valid: Xm driver only supports modifying persistent config |