0

I have a trouble with my windows 2008 R2 KVM guest. It write speed to disk extremely slow: enter image description here But on another VM (windows 10) on this KVM host write speed is ok: enter image description here

# cat /etc/system-release
CentOS Linux release 7.1.1503 (Core) 
# virsh -V
Virsh command line tool of libvirt 1.2.8
See web site at http://libvirt.org/

Compiled with support for:
 Hypervisors: QEMU/KVM LXC ESX Test
 Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort
 Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM Gluster
 Miscellaneous: Daemon Nodedev SELinux Secrets Debug DTrace Readline Modular
# qemu-system-x86_64 -version
QEMU emulator version 2.0.0, Copyright (c) 2003-2008 Fabrice Bellard

Slow VM XML configuration:

<domain type='kvm' id='24'>
  <name>SLOW-VM</name>
  <uuid>405f55de-ee46-7d1a-4915-a82b617f5706</uuid>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg/slow-vm'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='block' device='floppy'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg/slow-vm-2'/>
      <backingStore/>
      <target dev='fda' bus='fdc'/>
      <alias name='fdc0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='fdc' index='0'>
      <alias name='fdc0'/>
    </controller>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='yes' listen='127.0.0.1' keymap='en-us'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Another VM XML configuration:

<domain type='kvm' id='21'>
  <name>vm</name>
  <uuid>e48f03ad-aced-452b-9e85-904ee5be61cb</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-1.5'>hvm</type>
    <boot dev='cdrom'/>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>cpu64-rhel6</model>
    <feature policy='require' name='nx'/>
  </cpu>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source dev='/dev/vg/vm'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <backingStore/>
      <target dev='hdd' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <serial type='pty'>
      <source path='/dev/pts/4'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/4'>
      <source path='/dev/pts/4'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5903' autoport='yes' listen='127.0.0.1' keymap='en-us'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

I try to use cache = 'none' and io = 'native' - without result. I try to change emulator and machine type on the slow VM - without result.

lsblk:

sdd                               8:48   0 931.5G  0 disk   
|-sdd1                            8:49   0   500M  0 part   
| `-md0                           9:0    0 499.7M  0 raid1  /boot
`-sdd2                            8:50   0   931G  0 part   
  `-md1                           9:1    0   1.8T  0 raid10 
    |-vg-slowvm                 253:0    0    180G  0 lvm   
    |-vg-vm                     253:13   0    24G  0 lvm 

Where is misconfiguration?

  • Given that one guest works fine and the other doesn't, I'd start by looking at what is different between the guests, not what the host looks like. – womble Nov 27 '15 at 4:11
  • Yes, I understand. different's: - windows 2008R2 vs windows 10 (32 and 64 bit); - cache. I try to change it - without result; - emulator and machine type. I try to change it - without result; – zombi_man Nov 27 '15 at 9:06
1

The problem was on the virtio driver on the slow Windows guest. I have change it to the bus=scsi. + I set on the KVM host profile: virtual-host via adm-tune.

enter image description here

| improve this answer | |
  • 1
    It is very interesting. From my own experience virtio is faster and more reliable that scsi in windows guests. I never used CentOS as host, probably they have a regression in this release. It probably worth submitting a bug report to them... – Nikita Kipriyanov Dec 5 '15 at 17:05
  • VirtIO (passphru) storage access is usually much faster than any of the emulations. The same goes for ethernet devices. So your case is strange at least. That looks like a bug in your guest VirtIO driver. – sam_pan_mariusz Dec 5 '15 at 17:42
  • Yes you are right, usually virtio the fastest, but in this case I think something wrong with virtio driver inside slow VM. As you can see on the other vm (windows 10) I use virtio and write speed faster. I don't now how to delete virtio driver from windows, and fastest solution of the problem was a change bus type. – zombi_man Dec 6 '15 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.