CentOS5.4ã§virtioã«åãæ¿ãã
- ç°å¢
# uname -a Linux mio 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009 i686 i686 i386 GNU/Linux ã²ã¹ãã¯rawãã¡ã¤ã«ã®CentOS5.4 ãã¹ãã¯ubuntu10.4 2.6.32-23-generic
- å¤æ´å hdparm -t /dev/hda
/dev/hda: Timing buffered disk reads: 202 MB in 3.02 seconds = 66.93 MB/sec
- å¤æ´æ¹æ³
// -------- // GUEST㸠// -------- // ããããã«è¿½å .alias scsi_hostadapter ata_piixã¯æ¸ãã¦ãã£ãã # echo "alias scsi_hostadapter1 virtio_blk" >> /etc/modprobe.conf // ããããã°ã¢ã¸ã¥ã¼ã«ããã®ï¼ # find /lib/modules/`uname -r` -name "virtio_blk*" /lib/modules/2.6.18-164.el5/kernel/drivers/block/virtio_blk.ko // ãªãã®ããã±ã¼ã¸ã«å±ããã®ï¼ -> ãã¼ããã ã£ãã # rpm -qf /lib/modules/2.6.18-164.el5/kernel/drivers/block/virtio_blk.ko kernel-2.6.18-164.el5 // ã³ãã¼ # cp -a initrd-$(uname -r).img{,.org} // ã³ãã³ãç¢ºèª # echo "mkinitrd --with=virtio_pci --with=virtio_blk -v -f initrd-$(uname -r).img $(uname -r)" mkinitrd --with=virtio_pci --with=virtio_blk -v -f initrd-2.6.18-164.el5.img 2.6.18-164.el5 # mkinitrd --with=virtio_pci --with=virtio_blk -v -f initrd-$(uname -r).img $(uname -r) ... Adding module dm-log Adding module dm-mirror Adding module dm-zero Adding module dm-snapshot Adding module dm-mem-cache Adding module dm-region_hash Adding module dm-message Adding module dm-raid45 Adding module virtio_ring Adding module virtio_pci // ã©ããããã¾ããã£ãã¿ããã # echo $? 0 // -------- // HOST㸠// -------- # cd /etc/libvirt/qemu/ # diff -Naur mio.xml{.o,} --- mio.xml.o 2010-01-17 17:45:16.503831412 +0900 +++ mio.xml 2010-07-07 19:26:46.241525705 +0900 @@ -21,7 +21,7 @@ <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <source file='/home2/centos.img'/> - <target dev='hda' bus='ide'/> + <target dev='vda' bus='virtio'/> </disk> # virsh shutdown mio // è¨å®åæ # service libvirt-bin stop libvirt-bin stop/waiting # service libvirt-bin status libvirt-bin stop/waiting # service libvirt-bin start libvirt-bin start/running, process 2846 // GUEST èµ·å # virsh start mio // ããã¤ã¹ãã¡ã¤ã«ã hda -> vda ã«ãªã£ã¦ããæå
- å¤æ´å¾ hdparm -t /dev/vda
/dev/vda: Timing buffered disk reads: 310 MB in 3.00 seconds = 103.29 MB/sec HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device
ã»66.93 MB/sec -> 103.29 MB/sec æ©ããªã£ãï¼