Red Hat Enterprise Linux 6

Virtualization Administration Guide

Managing your virtual environment

Laura Novich

Red Hat Engineering Content Services

Legal Notice

Copyright © 2013 Red Hat, Inc.
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.
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.
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.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack Logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.


The Virtualization Administration Guide covers administration of host physical machines, networking, storage, device and guest virtual machine management, and troubleshooting.
1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
2. Getting Help and Giving Feedback
2.1. Do You Need Help?
2.2. We Need Feedback!
1. Introduction
1.1. Virtualization Documentation Suite
2. Server best practices
3. Security for virtualization
3.1. Storage security issues
3.2. SELinux and virtualization
3.3. SELinux
3.4. Virtualization firewall information
4. sVirt
4.1. Security and Virtualization
4.2. sVirt labeling
5. KVM live migration
5.1. Live migration requirements
5.2. Live migration and Red Hat Enterprise Linux version compatibility
5.3. Shared storage example: NFS for a simple migration
5.4. Live KVM migration with virsh
5.4.1. Additional tips for migration with virsh
5.4.2. Additional options for the virsh migrate command
5.5. Migrating with virt-manager
6. Remote management of guests
6.1. Remote management with SSH
6.2. Remote management over TLS and SSL
6.3. Transport modes
7. Overcommitting with KVM
7.1. Introduction
7.2. Overcommitting virtualized CPUs
8. KSM
9. Advanced guest virtual machine administration
9.1. Control Groups (cgroups)
9.2. Hugepage support
9.3. Running Red Hat Enterprise Linux as a guest virtual machine on a Hyper-V hypervisor
10. Miscellaneous administration tasks
10.1. Automatically starting guest virtual machines
10.2. Guest virtual machine memory allocation
10.3. Assigning USB devices to guest virtual machines
10.4. Using qemu-img
10.5. Verifying virtualization extensions
10.6. Setting KVM processor affinities
10.7. Generating a new unique MAC address
10.8. Improving guest virtual machine response time
10.9. Disable SMART disk monitoring for guest virtual machines
10.10. Configuring a VNC Server
10.11. Gracefully shutting down guest virtual machines using virsh shutdown
10.12. Manipulating the libvirt-guests configuration settings
10.13. Virtual machine timer management with libvirt
10.14. Using PMU to monitor guest virtual machine performance
10.15. Guest virtual machine power management
10.16. QEMU guest virtual machine agent protocol
10.16.1. guest-sync
10.16.2. guest-sync-delimited
10.16.3. Creating a guest virtual machine disk backup
10.17. Setting a limit on device redirection
10.18. Dynamically changing a host physical machine or a network bridge that is attached to a virtual NIC
11. Storage concepts
11.1. Storage pools
11.2. Volumes
12. Storage pools
12.1. Creating storage pools
12.1.1. Disk-based storage pools
12.1.2. Partition-based storage pools
12.1.3. Directory-based storage pools
12.1.4. LVM-based storage pools
12.1.5. iSCSI-based storage pools
12.1.6. NFS-based storage pools
13. Volumes
13.1. Creating volumes
13.2. Cloning volumes
13.3. Adding storage devices to guests
13.3.1. Adding file based storage to a guest
13.3.2. Adding hard drives and other block devices to a guest
13.3.3. Managing storage controllers in a guest virtual machine
13.4. Deleting and removing volumes
14. Managing guest virtual machines with virsh
14.1. virsh command quick reference
14.2. Generic Commands
14.2.1. help
14.2.2. quit and exit
14.2.3. version
14.2.4. connect
14.2.5. Displaying basic information
14.3. Attaching and updating a device with virsh
14.4. NUMA node management
14.4.1. Displaying node information
14.4.2. Displaying a CPU list
14.4.3. Displaying CPU statistics
14.4.4. Suspending the host physical machine
14.4.5. Setting and displaying the node memory parameters
14.5. Creating a virtual machine XML dump (configuration file)
14.5.1. Adding multifunction PCI devices to KVM guest virtual machines
14.6. Suspending, resuming, saving and restoring a guest virtual machine
14.7. Shutting down, rebooting and force-shutdown of a guest virtual machine
14.8. Retrieving guest virtual machine information
14.9. Storage pool information
14.10. Displaying per-guest virtual machine information
14.11. Managing virtual networks
14.12. Migrating guest virtual machines with virsh
14.13. Managing snapshots
14.13.1. virsh snapshot create
14.13.2. snapshot-create-as-domain
14.13.3. snapshot-current-domain
14.13.4. snapshot-edit-domain
14.13.5. snapshot-info-domain
14.13.6. snapshot-list-domain
14.13.7. snapshot-dumpxml domain snapshot
14.13.8. snapshot-parent domain
14.13.9. snapshot-revert domain
14.13.10. snapshot-delete domain
14.14. Guest virtual machine CPU model configuration
14.14.1. Introduction
14.14.2. Learning about the host physical machine CPU model
14.14.3. Determining a compatible CPU model to suit a pool of host physical machines
14.15. Configuring the guest virtual machine CPU model
14.16. Managing resources for guest virtual machines
14.17. Setting schedule parameters
14.18. Disk I/O throttling
14.19. Display or set block I/O parameters
14.20. Setting network interface bandwidth parameters
14.21. Configuring memory Tuning
14.22. Converting QEMU arguments to domain XML
15. Managing guests with the Virtual Machine Manager (virt-manager)
15.1. Starting virt-manager
15.2. The Virtual Machine Manager main window
15.3. The virtual hardware details window
15.3.1. Attaching USB devices to a guest virtual machine
15.4. Virtual Machine graphical console
15.5. Adding a remote connection
15.6. Displaying guest details
15.7. Performance monitoring
15.8. Displaying CPU usage for guests
15.9. Displaying CPU usage for hosts
15.10. Displaying Disk I/O
15.11. Displaying Network I/O
16. Guest virtual machine disk access with offline tools
16.1. Introduction
16.2. Terminology
16.3. Installation
16.4. The guestfish shell
16.4.1. Viewing file systems with guestfish
16.4.2. Modifying files with guestfish
16.4.3. Other actions with guestfish
16.4.4. Shell scripting with guestfish
16.4.5. Augeas and libguestfs scripting
16.5. Other commands
16.6. virt-rescue: The rescue shell
16.6.1. Introduction
16.6.2. Running virt-rescue
16.7. virt-df: Monitoring disk usage
16.7.1. Introduction
16.7.2. Running virt-df
16.8. virt-resize: resizing guest virtual machines offline
16.8.1. Introduction
16.8.2. Expanding a disk image
16.9. virt-inspector: inspecting guest virtual machines
16.9.1. Introduction
16.9.2. Installation
16.9.3. Running virt-inspector
16.10. virt-win-reg: Reading and editing the Windows Registry
16.10.1. Introduction
16.10.2. Installation
16.10.3. Using virt-win-reg
16.11. Using the API from Programming Languages
16.11.1. Interaction with the API via a C program
16.12. Troubleshooting
16.13. Where to find further documentation
17. Using simple tools for guest virtual machine management
17.1. Using virt-viewer
17.2. remote-viewer
18. Virtual Networking
18.1. Virtual network switches
18.2. Network Address Translation
18.3. Networking protocols
18.3.1. DNS and DHCP
18.3.2. Routed mode
18.3.3. Isolated mode
18.4. The default configuration
18.5. Examples of common scenarios
18.5.1. Routed mode
18.5.2. NAT mode
18.5.3. Isolated mode
18.6. Managing a virtual network
18.7. Creating a virtual network
18.8. Attaching a virtual network to a guest
18.9. Directly attaching to physical interface
18.10. Applying network filtering
18.10.1. Introduction
18.10.2. Filtering chains
18.10.3. Filtering chain priorities
18.10.4. Usage of variables in filters
18.10.5. Automatic IP address detection and DHCP snooping
18.10.6. Reserved Variables
18.10.7. Element and attribute overview
18.10.8. References to other filters
18.10.9. Filter rules
18.10.10. Supported protocols
18.10.11. Advanced Filter Configuration Topics
18.10.12. Limitations
19. qemu-kvm Whitelist
19.1. Introduction
19.2. Basic options
19.3. Disk options
19.4. Display options
19.5. Network options
19.6. Device options
19.7. Linux/Multiboot boot
19.8. Expert options
19.9. Help and information options
19.10. Miscellaneous options
20. Manipulating the domain xml
20.1. General information and metadata
20.2. Operating system booting
20.2.1. BIOS bootloader
20.2.2. Host physical machine bootloader
20.2.3. Direct kernel boot
20.2.4. Container boot
20.3. SMBIOS system information
20.4. CPU allocation
20.5. CPU tuning
20.6. Memory backing
20.7. Memory tuning
20.8. NUMA node tuning
20.9. Block I/O tuning
20.10. Resource partitioning
20.11. CPU model and topology
20.11.1. Guest virtual machine NUMA topology
20.12. Events configuration
20.13. Power Management
20.14. Hypervisor features
20.15. Time keeping
20.16. Devices
20.16.1. Hard drives, floppy disks, CDROMs
20.16.2. Filesystems
20.16.3. Device addresses
20.16.4. Controllers
20.16.5. Device leases
20.16.6. Host physical machine device assignment
20.16.7. Redirected devices
20.16.8. Smartcard devices
20.16.9. Network interfaces
20.16.10. Input devices
20.16.11. Hub devices
20.16.12. Graphical framebuffers
20.16.13. Video devices
20.16.14. Consoles, serial, parallel, and channel devices
20.16.15. Guest virtual machine interfaces
20.16.16. Channel
20.16.17. Host physical machine interface
20.17. Sound devices
20.18. Watchdog device
20.19. Memory balloon device
20.20. TPM devices
20.21. Security label
20.22. Example domain XML configuration
21. Troubleshooting
21.1. Debugging and troubleshooting tools
21.2. Creating virsh dump files
21.3. kvm_stat
21.4. Troubleshooting with serial consoles
21.5. Virtualization log files
21.6. Loop device errors
21.7. Live Migration Errors
21.8. Enabling Intel VT-x and AMD-V virtualization hardware extensions in BIOS
21.9. KVM networking performance
21.10. Workaround for creating external snapshots with libvirt
21.11. Missing characters on guest console with Japanese keyboard
21.12. Known Windows XP guest issues
A. The Virtual Host Metrics Daemon (vhostmd)
B. Additional resources
B.1. Online resources
B.2. Installed documentation
C. Revision History