[CentOS] KVM, virsh attach-disk error

Sat Apr 23 09:19:20 UTC 2011
Jussi Hirvi <listmember at greenspot.fi>

Now I could attach a disk to the KVM guest, using a virtio driver:

> [root at 113 info]# virsh attach-disk test1 /dev/sdd1 vdb
> --driver virtio --mode shareable
 > Disk attached successfully

I have not seen any mention anywhere about using virtio drivers like this.

Here /dev/sdd is a separate disk, not used directly by either kvm host 
or guests. Before the operation, sdd1 was created with fdisk as a Linux 
partition. After the operation, I did mkfs.ext3 on the guest and then 
mounted the new filesystem.

But the Bonnie benchmark results for the KVM guest are not promising - 
they are about the same for the new external partition and for the 
guest's native filesystem.

Reads are in fact much slower on the external partition (27500 vs. 70000 
k/s). (CPU load 4 vs. 12 %.)
Writes are faster (121000 vs 98000 k/s).  (CPU load 12 vs. 10 %.)

If these results are weighed with the cpu load, the differences even out.

Maybe the evennes is because the external partition is used with virtio 
drivers, same as the guest's native disk image.

So why bother? I think I will give each guest one disk image to run on, 
and that's it. Unless I find a better way to attach partitions to guests.

- Jussi

-- 
Jussi Hirvi * Green Spot
Suvilahdenkatu 1 B 78 * 00500 Helsinki * Finland
Tel. +358 9 493 981 * Mobile +358 40 771 2098 (only sms)
jussi.hirvi at greenspot.fi * http://www.greenspot.fi