[libvirt] How to get the real device in guest os after attached a disk?
hzwangpan at corp.netease.com
Wed Jul 18 04:01:11 UTC 2012
But how can I get the serial info in the guest os?
I have tried 'hdparm', 'sdparm', 'lshw', 'smartctl' and failed finally.
root at debian:~# hdparm -i /dev/vdc
HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
HDIO_GET_IDENTITY failed: Inappropriate ioctl for device
The XML be attached is:
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<target dev='vdc' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
The kernel info:
root at debian:~# uname -a
Linux debian 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64 GNU/Linux
>On Tue, Jul 17, 2012 at 4:40 AM, Wangpan <hzwangpan at corp.netease.com> wrote:
>> I have a question as the subject above, the reason I want to know this is that, if I attach some disks on the guest,
>> for example, I specified /dev/vdc&/dev/vdd(target device) at the cmd line by using 'virsh attach-disk', but they may be /dev/vdb&/dev/vdc in the guest os,
>> so if the guest user want to detach the /dev/vdb(guest device), he\she will be confused with the two target devices /dev/vdb&/dev/vdc,
>> because he\she doesn't know the corresponding relation of the guest device and target device,
>> he\she may detach an error device /dev/vdd(target device) which corresponding to /dev/vdc(guest device).
>> Could anyone give me some idea?
>You can use the virtio-blk serial or file system/volume labels to
>For libvirt disk <serial> information, see the Domain XML documentation:
More information about the libvir-list