Virtualization Getting Started Guide Red Hat Enterprise Linux 6 Dayle Parker

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 37

Dayle Parker Laura Novich Jacquelynn East
Scott Radvan
Red Hat Enterprise Linux 6
Virtualization Getting Started Guide
An introduction to virtualization concepts
Red Hat Enterprise Linux 6 Virtualization Getting Started Guide
An introduction to virtualization concepts
Dayle Parker
Red Hat Engineering Content Services
dayleparker@redhat.com
Laura Novich
Red Hat Engineering Content Services
lno vich@redhat.co m
Jacquelynn East
Red Hat Engineering Content Services
jeast@redhat.com
Sco tt Radvan
Red Hat Engineering Content Services
sradvan@redhat.co m
Legal Notice
Co pyright © 20 11-20 15 Red Hat, Inc.
This do cument is licensed by Red Hat under the Creative Co mmo ns Attribution-ShareAlike 3.0
Unpo rted License. If you distribute this do cument, o r a modified versio n of it, you must provide
attributio n to Red Hat, Inc. and pro vide a link to the o riginal. If the do cument is mo dified, all Red
Hat trademarks must be remo ved.
Red Hat, as the licenso r of this do cument, waives the right to enfo rce, and agrees no t to assert,
Sectio n 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shado wman lo go , JBoss, MetaMatrix, Fedo ra, the Infinity
Lo go, and RHCE are trademarks of Red Hat, Inc., registered in the United States and o ther
co untries.
Linux ® is the registered trademark o f Linus To rvalds in the United States and o ther co untries.
Java ® is a registered trademark o f Oracle and/o r its affiliates.
XFS ® is a trademark o f Silico n Graphics Internatio nal Corp. o r its subsidiaries in the United
States and/or other co untries.
MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and
other co untries.
No de.js ® is an official trademark of Joyent. Red Hat Software Co llectio ns is no t fo rmally
related to o r endo rsed by the official Joyent No de.js open so urce or commercial pro ject.
The OpenStack ® Word Mark and OpenStack Lo go are either registered trademarks/service
marks or trademarks/service marks of the OpenStack Foundatio n, in the United States and other
co untries and are used with the OpenStack Foundation's permission. We are no t affiliated with,
endo rsed o r sponso red by the OpenStack Foundatio n, o r the OpenStack co mmunity.
All other trademarks are the pro perty of their respective o wners.
Abstract
The Red Hat Enterprise Linux Virtualization Getting Started Guide describes the basics o f
virtualizatio n and the virtualization products and techno logies that are available with Red Hat
Enterprise Linux.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents
Chapt er 1 . Int roduct io n
1.1. Who sho uld read this g uid e?
1.2. Virtualiz atio n in Red Hat Enterp ris e Linux 6
1.3. Red Hat Enterp ris e Virtualiz atio n (RHEV)
1.4. Do c umentatio n suite
Chapt er 2 . What is virt ualiz at ion and migrat ion?
2.1. What is virtualiz atio n?
2.2. Mig ratio n
2.2.1. Benefits o f mig rating virtual machines
2.3. Virtualized to virtualiz ed mig ratio n (V2V)
Chapt er 3. Advant ages and misconcep t io ns of virt ualiz at ion
3.1. Virtualiz atio n co s ts
3.2. Virtualizatio n learning curve
3.3. Perfo rmanc e
3.4. Disaster rec o very
3.5. Sec urity
3.5.1. Virtualiz atio n security features
3.6 . Virtualiz atio n fo r servers and ind ivid uals
3.6 .1. Virtualizatio n d ep lo yment sc enario s
Chapt er 4 . Int roduct io n t o Red Hat virt ualizat ion product s
4.1. KVM and virtualiz atio n in Red Hat Enterp ris e Linux
4.2. lib virt and lib virt to o ls
4.3. Virtualized hard ware d evices
4.3.1. Virtualiz ed and emulated d evices
4.3.2. Para-virtualiz ed d evic es
4.3.3. Physic al ho s t d evices
4.4. G uest CPU mo d els
4.5. Sto rag e
4.5.1. Sto rag e p o o ls
4.5.2. Sto rag e vo lumes
4.5.3. Emulated sto rag e d evic es
4.5.4. Ho st sto rag e
Chapt er 5. Virt ualizat ion T ools
5.1. virs h
5.2. virt-manag er
5.3. virt-install
5.4. g uestfis h
5.5. O ther us eful to o ls
Appendix A. Revision Hist o ry
2
2
2
2
2
5
5
5
6
6
8
8
8
8
9
9
9
10
10
1 2
12
14
15
15
17
19
20
20
21
21
21
22
2 4
24
24
24
25
25
2 9
T able of Con t ent s
1
Chapter 1. Introduction
The Virtualization Getting Started Guide introduces the basics of virtualization and assists with the
navigation of other virtualization documentation and products that Red Hat provides.
This guide also explains the advantages of virtualization and dispels some common myths that exist
regarding virtualization.
1.1. Who should read t his guide?
This guide is designed for anyone wishing to understand the basics of virtualization, but may be of
particular interest to:
Those who are new to virtualization and seeking knowledge about the benefits offered.
Those considering deployment of virtualized machines in their environment.
Those looking for an overview of the virtualization technologies that Red Hat produces and
supports.
1.2. Virt ualizat ion in Red Hat Ent erprise Linux 6
Red Hat Enterprise Linux contains packages and tools to support a variety of virtualized
environments.
Virtualization in Red Hat Enterprise Linux 6 is carried out by KVM (Kernel-based Virtual Machine).
KVM is a full virtualization solution built into Red Hat Enterprise Linux 6.
Refer to Chapter 4, Introduction to Red Hat virtualization products for more about the virtualization
products available in Red Hat Enterprise Linux 6.
1.3. Red Hat Ent erprise Virt ualizat ion (RHEV)
Red Hat Enterprise Virtualization (RHEV) is a complete enterprise virtualization management solution
for server and desktop virtualization, based on Kernel-based Virtual Machine (KVM) technology.
Designed for enterprise-class scalability and performance, Red Hat Enterprise Virtualization enables
management of your entire virtual infrastructure, including hosts, virtual machines, networks,
storage, and users from a centralized graphical interface.
Red Hat Enterprise Virtualization includes the RHEV Manager infrastructure management system and
the RHEV Hypervisor, which supports a wide range of Windows and Linux server and desktop
operating systems — all while delivering reliability, stability, and the lowest total cost of ownership in
its class.
Download a fully supported 60-day evaluation version of Red Hat Enterprise Virtualization from
http://www.redhat.com/en/technologies/virtualization/enterprise-virtualization.
1.4. Document at ion suit e
Red Hat offers a wealth of documentation solutions across its various virtualization products.
Coverage of Red Hat Enterprise Linux and its inbuilt virtualization products includes:
Virt ualizat ion G et t ing St art ed G uide
2
Red Hat Enterprise Linux — Virtualization Getting Started Guide: This guide provides an introduction
to virtualization concepts, advantages, and tools, and an overview of Red Hat virtualization
documentation and products.
Red Hat Enterprise Linux — Virtualization Host Configuration and Guest Installation Guide: This guide
covers the installation of virtualization software and configuration of guest machines on a
virtualization host.
Red Hat Enterprise Linux — Virtualization Administration Guide: This guide covers administration of
hosts, networking, storage, and device and guest management using either virt-manager or virsh
as primary configuration tools. This guide also includes a libvirt and QEMU reference, as well as
troubleshooting information.
Red Hat Enterprise Linux — Virtualization Security Guide: This guide provides an overview of
virtualization security technologies provided by Red Hat. Also included are recommendations for
securing hosts, guests, and shared infrastructure and resources in virtualized environments.
Red Hat Enterprise Linux — Virtualization Tuning and Optimization Guide: This guide provides tips,
tricks and suggestions for making full use of virtualization performance features and options for
your systems and guest virtual machines.
Red Hat Enterprise Linux — V2V Guide: This guide describes importing virtual machines from KVM,
Xen and VMware ESX/ESX(i) hypervisors to Red Hat Enterprise Virtualization and KVM managed
by libvirt.
The Red Hat Enterprise Virtualization documentation suite provides information on installation,
development of applications, configuration and usage of the Red Hat Enterprise Virtualization
platform and its related products.
Red Hat Enterprise Virtualization Installation Guide: This guide describes how to prepare for and set
up a Red Hat Enterprise Virtualization environment, and how to upgrade a Red Hat Enterprise
Virtualization environment to the latest release. It also outlines how to set up hypervisors and
perform initial configuration of a Red Hat Enterprise Virtualization environment.
Red Hat Enterprise Virtualization Administration Guide: This guide describes how to configure and
administer a Red Hat Enterprise Virtualization environment after that environment has been set up
for the first time, including how to add hypervisors, storage domains, and external providers to the
environment, how to manage resources such as virtual machines, virtual disks, and templates,
and how to take and restore backups.
Red Hat Enterprise Virtualization User Guide: This guide describes how to use the User Portal of a
Red Hat Enterprise Virtualization environment, including the functionality provided by the Basic
and Extended tabs, how to create and work with virtual machines and templates, and how to
monitor resource usage.
Red Hat Enterprise Virtualization Technical Guide: This guide describes how to use the REST API,
the Python and Java software development kits, and command-line tools specific to Red Hat
Enterprise Virtualization. It also outlines the underlying technical concepts behind Red Hat
Enterprise Virtualization.
Red Hat Enterprise Virtualization Manager Release Notes: This guide contains information on the
Red Hat Enterprise Virtualization Manager specific to the current release.
Red Hat Enterprise Virtualization Technical Notes: This guide describes the changes that have
been made between the current release and the previous release.
Chapt er 1 . Int roduct io n
3
Note
All of the guides for these products are available at the Red Hat Customer Portal:
https://access.redhat.com/documentation/en-US/
Virt ualizat ion G et t ing St art ed G uide
4
Chapter 2. What is virtualization and migration?
This chapter discusses terms related to virtualization and migration.
2.1. What is virt ualizat ion?
Virtualization is a broad computing term used for running software, usually multiple operating
systems, concurrently and in isolation from other programs on a single system. Most existing
implementations of virtualization use a hypervisor, a software layer or subsystem that controls
hardware and provides guest operating systems with access to underlying hardware. The hypervisor
allows multiple operating systems, called guests, to run on the same physical system by offering
virtualized hardware to the guest operating system. There are various methods for virtualizing
operating systems:
Fu ll virt u aliz at io n
Full virtualization uses the hardware features of the processor to provide guests with total
abstraction of the underlying physical system. This creates a new virtual system, called a
virtual machine, that allows guest operating systems to run without modifications. The guest
operating system and any applications on the guest virtual machine are unaware of their
virtualized environment and run normally. Hardware-assisted virtualization is the technique
used for full virtualization with KVM (Kernel-based Virtual Machine) in Red Hat Enterprise
Linux.
Para - vi rt u al iz a t io n
Para-virtualization employs a collection of software and data structures that are presented
to the virtualized guest, requiring software modifications in the guest to use the para-
virtualized environment. Para-virtualization can encompass the entire kernel, as is the case
for Xen para-virtualized guests, or drivers that virtualize I/O devices.
So f t ware virt u aliz at io n ( o r emu lat io n )
Software virtualization uses slower binary translation and other emulation techniques to
run unmodified operating systems. Software virtualization is unsupported by Red Hat
Enterprise Linux.
Note
For more information and detailed instructions on guest installation, refer to the Red Hat
Enterprise Linux 6 Virtualization Host Configuration and Guest Installation Guide.
2.2. Migrat ion
Migration describes the process of moving a guest virtual machine from one host to another. This is
possible because the virtual machines are running in a virtualized environment instead of directly on
the hardware. There are two ways to migrate a virtual machine: live and offline.
Mig rat io n T yp es
O f f lin e mig rat io n
Chapt er 2 . What is virt ualiz at ion and migrat ion?
5
An offline migration suspends the guest virtual machine, and then moves an image of the
virtual machine's memory to the destination host. The virtual machine is then resumed on
the destination host and the memory used by the virtual machine on the source host is
freed.
Live mig rat io n
Live migration is the process of migrating an active virtual machine from one physical host
to another.
2.2.1. Benefit s of migrat ing virt ual machines
Migration is useful for:
Lo ad b alan cin g
When a host machine is overloaded, one or many of its virtual machines could be migrated
to other hosts using live migration.
Up g rad in g o r makin g ch an g es t o t h e h o st
When the need arises to upgrade, add, or remove hardware devices on one host, virtual
machines can be safely relocated to other hosts. This means that guests do not experience
any downtime due to changes that are made to any of the hosts.
En erg y savin g
Virtual machines can be redistributed to other hosts and the unloaded host systems can be
powered off to save energy and cut costs in low usage periods.
G eo g rap h ic mig rat io n
Virtual machines can be moved to another physical location for lower latency or for other
special circumstances.
It is important to understand that the migration process moves the virtual machine's memory, and
from Red Hat Enterprise Linux 6.3, the disk volume associated with the virtual machine is also
migrated. This process is done using live block migration.
Shared, networked storage can be used to store guest images to be migrated. When migrating virtual
machines, it is recommended to use lib virt -managed storage pools for shared storage.
Note
For more information on migration, refer to the Red Hat Enterprise Linux 6 Virtualization
Administration Guide.
2.3. Virt ualized t o virt ualized migrat ion (V2V)
Red Hat Enterprise Linux 6 provides tools for converting virtual machines from other types of
hypervisors to KVM. The virt-v2v tool converts and imports virtual machines from Xen, other
versions of KVM, VMware ESX, and Hyper-V.
From Red Hat Enterprise Linux 6.5, the virt-v2v tool converts and imports virtual machines with
virtual disk image formats including VHDX, VMDK, OVF, raw, and qcow2.
Virt ualizat ion G et t ing St art ed G uide
6
Note
For more information on V2V, refer to the Red Hat Enterprise Linux 6 V2V Guide.
Chapt er 2 . What is virt ualiz at ion and migrat ion?
7
Chapter 3. Advantages and misconceptions of virtualization
There are many advantages to virtualization and perhaps an equal amount of misconceptions
surrounding it. This chapter explores these points.
3.1. Virt ualizat ion cost s
A common misconception is that virtualization is too expensive to justify the change. Virtualization
can be expensive to introduce but often it saves money in the long term. It is important to perform a
Return on Investment (ROI) analysis to determine the best use of virtualization in your environment.
Consider the following benefits:
Less p o wer
Using virtualization negates much of the need for multiple physical platforms. This equates
to less power being drawn for machine operation and cooling, resulting in reduced energy
costs. The initial cost of purchasing multiple physical platforms, combined with the
machines' power consumption and required cooling, is drastically cut by using
virtualization.
Less main t en an ce
Provided adequate planning is performed before migrating physical systems to virtualized
ones, less time is spent maintaining them. This means less money being spent on parts and
labor.
Ext en d ed lif e f o r in st alled so f t ware
Older versions of software may not run on newer, bare metal machines directly. However, by
running the older software virtually on a larger, faster system, the life of the software may be
extended while taking advantage of the performance from the newer system.
Pred ict ab le co st s
A Red Hat Enterprise Linux subscription provides support for virtualization at a fixed rate,
making it easy to predict costs.
Less space
Consolidating servers onto fewer machines means less physical space is required. This
means the space normally occupied by server hardware can be used for other purposes.
3.2. Virt ualizat ion learning curve
A misconception exists that virtualization is difficult to learn. In truth, virtualization is no more difficult
or easy to learn than any new process. The skills required for managing and supporting a physical
environment are easily transferable to a virtual one. Virtual environments function similarly to their
physical counterparts, ensuring the learning curve remains a slight one.
3.3. Performance
On older virtualization versions that supported only a single CPU, virtual machines experienced
noticeable performance limitations. This created a long-lasting misconception that virtualization
solutions are slow.
Virt ualizat ion G et t ing St art ed G uide
8
This is no longer the case; modern virtualization technology has greatly improved the speed of
virtual machines. Benchmarks show that virtual machines can run typical server applications nearly
as efficiently as bare metal systems:
Red Hat Enterprise Linux 6.4 and KVM recorded an industry-leading TPC-C benchmark with an
IBM DB2 database running in an entirely virtualized x86 environment and delivering 88% of bare
metal performance. Due to resource demands, databases have previously been reserved for bare-
metal deployments only, and represent one of the last strongholds within a datacenter to be
virtualized.
The industry standard SAP Sales and D istribution (SD) Standard Application Benchmark found
Red Hat Enterprise Linux 6.2 and KVM to demonstrate a virtualization efficiency of 85% when
comparing a bare metal system running on identical hardware.
Red Hat Enterprise Linux 6.1 and KVM achieved record-setting virtualization performance in the
SPECvirt_sc2010 benchmark recorded by the Standard Performance Evaluation Corporation
(SPEC), setting the best virtual performance mark of any published SPECvirt result. The
SPECvirt_sc2010 metric measures the end-to-end performance of system components in
virtualized data center servers.
Note
For more details on these virtualization benchmarks, visit:
Red Hat and IBM Achieve Leading Performance Benchmark Results at
http://www.redhat.com/about/news/archive/2013/2/red-hat-and-ibm-achieve-leading-
performance-benchmark-results
Red Hat Knowledgebase, SAP-SD Benchmark running in a VM – Leadership Performance using
RHEL 6 / KVM at https://access.redhat.com/knowledge/articles/216943
The Standard Performance Evaluation Corporation (SPEC) at http://www.spec.org
Red Hat Achieves New Top Virtualization Performance Benchmark with HP at
http://investors.redhat.com/releasedetail.cfm?ReleaseID=617594
For more information on performance tuning for virtualization, refer to the Red Hat Enterprise
Linux 6 Virtualization Tuning and Optimization Guide.
3.4. Disast er recovery
Disaster recovery is quicker and easier when the systems are virtualized. On a physical system, if
something serious goes wrong, a complete re-install of the operating system is usually required,
resulting in hours of recovery time. However, if the systems are virtualized this is much faster due to
migration ability. If the requirements for live migration are followed, virtual machines can be restarted
on another host, and the longest possible delay would be in restoring guest data. Also, because
each of the virtualized systems are completely separate to each other, one system's downtime will not
affect any others.
3.5. Securit y
A virtual machine uses SELinux and sVirt to improve security in virtualization. This section includes
an overview of the security options available.
3.5.1. Virt ualiz at ion securit y feat ures
Chapt er 3. Advant ages and misconcep t io ns of virt ualiz at ion
9
SELi n u x
SELinux was developed by the US National Security Agency and others to provide Mandatory
Access Control (MAC) for Linux. Under control of SELinux, all processes and files are given what is
known as a type, and access is limited by fine-grained controls. SELinux limits the abilities of an
attacker and works to prevent many common security exploits such as buffer overflow attacks and
privilege escalation.
SELinux strengthens the security model of Red Hat Enterprise Linux hosts and virtualized Red Hat
Enterprise Linux guests. SELinux is configured and tested to work, by default, with all virtualization
tools shipped with Red Hat Enterprise Linux 6.
sVirt
sVirt is a technology included in Red Hat Enterprise Linux 6 that integrates SELinux and
virtualization. It applies Mandatory Access Control (MAC) to improve security when using virtual
machines, and improves security and hardens the system against bugs in the hypervisor that might
be used as an attack vector for the host or to another virtual machine.
Note
For more information on security for virtualization, refer to the Red Hat Enterprise Linux 6
Virtualization Security Guide.
3.6. Virt ualizat ion for servers and individuals
Virtualization is not just for servers; it can be useful for individuals as well. Desktop virtualization
offers centralized management, an improved desktop solution, and better disaster recovery. By using
connection software, it is possible to connect to a desktop remotely.
For servers, virtualization is not only for larger networks, but for any situation with two or more
servers. It provides live migration, high availability, fault tolerance, and streamlined backups.
3.6.1. Virt ualiz at ion deployment scenarios
These are examples of common deployment scenarios for virtualization, and the tools that can be
used to deploy these scenarios.
Small d ep lo ymen t s o f u p t o 3 ph ysical h o st s an d 10 g u est s: virt - man ag er
A tool such as virt-manager can be useful to a small business running several servers that
do not have strict uptime requirements or service-level agreements (SLAs). In this
environment, a single administrator may be responsible for the entire infrastructure, and
maintaining procedural flexibility is important if a component needs to be changed. This
environment may contain applications such as web servers, file and print servers, and
application servers.
Larg e d ep lo ymen t s o r missio n - crit ical ap p licat io n s: R ed Hat En t erp rise
Virt u aliz at io n ( RHEV)
A full virtualization platform such as Red Hat Enterprise Virtualization (RHEV) might suit an
enterprise running larger deployments or mission-critical applications. In this environment,
the physical infrastructure is large enough to require an IT department and the business
requirements demand a defined response to new needs. Some examples of a large
Virt ualizat ion G et t ing St art ed G uide
10
deployment suited to Red Hat Enterprise Virtualization may include databases, trading
platforms, or messaging systems that must run continuously without any downtime.
So f t ware d evelo p ers p ro d u cin g man ag emen t ap p licat io n s: lib virt
Both virt-manager and Red Hat Enterprise Virtualization (RHEV) use libvirt to manage
virtual machines. libvirt is a virtualization application programming interface (API) that
allows software developers to produce and adapt management applications.
Chapt er 3. Advant ages and misconcep t io ns of virt ualiz at ion
11
Chapter 4. Introduction to Red Hat virtualization products
This chapter introduces the various virtualization products available in Red Hat Enterprise Linux.
4.1. KVM and virt ualizat ion in Red Hat Ent erprise Linux
Wh at is KVM?
KVM (Kernel-based Virtual Machine) is a full virtualization solution for Linux on AMD64 and
Intel 64 hardware that is built into the standard Red Hat Enterprise Linux 6 kernel. It can run
multiple, unmodified Windows and Linux guest operating systems. The KVM hypervisor in
Red Hat Enterprise Linux is managed with the lib virt API and tools built for lib virt (such
as virt-manager and virsh). Virtual machines are executed and run as multi-threaded
Linux processes controlled by these tools.
O verc o mmi t t in g
The KVM hypervisor supports overcommitting of system resources. Overcommitting means
allocating more virtualized CPUs or memory than the available resources on the system.
Memory overcommitting allows hosts to utilize memory and virtual memory to increase guest
densities.
Important
Overcommitting involves possible risks to system stability. For more information on
overcommitting with KVM, and the precautions that should be taken, refer to the Red
Hat Enterprise Linux 6 Virtualization Administration Guide.
T h in p ro visio n in g
Thin provisioning allows the allocation of flexible storage and optimizes the available
space for every guest virtual machine. It gives the appearance that there is more physical
storage on the guest than is actually available. This is not the same as overcommitting as
this only pertains to storage and not CPUs or memory allocations. However, like
overcommitting, the same warning applies.
Important
Thin provisioning involves possible risks to system stability. For more information on
thin provisioning with KVM, and the precautions that should be taken, refer to the
Red Hat Enterprise Linux 6 Virtualization Administration Guide.
KSM
Kernel Same-page Merging (KSM), used by the KVM hypervisor, allows KVM guests to share
identical memory pages. These shared pages are usually common libraries or other
identical, high-use data. KSM allows for greater guest density of identical or similar guest
operating systems by avoiding memory duplication.
Virt ualizat ion G et t ing St art ed G uide
12
Note
For more information on KSM, refer to the Red Hat Enterprise Linux 6 Virtualization
Administration Guide.
Q EMU G u est Ag en t
The QEMU Guest Agent runs on the guest operating system and allows the host machine to
issue commands to the guest operating system.
Note
For more information on the QEMU Guest Agent, refer to the Red Hat Enterprise Linux 6
Virtualization Host Configuration and Guest Installation Guide.
Hyp er- V En lig h t en men t
KVM in Red Hat Enterprise Linux 6.5 implements several Hyper-V compatible functions that
are used by Windows guests to improve performance and stability, allowing Windows
guests to perform as if they were running on a Microsoft Hyper-V hypervisor.
Note
For more information on Hyper-V Enlightenment, refer to the Red Hat Enterprise Linux 6
Virtualization Host Configuration and Guest Installation Guide.
Disk I/O t h ro t t lin g
When several virtual machines are running simultaneously, they can interfere with system
performance by using excessive disk I/O. D isk I/O throttling in KVM provides the ability to
set a limit on disk I/O requests sent from virtual machines to the host machine. This can
prevent a virtual machine from over utilizing shared resources, and impacting the
performance of other virtual machines.
Note
For instructions on using disk I/O throttling, refer to the Red Hat Enterprise Linux 6
Virtualization Tuning and Optimization Guide.
KVM g u est virt u al mach in e co mp at ib ilit y
To verify whether your processor supports the virtualization extensions and for information
on enabling the virtualization extensions if they are disabled, refer to the Red Hat Enterprise
Linux 6 Virtualization Administration Guide.
Red Hat Enterprise Linux 6 servers have certain support limits.
The following URLs explain the processor and memory amount limitations for Red Hat
Enterprise Linux:
Chapt er 4 . Int roduct io n t o Red Hat virt ualizat ion product s
13
For host systems: https://access.redhat.com/site/articles/rhel-limits
For the KVM hypervisor: https://access.redhat.com/site/articles/rhel-kvm-limits
For a complete chart of supported operating systems and host and guest combinations
refer to https://access.redhat.com/site/supported-hypervisors.
4.2. libvirt and libvirt t ools
The libvirt package is a hypervisor-independent virtualization API that is able to interact with the
virtualization capabilities of a range of operating systems.
The libvirt package provides:
A common, generic, and stable layer to securely manage virtual machines on a host.
A common interface for managing local systems and networked hosts.
All of the APIs required to provision, create, modify, monitor, control, migrate, and stop virtual
machines, but only if the hypervisor supports these operations. Although multiple hosts may be
accessed with l ib virt simultaneously, the APIs are limited to single node operations.
lib virt focuses on managing single hosts and provides APIs to enumerate, monitor and use the
resources available on the managed node, including CPUs, memory, storage, networking and Non-
Uniform Memory Access (NUMA) partitions. The management tools can be located on separate
physical machines from the host using secure protocols.
Red Hat Enterprise Linux 6 supports l ib vi rt and includes lib virt -based tools as its default method
for virtualization management (as in Red Hat Enterprise Virtualization Management).
The libvirt package is available as free software under the GNU Lesser General Public License. The
libvirt project aims to provide a long term stable C API to virtualization management tools, running on
top of varying hypervisor technologies. The libvirt package supports Xen on Red Hat Enterprise
Linux 5, and it supports KVM on both Red Hat Enterprise Linux 5 and Red Hat Enterprise Linux 6.
virsh
The virsh command-line tool is built on the lib virt management API and operates as an
alternative to the graphical virt-manager application. The virsh command can be used
in read-only mode by unprivileged users or, with root access, full administration
functionality. The virsh command is ideal for scripting virtualization administration.
virt - ma n ag er
virt-manager is a graphical desktop tool for managing virtual machines. It allows access
to graphical guest consoles and can be used to perform virtualization administration,
virtual machine creation, migration, and configuration tasks. The ability to view virtual
machines, host statistics, device information and performance graphs is also provided. The
local hypervisor and remote hypervisors can be managed through a single interface.
Note
For more information on virsh and virt - ma n ag er, refer to the Red Hat Enterprise Linux 6
Virtualization Administration Guide.
Virt ualizat ion G et t ing St art ed G uide
14
Note
Some virtualization commands in Red Hat Enterprise Linux 6 allow you to specify a remote
libvirt connection. For example:
virt-df -c qemu://remote/system -d Guest
However, libguestfs in Red Hat Enterprise Linux 6 cannot access remote guests, and
commands using remote URLs like this do not work as expected. This affects the following Red
Hat Enterprise Linux 6 commands:
guestfish
guestmount
virt-alignment-scan
virt-cat
virt-copy-in
virt-copy-out
virt-df
virt-edit
virt-filesystems
virt-inspector
virt-inspector2
virt-list-filesystems
virt-list-partitions
virt-ls
virt-rescue
virt-sysprep
virt-tar
virt-tar-in
virt-tar-out
virt-win-reg
4.3. Virt ualized hardware devices
Virtualization on Red Hat Enterprise Linux 6 presents three distinct types of system devices to virtual
machines. The three types include:
Virtualized and emulated devices
Para-virtualized devices
Physically shared devices
These hardware devices all appear as being physically attached to the virtual machine but the
device drivers work in different ways.
4 .3.1. Virt ualiz ed and emulat ed devices
KVM implements many core devices for virtual machines in software. These emulated hardware
devices are crucial for virtualizing operating systems.
Emulated devices are virtual devices which exist entirely in software.
Chapt er 4 . Int roduct io n t o Red Hat virt ualizat ion product s
15
Emulated drivers may use either a physical device or a virtual software device. Emulated drivers are a
translation layer between the virtual machine and the Linux kernel (which manages the source
device). The device level instructions are completely translated by the KVM hypervisor. Any device, of
the same type (storage, network, keyboard, and mouse) and recognized by the Linux kernel, may be
used as the backing source device for the emulated drivers.
Virt u al C PUs ( vCPUs)
A host system can have up to 160 virtual CPUs (vCPUs) that can be presented to guests for
their use, regardless of the number of host CPUs.
Emu lat ed g rap h ics d evices
Two emulated graphics devices are provided. These devices can be connected to with the
SPICE (Simple Protocol for Independent Computing Environments) protocol or with VNC:
A Cirrus CLGD 5446 PCI VGA card (using the cirrus device)
A standard VGA graphics card with Bochs VESA extensions (hardware level, including
all non-standard modes)
Emu lat ed syst em co mp o n en t s
The following core system components are emulated to provide basic system functions:
Intel i440FX host PCI bridge
PIIX3 PCI to ISA bridge
PS/2 mouse and keyboard
EvTouch USB Graphics Tablet
PCI UHCI USB controller and a virtualized USB hub
Emulated serial ports
EHCI controller, virtualized USB storage and a USB mouse
Emu lat ed so u n d d evices
Red Hat Enterprise Linux 6.1 and above provides an emulated (Intel) HDA sound device,
intel-hda. This device is supported on the following guest operating systems:
Red Hat Enterprise Linux 6, for i386 and x86_64 architectures
Red Hat Enterprise Linux 5, for i386 and x86_64 architectures
Red Hat Enterprise Linux 4, for i386 and x86_64 architectures
Windows 7, for i386 and x86_64 architectures
Windows 2008 R2, for the x86_64 architecture
The following two emulated sound devices are also available, but are not recommended
due to compatibility issues with certain guest operating systems:
ac97, an emulated Intel 82801AA AC97 Audio compatible sound card
es1370, an emulated ENSONIQ AudioPCI ES1370 sound card
Emu lat ed wat ch d o g d evices
Virt ualizat ion G et t ing St art ed G uide
16
Red Hat Enterprise Linux 6 provides two emulated watchdog devices. A watchdog can be
used to automatically reboot a virtual machine when it becomes overloaded or
unresponsive.
The watchdog package must be installed on the guest.
The two devices available are:
i 6 30 0 esb, an emulated Intel 6300 ESB PCI watchdog device. It is supported in guest
operating system Red Hat Enterprise Linux versions 6.0 and above, and is the
recommended device to use.
ib700, an emulated iBase 700 ISA watchdog device. The ib700 watchdog device is
only supported in guests using Red Hat Enterprise Linux 6.2 and above.
Both watchdog devices are supported in i386 and x86_64 architectures for guest operating
systems Red Hat Enterprise Linux 6.2 and above.
Emu lat ed n et wo rk d evices
There are two emulated network devices available:
The e1000 device emulates an Intel E1000 network adapter (Intel 82540EM, 82573L,
82544GC).
The rtl 8139 device emulates a Realtek 8139 network adapter.
Emu lat ed st o rag e drivers
Storage devices and storage pools can use these emulated devices to attach storage
devices to virtual machines. The guest uses an emulated storage driver to access the
storage pool.
Note that like all virtual devices, the storage drivers are not storage devices. The drivers are
used to attach a backing storage device, file or storage pool volume to a virtual machine.
The backing storage device can be any supported type of storage device, file, or storage
pool volume.
T h e emu lat ed IDE d river
KVM provides two emulated PCI IDE interfaces. An emulated IDE driver can be
used to attach any combination of up to four virtualized IDE hard disks or
virtualized IDE CD-ROM drives to each virtual machine. The emulated IDE driver
is also used for virtualized CD-ROM and DVD -ROM drives.
T h e emu lat ed f lo p p y d isk d rive d river
The emulated floppy disk drive driver is used for creating virtualized floppy drives.
4 .3.2. Para-virt ualiz ed devices
Para-virtualization provides a fast and efficient means of communication for guests to use devices
on the host machine. KVM provides para-virtualized devices to virtual machines using the Virtio API
as a layer between the hypervisor and guest.
Some para-virtualized devices decrease I/O latency and increase I/O throughput to near bare-metal
levels, while other para-virtualized devices add functionality to virtual machines that is not otherwise
available. It is recommended to use para-virtualized devices instead of emulated devices for virtual
machines running I/O intensive applications.
Chapt er 4 . Int roduct io n t o Red Hat virt ualizat ion product s
17
All virtio devices have two parts: the host device and the guest driver. Para-virtualized device drivers
allow the guest operating system access to physical devices on the host system.
The para-virtualized device drivers must be installed on the guest operating system. By default, the
para-virtualized device drivers are included in Red Hat Enterprise Linux 4.7 and newer, Red Hat
Enterprise Linux 5.4 and newer and Red Hat Enterprise Linux 6.0 and newer. The para-virtualized
device drivers must be manually installed on Windows guests.
Note
For more information on using the para-virtualized devices and drivers, refer to the Red Hat
Enterprise Linux 6 Virtualization Host Configuration and Guest Installation Guide.
T h e p ara- virt u aliz ed n et wo rk d evice ( virt io - n et )
The para-virtualized network device is a virtual network device that provides network
access to virtual machines with increased I/O performance and lower latency.
T h e p ara- virt u aliz ed b lo ck d evice ( virt io - b lk)
The para-virtualized block device is a high-performance virtual storage device with that
provides storage to virtual machines with increased I/O performance and lower latency. The
para-virtualized block device is supported by the hypervisor and is attached to the virtual
machine (except for floppy disk drives, which must be emulated).
T h e p ara- virt u aliz ed co n t ro ller d evice ( virt io - scsi)
The para-virtualized SCSI controller device is a new feature in Red Hat Enterprise Linux 6.4
that provides a more flexible and scalable alternative to virtio-blk. A virtio-scsi guest is
capable of inheriting the feature set of the target device, and can handle hundreds of
devices compared to virtio-blk, which can only handle 28 devices.
In Red Hat Enterprise Linux 6.4 and above, virtio-scsi is fully supported for the following
guest operating systems:
Red Hat Enterprise Linux 6.4 and above
Windows Server 2008
Windows 7
Windows Server 2012
Windows 8 (32/64 bit)
T h e p ara- virt u aliz ed clo ck
Guests using the Time Stamp Counter (TSC) as a clock source may suffer timing issues.
KVM works around hosts that do not have a constant Time Stamp Counter by providing
guests with a para-virtualized clock. Additionally, the para-virtualized clock assists with
time adjustments needed after a guest runs S3 or suspend to RAM operations.
T h e p ara- virt u aliz ed serial d evice ( virt io - serial)
The para-virtualized serial device is a bytestream-oriented, character stream device, and
provides a simple communication interface between the host's user space and the guest's
user space.
Virt ualizat ion G et t ing St art ed G uide
18
T h e b allo o n d evice ( virt io - b allo o n )
The balloon device can designate part of a virtual machine's RAM as not being used (a
process known as balloon inflation), so that the memory can be freed for the host (or for
other virtual machines on that host) to use. When the virtual machine needs the memory
again, the balloon can be deflated and the host can distribute the RAM back to the virtual
machine.
T h e p ara- virt u aliz ed g rap h ics card ( Q XL)
The para-virtualized graphics card works with the QXL driver to provide an efficient way to
display a virtual machine's graphics from a remote host. The QXL driver is required to use
SPICE.
4 .3.3. Physical host devices
Certain hardware platforms allow virtual machines to directly access various hardware devices and
components. This process in virtualization is known as device assignment. Device assignment is also
known as passthrough.
PCI d evice assig n men t
The KVM hypervisor supports attaching PCI devices on the host system to virtual machines.
PCI device assignment allows guests to have exclusive access to PCI devices for a range of
tasks. It allows PCI devices to appear and behave as if they were physically attached to the
guest virtual machine.
Device assignment is supported on PCI Express devices, with the exception of graphics
cards. Parallel PCI devices may be supported as assigned devices, but they have severe
limitations due to security and system configuration conflicts.
Note
For more information on device assignment, refer to the Red Hat Enterprise Linux 6
Virtualization Host Configuration and Guest Installation Guide.
USB p asst h ro u g h
The KVM hypervisor supports attaching USB devices on the host system to virtual
machines. USB device assignment allows guests to have exclusive access to USB devices
for a range of tasks. It allows USB devices to appear and behave as if they were physically
attached to the virtual machine.
Note
For more information on USB passthrough, refer to the Red Hat Enterprise Linux 6
Virtualization Administration Guide.
SR - IO V
SR-IOV (Single Root I/O Virtualization) is a PCI Express standard that extends a single
physical PCI function to share its PCI resources as separate, virtual functions (VFs). Each
function is capable of being used by a different virtual machine via PCI device assignment.
Chapt er 4 . Int roduct io n t o Red Hat virt ualizat ion product s
19
An SR-IOV capable PCI-e device, provides a Single Root Function (for example, a single
Ethernet port) and presents multiple, separate virtual devices as unique PCI device
functions. Each virtual device may have its own unique PCI configuration space, memory-
mapped registers, and individual MSI-based interrupts.
Note
For more information on SR-IOV, refer to the Red Hat Enterprise Linux 6 Virtualization
Host Configuration and Guest Installation Guide.
NPIV
N_Port ID Virtualization (NPIV) is a functionality available with some Fibre Channel
devices. NPIV shares a single physical N_Port as multiple N_Port IDs. NPIV provides
similar functionality for Fibre Channel Host Bus Adapters (HBAs) that SR-IOV provides for
PCIe interfaces. With NPIV, virtual machines can be provided with a virtual Fibre Channel
initiator to Storage Area Networks (SANs).
NPIV can provide high density virtualized environments with enterprise-level storage
solutions.
Note
For more information on NPIV, refer to the Red Hat Enterprise Linux 6 Virtualization
Administration Guide.
4.4. Guest CPU models
CPU models define which host CPU features are exposed to the guest operating system. q e mu - kvm
and l ib virt contain definitions for several current processor models, allowing users to enable CPU
features that are available only in newer CPU models. The set of CPU features that can be exposed to
guests depends on support in the host CPU, the kernel, and q emu - kvm code.
To allow safe migration of virtual machines between hosts with different sets of CPU features, q e mu -
kvm does not expose all features from the host CPU to guest operating systems by default. Instead,
CPU features are exposed based on the chosen CPU model. If a virtual machine has a given CPU
feature enabled, it is not possible to migrate it to a host that does not support exposing that feature to
guests.
Note
For more information on guest CPU models, refer to the Red Hat Enterprise Linux 6 Virtualization
Host Configuration and Guest Installation Guide.
4.5. St orage
Storage for virtual machines is abstracted from the physical storage used by the virtual machine. It is
attached to the virtual machine using the para-virtualized or emulated block device drivers.
Virt ualizat ion G et t ing St art ed G uide
20
4 .5.1. St orage pools
A storage pool is a file, directory, or storage device managed by l ib virt for the purpose of providing
storage to virtual machines. Storage pools are divided into storage volumes that store virtual
machine images or are attached to virtual machines as additional storage. Multiple guests can share
the same storage pool, allowing for better allocation of storage resources. Refer to the Red Hat
Enterprise Linux 6 Virtualization Administration Guide for more information.
Lo cal st o rag e p o o ls
Local storage pools are directly attached to the host server. They include local directories,
directly attached disks, physical partitions, and LVM volume groups on local devices. Local
storage pools are useful for development, testing and small deployments that do not require
migration or large numbers of virtual machines. Local storage pools may not be suitable for
many production environments as they do not support live migration.
Net wo rked ( sh ared ) st o rag e p o o ls
Networked storage pools include storage devices shared over a network using standard
protocols. Networked storage is required when migrating virtual machines between hosts
with virt - ma n ag er, but is optional when migrating with virsh. Networked storage pools
are managed by li b vi rt .
4 .5.2. St orage volumes
Storage pools are further divided into storage volumes. Storage volumes are an abstraction of
physical partitions, LVM logical volumes, file-based disk images and other storage types handled by
lib virt . Storage volumes are presented to virtual machines as local storage devices regardless of the
underlying hardware.
4 .5.3. Emulat ed st orage devices
The host emulates a range of storage devices that can be presented to virtual machines. Each type of
storage device is appropriate for specific use cases. Choice between different types of storage
devices allows for maximum flexibility and compatibility with guest operating systems.
virt io - scs i
virtio-scsi is the recommended para-virtualized storage device for guests using large
numbers of disks, or advanced storage features such as TRIM.
virt i o - b lk
virtio-blk is a para-virtualized storage device suitable for exposing image files to guests.
virtio-blk can provide the best disk I/O performance for virtual machines, but has fewer
features than virtio-scsi.
IDE
IDE is recommended for legacy guests that do not support virtio drivers. IDE performance is
lower than virtio-scsi or virtio-blk, but it is widely compatible with different systems.
C D- R O M
ATAPI CD-ROMs and virtio-scsi CD-ROMs are available for presenting ISO files or the host
CD-ROM drive to guests. virtio-scsi CD-ROMs can be used with guests that have the virtio-
scsi driver installed. ATAPI CD-ROMs offer wider compatibility but lower performance.
Chapt er 4 . Int roduct io n t o Red Hat virt ualizat ion product s
21
USB mass st o rag e d evices an d f lo p p y disks
USB mass storage devices and floppy disks are available when removable media is
required. USB mass storage devices are preferable to floppy disks due to their larger
capacity.
4 .5.4 . Host st orage
Disk images can be stored on a range of local and remote storage technologies connected to the
host.
Imag e f iles
Image files are stored on a host file system. The image files can be stored on a local file
system, such as ext4 or xfs, or a network file system, such as NFS.
Tools such as lib g u est f s can manage, back up, and monitor files. Disk image formats on
KVM include:
raw
Raw image files contain the contents of the disk with no additional metadata.
Raw files can either be pre-allocated or sparse, if the host file system allows it.
Sparse files allocate host disk space on demand, and are therefore a form of thin
provisioning. Pre-allocated files are fully provisioned but have higher
performance than sparse files.
Raw files are desirable when disk I/O performance is critical and transferring the
image file over a network is rarely necessary.
q co w2
qcow2 image files offer a number of advanced disk image features including
backing files, snapshots, compression, and encryption. They can be used to
instantiate virtual machines from template images.
qcow2 files are typically more efficient to transfer over a network, because only
sectors written by the virtual machine are allocated in the image.
LVM vo lu mes
Logical volumes can be used for disk images and managed using the system's LVM tools.
LVM offers higher performance than file systems because of its simpler block storage model.
LVM thin provisioning offers snapshots and efficient space usage for LVM volumes, and
can be used as an alternative to migrating to qcow2.
Ho st d evices
Host devices such as physical CD-ROMs and raw disks or logical unit numbers (LUNs) can
be presented to the guest. This allows a guest to use storage area network (SAN) or iSCSI
LUNs, as well as local CD-ROM media, with good performance.
Host devices can be used when storage management is done on a SAN instead of on
hosts.
Dist rib u t ed st o rag e syst ems
Gluster volumes can be used as disk images. This allows high-performance clustered
storage over the network.
Virt ualizat ion G et t ing St art ed G uide
22
Red Hat Enterprise Linux 6.5 and above includes native support for creating virtual
machines with GlusterFS. This enables a KVM host to boot virtual machine images from
GlusterFS volumes, and to use images from a GlusterFS volume as data disks for virtual
machines. When compared to GlusterFS FUSE, the native support in KVM delivers higher
performance.
Note
For more information on storage and virtualization, refer to the Red Hat Enterprise Linux 6
Virtualization Administration Guide.
Chapt er 4 . Int roduct io n t o Red Hat virt ualizat ion product s
23
Chapter 5. Virtualization Tools
This chapter provides an introduction to the many tools available to assist with virtualization.
5.1. vi rsh
virsh is a command line interface (CLI) tool for managing the hypervisor and guest virtual machines.
The virsh command line tool is built on the li b virt management API and operates as an alternative
to the qemu-kvm command and the graphical vi rt - ma n ag er application. The virsh command can
be used in read-only mode by unprivileged users or, with root access, full administrative
functionality. The virsh command is ideal for scripting virtualization administration. In addition the
virsh tool is a main management interface for virsh guest domains and can be used to create,
pause, and shut down domains, as well as list current domains. This tool is installed as part of the
libvirt-client package.
Note
Refer to the Red Hat Enterprise Linux 6 Virtualization Administration Guide for more information
about managing virtual machines with virsh.
5.2. virt-manager
virt-manager is a lightweight graphical tool for managing virtual machines. It provides the ability to
control the life cycle of existing machines, provision new machines, manage virtual networks, access
the graphical console of virtual machines, and view performance statistics. This tool ships in its own
package called virt-manager.
Note
Refer to the Red Hat Enterprise Linux 6 Virtualization Administration Guide for more information
about managing virtual machines with virt-manager.
5.3. vi rt-i nstal l
virt-install is a command line tool to provision new virtual machines. It supports both text-based and
graphical installations, using serial console, SDL, SPICE, or VNC client/server pair graphics.
Installation media can be local, or exist remotely on an NFS, HTTP, or FTP server. The tool can also
be configured to run unattended and kickstart the guest when installation is complete, allowing for
easy automation of installation. This tool is installed as part of the python-virtinst package.
Note
Refer to the Red Hat Enterprise Linux 6 Virtualization Host Configuration and Guest Installation Guide
for more information about vi rt-i nstal l .
Virt ualizat ion G et t ing St art ed G uide
24
5.4. guestfish
guestfish is a shell and command line tool for examining and modifying virtual machine disk images.
This tool uses libguestfs and exposes all functionality provided by the guestfs API.
Warning
Using guestfish on running virtual machines can cause disk-image corruption. Use the
guestfish command with the --ro (read-only) option if the disk image is being used by a
running virtual machine.
Note
Refer to the Red Hat Enterprise Linux 6 Virtualization Administration Guide for more information
about guestfish.
5.5. Ot her useful t ools
The following tools are used to access a guest virtual machine's disk via the host. The guest's disk is
usually accessed directly via the disk-image file located on the host. However it is sometimes
possible to gain access via the li b virt domain. The commands that follow are part of the lib virt
domain and are used to gain access to the guest's disk image.
guestmount
A command line tool used to mount virtual machine file systems and disk images on the
host machine.
Warning
Using guestmount in --r/w (read/write) mode to access a disk that is currently
being used by a guest can cause the disk to become corrupted. Do not use
guestmount in --r/w (read/write) mode on live virtual machines. Use the
guestmount command with the --ro (read-only) option if the disk image is being
used.
vi rt-cat
A command line tool that can be used to quickly view the contents of one or more files in a
specified virtual machine's disk or disk image. This tool is installed as part of the libguestfs-
tools package.
vi rt-d f
A command line tool used to show the actual physical disk usage of virtual machines,
similar to the command line tool d f. Note that this tool does not work across remote
connections. It is installed as part of the libguestfs-tools package.
Chapt er 5. Virt ualizat ion T ools
25
vi rt-ed i t
A command line tool used to edit files that exist on a specified virtual machine. This tool is
installed as part of the libguestfs-tools package.
Warning
Using vi rt-ed i t on live virtual machines can cause disk corruption in the virtual
machine. Although the vi rt-ed i t command will try to prevent users from editing
files on live virtual machines, it is not guaranteed to catch all instances. Do not use
vi rt-ed i t on a live virtual machine.
virt-filesystems
A command line tool used to discover file systems, partitions, logical volumes and their
sizes in a disk image or virtual machine. One common use is in shell scripts, to iterate over
all file systems in a disk image. This tool is installed as part of the libguestfs-tools package.
This tool replaces virt-list-filesystems and vi rt-l i st-parti ti o ns.
vi rt-i nspecto r
A command line tool that can examine a virtual machine or disk image to determine the
version of its operating system and other information. It can also produce XML output,
which can be piped into other programs. Note that vi rt-i nspecto r can only inspect one
domain at a time. This tool is installed as part of the libguestfs-tools package.
vi rt-i nspecto r2
An alternative tool to vi rt-i nspecto r, written in C. This tool is installed as part of the
libguestfs-tools package.
vi rt-l s
<