Product SiteDocumentation Site

Fedora Draft Documentation

Virtualization Deployment and Administration Guide

Virtualization Documentation

Edition 19.0.1

Laura Novich

Red Hat Engineering Content Services

Tahlia Richardson

Red Hat Engineering Content Services

Laura Bailey

Red Hat Engineering Content Services

Dayle Parker

Red Hat Engineering Content Services

Legal Notice

Copyright © 2013 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. The original authors of this document, and Red Hat, designate the Fedora Project as the "Attribution Party" for purposes of CC-BY-SA. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
For guidelines on the permitted uses of the Fedora trademarks, refer to https://fedoraproject.org/wiki/Legal:Trademark_guidelines.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
All other trademarks are the property of their respective owners.
Abstract
This guide included information on how to configure a Fedora machine as a virtualization host, and install and configure virtual machines under Fedora virtualization.
Note: This document is under development, is subject to substantial change, and is provided only as a preview. The included information and instructions should not be considered complete, and should be used with caution.

Preface
1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
2. We Need Feedback!
I. Deployment
1. Introduction
1.1. What is in this guide?
1.2. Virtualization Documentation Suite
2. System requirements
3. KVM guest virtual machine compatibility
3.1. Fedora 6 support limits
3.2. Supported CPU Models
3.2.1. Guest CPU models
4. Virtualization restrictions
4.1. KVM restrictions
4.2. Application restrictions
4.3. Other restrictions
5. Installing the virtualization packages
5.1. Configuring a Virtualization Host installation
5.2. Installing virtualization packages on an existing Fedora system
6. Guest virtual machine installation overview
6.1. Guest virtual machine prerequisites and considerations
6.2. Creating guests with virt-install
6.3. Creating guests with virt-manager
6.4. Installing guest virtual machines with PXE
7. Installing a Red Hat Enterprise Linux 6 guest virtual machine on a Red Hat Enterprise Linux 6 host
7.1. Creating a Red Hat Enterprise Linux 6 guest with local installation media
7.2. Creating a Red Hat Enterprise Linux 6 guest with a network installation tree
7.3. Creating a Red Hat Enterprise Linux 6 guest with PXE
8. Virtualizing Fedora on Other Platforms
8.1. On VMWare
8.2. On Hyper-V
9. Installing a fully-virtualized Windows guest
9.1. Using virt-install to create a guest
10. KVM Para-virtualized Drivers
10.1. Installing the KVM Windows para-virtualized drivers
10.2. Installing the drivers on an installed Windows guest virtual machine
10.3. Installing drivers during the Windows installation
10.4. Using the para-virtualized drivers with Red Hat Enterprise Linux 3.9 guests
10.5. Using KVM para-virtualized drivers for existing devices
10.6. Using KVM para-virtualized drivers for new devices
11. Network configuration
11.1. Network Address Translation (NAT) with libvirt
11.2. Disabling vhost-net
11.3. Bridged networking with libvirt
12. PCI device configuration
12.1. Assigning a PCI device with virsh
12.2. Assigning a PCI device with virt-manager
12.3. PCI device assignment with virt-install
12.4. Detaching an assigned PCI device
13. SR-IOV
13.1. Introduction
13.2. Using SR-IOV
13.3. Troubleshooting SR-IOV
14. KVM guest timing management
15. Network booting with libvirt
15.1. Preparing the boot server
15.1.1. Setting up a PXE boot server on a private libvirt network
15.2. Booting a guest using PXE
15.2.1. Using bridged networking
15.2.2. Using a private libvirt network
16. QEMU Guest Agent
16.1. Set Up Communication between Guest Agent and Host
II. Administration
17. Server best practices
18. Security for virtualization
18.1. Storage security issues
18.2. SELinux and virtualization
18.3. SELinux
18.4. Virtualization firewall information
19. sVirt
19.1. Security and Virtualization
19.2. sVirt labeling
20. KVM live migration
20.1. Live migration requirements
20.2. Live migration and Fedora version compatibility
20.3. Shared storage example: NFS for a simple migration
20.4. Live KVM migration with virsh
20.4.1. Additonal tips for migration with virsh
20.4.2. Additional options for the virsh migrate command
20.5. Migrating with virt-manager
21. Remote management of guests
21.1. Remote management with SSH
21.2. Remote management over TLS and SSL
21.3. Transport modes
22. Overcommitting with KVM
23. KSM
24. Advanced virtualization administration
24.1. Control Groups (cgroups)
24.2. Hugepage support
25. Miscellaneous administration tasks
25.1. Automatically starting guests
25.2. Guest memory allocation
25.3. Using qemu-img
25.4. Verifying virtualization extensions
25.5. Setting KVM processor affinities
25.6. Generating a new unique MAC address
25.7. Improving guest response time
25.8. Disable SMART disk monitoring for guests
25.9. Configuring a VNC Server
25.10. Gracefully shutting down guests
25.11. Virtual machine timer management with libvirt
25.12. Using PMU to monitor guest performance
25.13. Guest virtual machine power management
25.14. QEMU Guest Agent Protocol
25.14.1. guest-sync
25.14.2. guest-sync-delimited
25.15. Setting a limit on device redirection
25.16. Dynamically changing a host or a network bridge that is attached to a virtual NIC
26. Storage concepts
26.1. Storage pools
26.2. Volumes
27. Storage pools
27.1. Creating storage pools
27.1.1. Disk-based storage pools
27.1.2. Partition-based storage pools
27.1.3. Directory-based storage pools
27.1.4. LVM-based storage pools
27.1.5. iSCSI-based storage pools
27.1.6. NFS-based storage pools
28. Volumes
28.1. Creating volumes
28.2. Cloning volumes
28.3. Adding storage devices to guests
28.3.1. Adding file based storage to a guest
28.3.2. Adding hard drives and other block devices to a guest
28.3.3. Managing storage controllers in a guest
28.4. Deleting and removing volumes
29. The Virtual Host Metrics Daemon (vhostmd)
29.1. Installing vhostmd on the host
29.2. Configuration of vhostmd
29.3. Starting and stopping the daemon
29.4. Verifying that vhostmd is working from the host
29.5. Configuring guests to see the metrics
29.6. Using vm-dump-metrics in Fedora guests to verify operation
III. Appendicies
A. Troubleshooting
A.1. Debugging and troubleshooting tools
A.2. kvm_stat
A.3. Troubleshooting with serial consoles
A.4. Virtualization log files
A.5. Loop device errors
A.6. Live Migration Errors
A.7. Enabling Intel VT-x and AMD-V virtualization hardware extensions in BIOS
A.8. KVM networking performance
A.9. Missing characters on guest console with Japanese keyboard
A.10. Known Windows XP guest issues
B. Common libvirt errors and troubleshooting
B.1. libvirtd failed to start
B.2. The URI failed to connect to the hypervisor
B.2.1. Cannot read CA certificate
B.2.2. Failed to connect socket ... : Permission denied
B.2.3. Other connectivity errors
B.3. The guest virtual machine cannot be started: internal error guest CPU is not compatible with host CPU
B.4. Guest starting fails with error: monitor socket did not show up
B.5. Internal error cannot find character device (null)
B.6. Guest virtual machine booting stalls with error: No boot device
B.7. Virtual network default has not been started
B.8. PXE boot (or DHCP) on guest failed
B.9. Guest can reach outside network, but cannot reach host when using macvtap interface
B.10. Could not add rule to fixup DHCP response checksums on network 'default'
B.11. Unable to add bridge br0 port vnet0: No such device
B.12. Guest is unable to start with error: warning: could not open /dev/net/tun
B.13. Migration fails with Error: unable to resolve address
B.14. Migration fails with Unable to allow access for disk path: No such file or directory
B.15. No guest virtual machines are present when libvirtd is started
B.16. Unable to connect to server at 'host:16509': Connection refused ... error: failed to connect to the hypervisor
B.17. Common XML errors
B.17.1. Editing domain definition
B.17.2. XML syntax errors
B.17.3. Logic and configuration errors
C. NetKVM Driver Parameters
C.1. Configurable parameters for NetKVM
D. qemu-kvm Whitelist
D.1. Introduction
D.2. Basic options
D.3. Disk options
D.4. Display options
D.5. Network options
D.6. Device options
D.7. Linux/Multiboot boot
D.8. Expert options
D.9. Help and information options
D.10. Miscellaneous options
E. Managing guests with virsh
E.1. virsh command quick reference
E.2. Attaching and updating a device with virsh
E.3. Connecting to the hypervisor
E.4. Creating a virtual machine XML dump (configuration file)
E.4.1. Adding multifunction PCI devices to KVM guests
E.5. Suspending, resuming, saving and restoring a guest
E.6. Shutting down, rebooting and force-shutdown of a guest
E.7. Retrieving guest information
E.8. Retrieving node information
E.9. Storage pool information
E.10. Displaying per-guest information
E.11. Managing virtual networks
E.12. Migrating guests with virsh
E.13. Disk image management with live block copy
E.13.1. Using blockcommit to shorten a backing chain
E.13.2. Using blockpull to shorten a backing chain
E.13.3. Using blockresize to change the size of a domain path
E.14. Guest CPU model configuration
E.14.1. Introduction
E.14.2. Learning about the host CPU model
E.14.3. Determining a compatible CPU model to suit a pool of hosts
E.14.4. Configuring the guest CPU model
F. Managing guests with the Virtual Machine Manager (virt-manager)
F.1. Starting virt-manager
F.2. The Virtual Machine Manager main window
F.3. The virtual hardware details window
F.4. Virtual Machine graphical console
F.5. Adding a remote connection
F.6. Displaying guest details
F.7. Performance monitoring
F.8. Displaying CPU usage for guests
F.9. Displaying CPU usage for hosts
F.10. Displaying Disk I/O
F.11. Displaying Network I/O
G. Guest disk access with offline tools
G.1. Introduction
G.2. Terminology
G.3. Installation
G.4. The guestfish shell
G.4.1. Viewing file systems with guestfish
G.4.2. Modifying files with guestfish
G.4.3. Other actions with guestfish
G.4.4. Shell scripting with guestfish
G.4.5. Augeas and libguestfs scripting
G.5. Other commands
G.6. virt-rescue: The rescue shell
G.6.1. Introduction
G.6.2. Running virt-rescue
G.7. virt-df: Monitoring disk usage
G.7.1. Introduction
G.7.2. Running virt-df
G.8. virt-resize: resizing guests offline
G.8.1. Introduction
G.8.2. Expanding a disk image
G.9. virt-inspector: inspecting guests
G.9.1. Introduction
G.9.2. Installation
G.9.3. Running virt-inspector
G.10. virt-win-reg: Reading and editing the Windows Registry
G.10.1. Introduction
G.10.2. Installation
G.10.3. Using virt-win-reg
G.11. Using the API from Programming Languages
G.11.1. Interaction with the API via a C program
G.12. Troubleshooting
G.13. Where to find further documentation
H. Virtual Networking
H.1. Virtual network switches
H.2. Network Address Translation
H.3. Networking protocols
H.3.1. DNS and DHCP
H.3.2. Routed mode
H.3.3. Isolated mode
H.4. The default configuration
H.5. Examples of common scenarios
H.5.1. Routed mode
H.5.2. NAT mode
H.5.3. Isolated mode
H.6. Managing a virtual network
H.7. Creating a virtual network
H.8. Attaching a virtual network to a guest
H.9. Directly attaching to physical interface
H.10. Applying network filtering
H.10.1. Introduction
H.10.2. Filtering chains
H.10.3. Filtering chain priorities
H.10.4. Usage of variables in filters
H.10.5. Automatic IP address detection and DHCP snooping
H.10.6. Reserved Variables
H.10.7. Element and attribute overview
H.10.8. References to other filters
H.10.9. Filter rules
H.10.10. Supported protocols
H.10.11. Advanced Filter Configuration Topics
H.10.12. Limitations
I. Additional resources
I.1. Online resources
I.2. Installed documentation
J. Manipulating the domain xml
J.1. General information and metadata
J.2. Operating system booting
J.2.1. BIOS bootloader
J.2.2. Host bootloader
J.2.3. Direct kernel boot
J.2.4. Container boot
J.3. SMBIOS system information
J.4. CPU allocation
J.5. CPU tuning
J.6. Memory backing
J.7. Memory tuning
J.8. NUMA node tuning
J.9. Block I/O tuning
J.10. Resource partitioning
J.11. CPU model and topology
J.11.1. Guest NUMA topology
J.12. Events configuration
J.13. Power Management
J.14. Hypervisor features
J.15. Time keeping
J.16. Devices
J.16.1. Hard drives, floppy disks, CDROMs
J.16.2. Filesystems
J.16.3. Device addresses
J.16.4. Controllers
J.16.5. Device leases
J.16.6. Host device assignment
J.16.7. Redirected devices
J.16.8. Smartcard devices
J.16.9. Network interfaces
J.16.10. Input devices
J.16.11. Hub devices
J.16.12. Graphical framebuffers
J.16.13. Video devices
J.16.14. Consoles, serial, parallel, and channel devices
J.16.15. Guest interfaces
J.16.16. Channel
J.16.17. Host interface
J.17. Sound devices
J.18. Watchdog device
J.19. Memory balloon device
J.20. Random number generator device
J.21. TPM devices
J.22. Security label
J.23. Example domain XML configuration
K. Revision History