O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To change the I/O scheduler on the host and the KVM instance and set an I/O weight, perform the following steps:

  1. On the host OS, list the I/O scheduler currently in use, substituting the block device with whatever is appropriate for your system:
root@kvm:~# cat /sys/block/sda/queue/schedulernoop deadline [cfq]root@kvm:~#
  1. Change the I/O scheduler on demand and ensure it is in use by running:
root@kvm:~# echo deadline > /sys/block/sda/queue/schedulerroot@kvm:~# cat /sys/block/sda/queue/schedulernoop [deadline] cfqroot@kvm:~#
  1. To make the change persistent across server restarts, add the following line to the GRUB default configuration and update:
root@kvm:~# echo 'GRUB_CMDLINE_LINUX="elevator=deadline"' >> /etc/default/grub ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required