---
# KVM Virtualization 102

**URL:** https://crunchtools.com/kvm-virtualization-102/
Date: 2010-10-19
Author: fatherlinux
Post Type: post
Summary: &amp;nbsp; Background In my original post KVM Virtualization 101 I explained some basic commands that are necessary to get on using KVM. In this article I move on to some slightly more obscure topics in using KVM. &amp;nbsp; Routine Operations CPU Type When you are operating in a KVM virtual machine the processor will report&amp;lt;p class=&amp;quot;excert-link-wrapper&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;https://crunchtools.com/kvm-virtualization-102/&amp;quot; class=&amp;quot;excerpt-more-link&amp;quot; &amp;gt;Continue Reading&amp;lt;span class=&amp;quot;screen-reader-text&amp;quot;&amp;gt; &amp;quot;KVM Virtualization 102&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;meta-nav&amp;quot;&amp;gt; &amp;rarr;&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p class=&amp;quot;excert-link-wrapper&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;https://crunchtools.com/kvm-virtualization-102/&amp;quot; class=&amp;quot;excerpt-more-link&amp;quot; &amp;gt;Continue Reading&amp;lt;span class=&amp;quot;screen-reader-text&amp;quot;&amp;gt; &amp;quot;KVM Virtualization 102&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;meta-nav&amp;quot;&amp;gt; &amp;rarr;&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
Categories: Articles
Tags: Systems Administration, Tutorials, Virtualization
---

[toc]

 

## Background

In my original post [KVM Virtualization 101](http://crunchtools.com/kvm-virtualization-101/) I explained some basic commands that are necessary to get on using KVM. In this article I move on to some slightly more obscure topics in using KVM.

 

## Routine Operations

### CPU Type

When you are operating in a KVM virtual machine the processor will report it&#039;s self to be a QEMU Virtual CPU. If you have a mix of QEMU and KVM host machines, you will need to use the version number to determine the difference.

`cat /proc/cpu`

 

You will see some thing similar to this

`model name : QEMU Virtual CPU version 0.9.1 `

 

### Monitoring &amp; Data Acquisition

Generally, I suggest capturing performance, fault, and log data through the network from central harvesters. For small to medium sized operations, I suggest Cacti/syslog/net-snmpd. Nagios can also perform fault monitoring and data acquisition in one solution.

If, instead, you are looking to capture guest virtual machine data through the hypervisor, this project can help.

`http://people.redhat.com/~rjones/nagios-virt/`

 

## Advanced Operations

### Conversion to a VirtIO Net Device

First upgrade to a kernel that is new enough to support Virtio. Then make a new initrd image. Use the following as a guideline from RHEL 5.4: [[VirtIO FAQ](http://wiki.libvirt.org/page/Virtio#Disk_.28block.29_device_driver)]. There is a significant performance upgrade when using virtio

Upgrade to RHEL5.4 by adding the following file

`/etc/yum.repos.d/eyemg-rh5.4.repo`

Upgrade

`yum update`

Edit the virtual machine definition file

`virsh edit server1`

Add the following line to the interface section

``

Example:

Write the config back to the XML file

`virsh dumpxml abel /srv/vmdata/abel/abel.xml`

Reboot the machine and check to make sure virtio is active. Make sure byte count is different

cat /sys/devices/virtio-pci/virtio0/net\:eth0/statistics/rx_bytes
ping -c 3 10.0.8.1
cat /sys/devices/virtio-pci/virtio0/net\:eth0/statistics/rx_bytes

 

### Conversion to a VirtIO Block Device

As with network drivers, your kernel must be new enough to support Virtio. Then make a new initrd image. Used the following as a guideline: [[VirtIO FAQ](http://wiki.libvirt.org/page/Virtio#Disk_.28block.29_device_driver)]

Upgrade to RHEL5.4 by adding the following file

`/etc/yum.repos.d/eyemg-rh5.4.repo`

Upgrade

`yum update`

Rebuild initrd image

`mkinitrd --with virtio_pci --with virtio_blk -f /boot/initrd-$(uname -r).img $(uname -r)`

Double check grub is using the latest initrd image

`vim /boot/grub/grub.conf`

Check to make sure the correct parameter was passed to the kernel at boot

`cat /proc/cmdline`

 

### Elevator=noop 

The [elevetor](http://www.redhat.com/magazine/008jun05/features/schedulers/) is the IO scheduler in the Linux kernel and is useful when tuning a physical machine, but in a virtual machine it should be turned off. This will permit the underlying operating system to do this work

Change the elevator to no operations so that it isn&#039;t in contention with the underlying operating system

`kernel /boot/vmlinuz-2.6.18-164.el5PAE ro root=LABEL=/ quiet elevator=noop`

 

 

---

## Categories

- Articles

---

## Navigation

- [Home](https://crunchtools.com/)
- [Articles](https://crunchtools.com/category/articles/)
- [Events](https://crunchtools.com/category/events/)
- [News](https://crunchtools.com/category/news/)
- [Presentations](https://crunchtools.com/category/presentations/)
- [Software](https://crunchtools.com/software/)
- [Beaver Backup](https://crunchtools.com/software/beaver-backup/)
- [Check BGP Neighbors](https://crunchtools.com/software/check-bgp-neighbors-nagios/)
- [Chev](https://crunchtools.com/software/chev-check-vulnerabilities-script/)
- [Graph BGP Neighbors](https://crunchtools.com/software/grpah-bgp-neighbors/)
- [Graph MySQL Stats](https://crunchtools.com/software/graph-mysql-stats/)
- [Graph Sockets Pipes Files](https://crunchtools.com/software/graph-sockets-pipes-files/)
- [MCP Servers](https://crunchtools.com/software/mcp-servers/)
- [Petit](https://crunchtools.com/software/petit/)
- [Racecar](https://crunchtools.com/software/racecar/)
- [Shiva](https://crunchtools.com/software/shiva/)
- [About](https://crunchtools.com/about/)
- [Home](https://crunchtools.com)

## Tags

- Systems Administration
- Tutorials
- Virtualization

