Bug 693372
Summary: | [RHEL6.0] "virsh attach-device" doesn't attach a device with a specified name. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | asilva <asilva> |
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
Status: | CLOSED NOTABUG | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.0 | CC: | ajia, dallan, dyuan, eblake, jmunilla, skito, weizhan |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-06-02 21:12:22 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: | |||
Bug Depends On: | |||
Bug Blocks: | 658636 |
Description
asilva
2011-04-04 13:20:48 UTC
Step1:
host# virsh attach-disk rhel6-x86-64 /dev/sdb1 vdd
Disk attached successfully
Step2:
> additional information
guest# ls /dev/vd*
/dev/vda
Log:
10:21:00.139: debug : qemuDomainPCIAddressSetNextAddr:2278 : PCI addr 0:0:0 already in use
10:21:00.139: debug : qemuDomainPCIAddressSetNextAddr:2278 : PCI addr 0:0:1 already in use
10:21:00.139: debug : qemuDomainPCIAddressSetNextAddr:2278 : PCI addr 0:0:2 already in use
10:21:00.139: debug : qemuDomainPCIAddressSetNextAddr:2278 : PCI addr 0:0:3 already in use
10:21:00.139: debug : qemuDomainPCIAddressSetNextAddr:2278 : PCI addr 0:0:4 already in use
10:21:00.139: debug : qemuDomainPCIAddressSetNextAddr:2278 : PCI addr 0:0:5 already in use
10:21:00.139: debug : qemuDomainPCIAddressSetNextAddr:2283 : Allocating PCI addr 0:0:6
10:21:00.139: debug : qemuMonitorAddDrive:1897 : mon=0x7ff5ec0015f0 drive=file=/dev/sdb1,if=none,id=drive-virtio-disk3,format=raw
...
10:21:00.147: debug : virJSONValueToString:1059 : result={"execute":"device_add","arguments":{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x6","drive":"drive-virtio-disk3","id":"virtio-disk3"}}
Additional Note: 1. When a device is detached, index of vd* is not decremented. This causes vd* keeps incremented when you attach a device. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=692767 I already verified the fix with an attached patch. 2. When <target> is specified in virsh, for example, virsh attach-disk <domain> <source> <target>, simply gets omitted. We see the same result with "attach-device". http://libvirt.org/formatdomain.html#elementsDisks [target] The target element controls the bus / device under which the disk is exposed to the guest OS. The dev attribute indicates the "logical" device name. The actual device name specified is not guaranteed to map to the device name in the guest OS. Treat it as a device ordering hint. The optional bus attribute specifies the type of disk device to emulate; possible values are driver specific, with typical values being "ide", "scsi", "virtio", "xen" or "usb". If omitted, the bus type is inferred from the style of the device name. eg, a device named 'sda' will typically be exported using a SCSI bus. Since 0.0.3; bus attribute since 0.4.3; "usb" attribute value since after 0.4.4 As you can see from the above link, "target" is used just as a hint, assigning specific device names in kernel layer is not a common approach, and it would be better to assign names via userland such as udev. Engineering, please let us know how you are going to fix this issue. Updating man page, and/or, disabling target option, or something else? Per the documentation you quoted, this functionality is working as designed: "The actual device name specified is not guaranteed to map to the device name in the guest OS." Given that we've already documented that it's not guaranteed to be honored, there's nothing more we can do here. Device naming in the guest is dependent on the guest OS. |