579
Laura Novich Scott Radvan Dayle Parker Tahlia Richardson Red Hat Enterprise Linux 7 Virtualization Deployment and Administration Guide Installing, configuring, and managing virtual machines on a Red Hat Enterprise Linux physical machine

Red_Hat_Enterprise_Linux-7-Virtualization_Deployment_and_Administration_Guide-en-US.pdf

Embed Size (px)

Citation preview

  • Laura Novich Scott Radvan Dayle ParkerTahlia Richardson

    Red Hat Enterprise Linux 7Virtualization Deployment andAdministration Guide

    Installing, configuring, and managing virtual machines on a Red HatEnterprise Linux physical machine

  • Red Hat Enterprise Linux 7 Virtualizat ion Deployment and Administrat ionGuide

    Installing, configuring, and managing virtual machines on a Red HatEnterprise Linux physical machine

    Laura NovichRed Hat Customer Content [email protected] RadvanRed Hat Customer Content [email protected] ParkerRed Hat Customer Content [email protected] RichardsonRed Hat Customer Content [email protected]

  • Legal NoticeCopyright 2015 Red Hat, Inc.This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0Unported License. If you distribute this document, o r a modified version o f it, you must provideattribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all RedHat trademarks must be removed.Red Hat, as the licensor o f this document, waives the right to enforce, and agrees not to assert,Section 4d o f CC-BY-SA to the fullest extent permitted by applicable law.Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the InfinityLogo, and RHCE are trademarks o f Red Hat, Inc., registered in the United States and o thercountries.Linux is the registered trademark o f Linus Torvalds in the United States and o ther countries.Java is a registered trademark o f Oracle and/or its affiliates.XFS is a trademark o f Silicon Graphics International Corp. or its subsidiaries in the UnitedStates and/or o ther countries.MySQL is a registered trademark o f MySQL AB in the United States, the European Union andother countries.Node.js is an o fficial trademark o f Joyent. Red Hat Software Collections is not fo rmallyrelated to or endorsed by the o fficial Joyent Node.js open source or commercial pro ject.The OpenStack Word Mark and OpenStack Logo are either registered trademarks/servicemarks or trademarks/service marks o f the OpenStack Foundation, in the United States and o thercountries 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 o ther trademarks are the property o f their respective owners.

    AbstractThis guide covers how to configure a Red Hat Enterprise Linux 7 host physical machine andhow to install and configure guest virtual machines using the KVM hypervisor. Other topicsinclude PCI device configuration, SR-IOV, networking, storage, device and guest virtual machinemanagement, as well as troubleshooting, compatibility and restrictions.

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Table of ContentsPart I. Deployment

    Chapt er 1 . Syst em requirement s1.1. Calculating amo unt o f swap sp ace1.2. KVM req uirements1.3. Sto rag e sup p o rt1.4. Verifying virtualizatio n extensio ns

    Chapt er 2 . KVM guest virt ual machine compat ibilit y2.1. Red Hat Enterp rise Linux 7 sup p o rt l imits2.2. Sup p o rted CPU Mo d els2.3. USB 3 / XHCI Sup p o rt

    Chapt er 3. Virt ualizat ion rest rict ions3.1. KVM restric tio ns3.2. Ap p licatio n restric tio ns3.3. O ther restric tio ns

    Chapt er 4 . Inst alling t he virt ualizat ion packages4.1. Co nfig uring a Virtualizatio n Ho st installatio n4.2. Install ing virtualizatio n p ackag es o n an existing Red Hat Enterp rise Linux system

    Chapt er 5. Guest virt ual machine inst allat ion overview5.1. Guest virtual machine p rereq uis ites and co nsid eratio ns5.2. Creating g uests with virt-install5.3. Creating g uests with virt-manag er5.4. Install ing g uest virtual machines with PXE

    Chapt er 6 . Inst alling a Red Hat Ent erprise Linux 7 guest virt ual machine on a Red Hat Ent erpriseLinux 7 host

    6 .1. Creating a Red Hat Enterp rise Linux 7 g uest with lo cal installatio n med ia6 .2. Creating a Red Hat Enterp rise Linux 7 g uest with a netwo rk installatio n tree6 .3. Creating a Red Hat Enterp rise Linux 7 g uest with PXE

    Chapt er 7 . Virt ualiz ing Red Hat Ent erprise Linux on Ot her Plat forms7.1. On VMware ESX7.2. On Hyp er-V

    Chapt er 8 . Inst alling a fully- virt ualized Windows guest8 .1. Using virt-install to create a g uest8 .2. Tip s fo r mo re effic iency with Wind o ws g uest virtual machines

    Chapt er 9 . KVM Para- virt ualized (virt io) Drivers9 .1. Install ing the KVM Wind o ws virtio d rivers9 .2. Install ing the d rivers o n an installed Wind o ws g uest virtual machine9 .3. Install ing d rivers d uring the Wind o ws installatio n9 .4. Using KVM virtio d rivers fo r existing d evices9 .5. Using KVM virtio d rivers fo r new d evices

    Chapt er 1 0 . Net work configurat ion10 .1. Netwo rk Ad d ress Translatio n (NAT) with l ib virt10 .2. Disab ling vho st-net10 .3. Enab ling vho st-net zero -co p y10 .4. Brid g ed netwo rking

    6

    77888

    1 0101013

    1 5151718

    1 91923

    2 525252734

    4 1415054

    595959

    6 16 16 2

    6 36 46 5738 28 3

    8 88 88 99 09 0

    T able of Cont ent s

    1

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Chapt er 1 1 . Overcommit t ing wit h KVM11.1. Intro d uctio n11.2. Overco mmitting Memo ry11.3. Overco mmitting virtualized CPUs

    Chapt er 1 2 . KVM guest t iming management12.1. Req uired p arameters fo r Red Hat Enterp rise Linux g uests12.2. Using the Real-Time Clo ck with Wind o ws Server 20 0 3 and Wind o ws XP g uests12.3. Using the Real-Time Clo ck with Wind o ws Server 20 0 8 , Wind o ws Server 20 0 8 R2, and Wind o ws7 g uests12.4. Steal time acco unting

    Chapt er 1 3. Net work boot ing wit h libvirt13.1. Prep aring the b o o t server13.2. Bo o ting a g uest us ing PXE

    Chapt er 1 4 . QEMU guest agent14.1. Setting up co mmunicatio n b etween g uest ag ent and ho st14.2. Using the QEMU g uest virtual machine ag ent14.3. Running the QEMU g uest ag ent o n a Wind o ws g uest

    Part II. Administ rat ion

    Chapt er 1 5. Securing t he host physical machine and improving performance15.1. Security Dep lo yment Plan15.2. Client access co ntro l

    Chapt er 1 6 . St orage pools16 .1. Disk-b ased sto rag e p o o ls16 .2. Partitio n-b ased sto rag e p o o ls16 .3. Directo ry-b ased sto rag e p o o ls16 .4. LVM-b ased sto rag e p o o ls16 .5. iSCSI-b ased sto rag e p o o ls16 .6 . NFS-b ased sto rag e p o o ls16 .7. Using NPIV virtual ad ap ters (vHBAs) with SCSI d evices

    Chapt er 1 7 . St orage Volumes17.1. Intro d uctio n17.2. Creating vo lumes17.3. Clo ning vo lumes17.4. Ad d ing sto rag e d evices to g uests17.5. Deleting and remo ving vo lumes

    Chapt er 1 8 . Using qemu- img18 .1. Checking the d isk imag e18 .2. Co mmitting chang es to an imag e18 .3. Co nverting an existing imag e to ano ther fo rmat18 .4. Creating and fo rmatting new imag es o r d evices18 .5. Disp laying imag e info rmatio n18 .6 . Re-b asing a b acking fi le o f an imag e18 .7. Re-s iz ing the d isk imag e18 .8 . Lis ting , creating , ap p lying , and d eleting a snap sho t18 .9 . Sup p o rted q emu-img fo rmats

    Chapt er 1 9 . KVM live migrat ion19 .1. Live mig ratio n req uirements19 .2. Live mig ratio n and Red Hat Enterp rise Linux vers io n co mp atib il i ty

    9 49 49 49 5

    9 79 8

    10 0

    10 010 0

    1 0 210 210 3

    1 0 510 510 610 8

    1 1 2

    1 1 3113114

    1 1 6118121128134143156159

    1 6 716 716 816 9170176

    1 7 717717717717817817817917918 0

    1 8 218 218 4

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    2

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    19 .2. Live mig ratio n and Red Hat Enterp rise Linux vers io n co mp atib il i ty19 .3. Shared sto rag e examp le: NFS fo r a s imp le mig ratio n19 .4. Live KVM mig ratio n with virsh19 .5. Mig rating with virt-manag er

    Chapt er 2 0 . Guest virt ual machine device configurat ion20 .1. PCI d evices20 .2. USB d evices20 .3. Co nfig uring d evice co ntro llers20 .4. Setting ad d resses fo r d evices20 .5. Rand o m numb er g enerato r d evice20 .6 . Assig ning GPU d evices

    Chapt er 2 1 . SR- IOV21.1. Ad vantag es o f SR-IOV21.2. Using SR-IOV21.3. Tro ub lesho o ting SR-IOV

    Chapt er 2 2 . Virt ual Net working22.1. Virtual netwo rk switches22.2. Netwo rk Ad d ress Translatio n22.3. Netwo rking p ro to co ls22.4. The d efault co nfig uratio n22.5. Examp les o f co mmo n scenario s22.6 . Manag ing a virtual netwo rk22.7. Creating a virtual netwo rk22.8 . Attaching a virtual netwo rk to a g uest22.9 . Directly attaching to p hysical interface22.10 . Dynamically chang ing a ho st p hysical machine o r a netwo rk b rid g e that is attached to a virtualNIC22.11. Ap p lying netwo rk fi l tering22.12. Creating Tunnels22.13. Setting vLAN tag s22.14. Ap p lying Qo S to yo ur virtual netwo rk

    Chapt er 2 3. Remot e management of guest s23.1. Remo te manag ement with SSH23.2. Remo te manag ement o ver TLS and SSL23.3. Transp o rt mo d es23.4. Co nfig uring a VNC Server

    Chapt er 2 4 . KSM24.1. The KSM service24.2. The KSM tuning service24.3. KSM variab les and mo nito ring24.4. Deactivating KSM

    Chapt er 2 5. Managing guest s wit h t he Virt ual Machine Manager (virt - manager)25.1. Starting virt-manag er25.2. The Virtual Machine Manag er main wind o w25.3. The virtual hard ware d etails wind o w25.4. Virtual Machine g rap hical co nso le25.5. Ad d ing a remo te co nnectio n25.6 . Disp laying g uest d etails25.7. Perfo rmance mo nito ring25.8 . Disp laying CPU usag e fo r g uests

    18 418 518 619 1

    1 9 819 8215216220221224

    2 2 9230230236

    2 37237238239242242245246252256

    25825928 628 728 8

    2 8 928 929 129 429 7

    2 9 929 930 030 130 2

    30 330 330 430 5312313315322324

    T able of Cont ent s

    3

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    25.8 . Disp laying CPU usag e fo r g uests25.9 . Disp laying CPU usag e fo r ho sts25.10 . Disp laying Disk I/O25.11. Disp laying Netwo rk I/O

    Chapt er 2 6 . Managing guest virt ual machines wit h virsh26 .1. Generic Co mmand s26 .2. Attaching and up d ating a d evice with virsh26 .3. Attaching interface d evices26 .4. Chang ing the med ia o f a CDROM26 .5. Do main Co mmand s26 .6 . Ed iting a g uest virtual machine's co nfig uratio n fi le26 .7. NUMA no d e manag ement26 .8 . Starting , susp end ing , resuming , saving and resto ring a g uest virtual machine26 .9 . Shutting d o wn, reb o o ting and fo rce-shutd o wn o f a g uest virtual machine26 .10 . Retrieving g uest virtual machine info rmatio n26 .11. Sto rag e p o o l co mmand s26 .12. Sto rag e Vo lume Co mmand s26 .13. Disp laying p er-g uest virtual machine info rmatio n26 .14. Manag ing virtual netwo rks26 .15. Mig rating g uest virtual machines with virsh26 .16 . Interface Co mmand s26 .17. Manag ing snap sho ts26 .18 . Guest virtual machine CPU mo d el co nfig uratio n26 .19 . Co nfig uring the g uest virtual machine CPU mo d el26 .20 . Manag ing reso urces fo r g uest virtual machines26 .21. Setting sched ule p arameters26 .22. Disk I/O thro ttl ing26 .23. Disp lay o r set b lo ck I/O p arameters26 .24. Co nfig uring memo ry Tuning26 .25. Virtual Netwo rking Co mmand s

    Chapt er 2 7 . Guest virt ual machine disk access wit h offline t ools27.1. Intro d uctio n27.2. Termino lo g y27.3. Installatio n27.4. The g uestfish shell27.5. O ther co mmand s27.6 . virt-rescue: The rescue shell27.7. virt-d f: Mo nito ring d isk usag e27.8 . virt-res ize: res iz ing g uest virtual machines o ffl ine27.9 . virt-insp ecto r: insp ecting g uest virtual machines27.10 . virt-win-reg : Read ing and ed iting the Wind o ws Reg istry27.11. Using the API fro m Pro g ramming Lang uag es27.12. Using virt-sysp rep

    Chapt er 2 8 . Graphic User Int erface t ools for guest virt ual machine management28 .1. Using virt-viewer co mmand line28 .2. remo te-viewer28 .3. GNOME Bo xes

    Chapt er 2 9 . Manipulat ing t he domain XML29 .1. General info rmatio n and metad ata29 .2. Op erating system b o o ting29 .3. SMBIOS system info rmatio n

    324326328331

    33533533733833933935135535836 136 736 837037337938 038 038 238 739 039 139 239 339 339 339 4

    39 739 739 839 939 940 440 540 640 740 9411413417

    4 2 1421422423

    4 2 9429430434

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    4

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    29 .3. SMBIOS system info rmatio n29 .4. CPU allo catio n29 .5. CPU tuning29 .6 . Memo ry b acking29 .7. Memo ry tuning29 .8 . Memo ry allo catio n29 .9 . NUMA no d e tuning29 .10 . Blo ck I/O tuning29 .11. Reso urce p artitio ning29 .12. CPU mo d el and to p o lo g y29 .13. Events co nfig uratio n29 .14. Po wer Manag ement29 .15. Hyp erviso r features29 .16 . Time keep ing29 .17. Timer element attrib utes29 .18 . Devices29 .19 . Sto rag e p o o ls29 .20 . Sto rag e Vo lumes29 .21. Security lab el29 .22. A Samp le co nfig uratio n fi le

    Part III. Appendices

    T roubleshoot ingA.1. Deb ug g ing and tro ub lesho o ting to o lsA.2. Creating virsh d ump fi lesA.3. Cap turing trace d ata o n a co nstant b asis using the Systemtap fl ig ht reco rd erA.4. kvm_statA.5. Tro ub lesho o ting with serial co nso lesA.6 . Virtualizatio n lo g fi lesA.7. Lo o p d evice erro rsA.8 . Live Mig ratio n Erro rsA.9 . Enab ling Intel VT-x and AMD-V virtualizatio n hard ware extensio ns in BIOSA.10 . Generating a new uniq ue MAC ad d ressA.11. KVM netwo rking p erfo rmanceA.12. Wo rkaro und fo r creating external snap sho ts with l ib virtA.13. Miss ing characters o n g uest co nso le with Jap anese keyb o ardA.14. Guest virtual machine fails to shutd o wnA.15. Kno wn Wind o ws XP g uest issuesA.16 . Disab le SMART d isk mo nito ring fo r g uest virtual machinesA.17. l ib g uestfs tro ub lesho o tingA.18 . Co mmo n lib virt erro rs and tro ub lesho o ting

    Addit ional resourcesB.1. Online reso urcesB.2. Installed d o cumentatio n

    Net KVM Driver Paramet ersC.1. Co nfig urab le p arameters fo r NetKVM

    T he Virt ual Host Met rics Daemon (vhost md)

    Revision Hist ory

    43443443543743843943944044144144845045045145545650 7514518520

    52 1

    52 2522523524526531532532532532533534536536537537538538538

    56 756 756 7

    56 856 8

    57 2

    57 3

    T able of Cont ent s

    5

  • Part I. Deployment

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    6

  • Chapter 1. System requirementsThis chapter lists system requirements for running virtual machines, referred to as VMs. Virtualizationis available with the KVM hypervisor for Red Hat Enterprise Linux 7 on the Intel 64 and AMD64architectures.

    For information on installing the virtualization packages, see Chapter 4, Installing the virtualizationpackages.

    Minimum system requirements

    6 GB free disk space.

    2 GB RAM.

    Recommended system requirements

    One core or thread for each virtualized CPU and one for the host.

    2 GB of RAM plus additional RAM for virtual machines.

    6 GB disk space for the host, plus the required disk space for the virtual machine(s).

    Most guest operating systems require at least 6GB of disk space. Additional storage space foreach guest depends on their workload.

    When using raw image files, the total disk space required is equal to or greater than the sum of thespace required by the image files, the 6 GB of space required by the host operating system, andthe swap space for the guest.

    Equat ion 1.1. Calculat ing required space for guest virtual machines using rawimages

    total for raw format = images + hostspace + swap

    For qcow images, you must also calculate the expected maximum storage requirements of theguest (total for qcow format), as qcow and qcow2 images are able to grow as required.To allow for this expansion, first multiply the expected maximum storage requirements of the guest(expected maximum guest storage) by 1.01, and add to this the space required by the host(host), and the necessary swap space (swap).

    Equat ion 1.2. Calculat ing required space for guest virtual machines using qcowimages

    total for qcow format = (expected maximum guest storage * 1.01) + host + swap

    Guest virtual machine requirements are further outlined in Chapter 11, Overcommitting with KVM.

    1.1. Calculat ing amount of swap space

    Chapt er 1 . Syst em requirement s

    7

  • Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needsmore memory resources and the RAM is full, inactive pages in memory are moved to the swap space.While swap space can help machines with a small amount of RAM, it should not be considered areplacement for more RAM. Swap space is located on hard drives, which have a slower access timethan physical memory. The size of your swap partition can be calculated from the physical RAM ofthe host. The Red Hat Customer Portal contains an article on safely and efficiently determining thesize of the swap partition: https://access.redhat.com/site/solutions/15244.

    1.2. KVM requirementsThe KVM hypervisor requires:

    an Intel processor with the Intel VT-x and Intel 64 extensions for x86-based systems; or

    an AMD processor with the AMD-V and the AMD64 extensions.

    See Section 1.4, Verifying virtualization extensions to determine if your processor has thevirtualization extensions.

    1.3. Storage supportThe supported storage methods for VMs ar:

    files on local storage,

    physical disk partitions,

    locally connected physical LUNs,

    LVM partitions,

    NFS shared file systems,

    iSCSI,

    GFS2 clustered file systems,

    Fibre Channel-based LUNs, and

    Fibre Channel over Ethernet (FCoE).

    1.4 . Verifying virtualizat ion extensionsUse this section to determine whether your system has the hardware virtualization extensions, andthat they are enabled. Virtualization extensions (Intel VT-x or AMD-V) are required for fullvirtualization.

    1. Run the following command to verify the CPU virtualization extensions are available:

    $ grep -E 'svm|vmx' /proc/cpuinfo

    2. Analyze the output:

    The following example output contains a vmx entry, indicating an Intel processor with theIntel VT-x extension:

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    8

  • flags : fpu tsc msr pae mce cx8 vmx apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc pni monitor ds_cplvmx est tm2 cx16 xtpr lahf_lm

    The following example output contains an svm entry, indicating an AMD processor withthe AMD-V extensions:

    flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflushmmx fxsr sse sse2 ht syscall nx mmxext svm fxsr_opt lm 3dnowext 3dnow pni cx16lahf_lm cmp_legacy svm cr8legacy ts fid vid ttp tm stc

    If any output is received from the command previously shown, the processor has thehardware virtualization extensions. In some circumstances, manufacturers disable thevirtualization extensions in the BIOS. If the extensions do not appear or full virtualizationdoes not work, see Procedure A.3, Enabling virtualization extensions in BIOS forinstructions on enabling the extensions in your BIOS configuration utility.

    3. Ensure the KVM kernel modules are loaded

    As an additional check, verify that the kvm modules are loaded in the kernel with the followingcommand:

    # lsmod | grep kvm

    If the output includes kvm_intel or kvm_amd , then the kvm hardware virtualization modulesare loaded.

    NoteThe virsh utility (provided by the libvirt-client package) can output a full list of your system'svirtualization capabilities with the following command:

    # virsh capabilities

    Chapt er 1 . Syst em requirement s

    9

  • Chapter 2. KVM guest virtual machine compatibilityTo verify whether your processor supports the virtualization extensions and for information onenabling the virtualization extensions if they are disabled, refer to Section 1.4, Verifyingvirtualization extensions .

    2.1. Red Hat Enterprise Linux 7 support limitsRed Hat Enterprise Linux 7 servers have certain support limits.

    The following URLs explain the processor and memory amount limitations for Red Hat EnterpriseLinux:

    For host systems: https://access.redhat.com/articles/rhel-limits

    For KVM hypervisors: https://access.redhat.com/articles/rhel-kvm-limits

    The following URL is a complete reference showing supported operating systems and host and guestcombinations:

    https://access.redhat.com/certified-hypervisors

    2.2. Supported CPU ModelsEvery hypervisor has its own policy for which CPU features the guest will see by default. The set ofCPU features presented to the guest by the hypervisor depends on the CPU model chosen in theguest virtual machine configuration.

    NoteA full list of supported CPU models can also be found using the virsh cpu-modelscommand as shown in Section 2.2.1, Listing the guest CPU models . Additional information isalso included in Section 29.12, CPU model and topology . The host model can be configuredto be using a specified feature set as needed. For information, refer to Section 29.12.1,Changing the feature set for a specified CPU .

    2.2.1. List ing the guest CPU modelsTo find out the CPU models supported for a given architecture type, run the virsh cpu-models command. For example:

    $ virsh cpu-models x86_64486pentiumpentium2pentium3pentiumprocoreduon270core2duoqemu32kvm32

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    10

  • cpu64-rhel5cpu64-rhel6kvm64qemu64ConroePenrynNehalemWestmereSandyBridgeHaswellathlonphenomOpteron_G1Opteron_G2Opteron_G3Opteron_G4Opteron_G5

    $ virsh cpu-models ppc64POWER7POWER7_v2.1POWER7_v2.3POWER7+_v2.1POWER8_v1.0

    In order to view the full list of supported CPU models and features, you will need to open the XML filecontaining that information. The file is titled cpu_map.xml and is located in /usr/share/libvirt/. To see the contents, run cat /usr/share/libvirt/cpu_map.xml . Tochange your guest's CPU model and features you will need to look at the section in thedomain XML file (Refer to Section 29.12, CPU model and topology ).

    # gedit /usr/share/libvirt/cpu_map.xml

    You can subsititute gedit with another editor if you would like. The file that opens resemblesFigure 2.1, cpu_map.xml file partial contents but is much longer.

    ...

    Chapt er 2 . KVM guest virt ual machine compat ibilit y

    11

  • Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    12

  • Figure 2.1. cpu_map.xml f ile part ial contents

    2.3. USB 3 / XHCI Support

    Chapt er 2 . KVM guest virt ual machine compat ibilit y

    13

  • USB 3 (XHCI) USB host adapter emulation is supported in Red Hat Enterprise Linux 7. All USBspeeds are supported, meaning any generation of USB device can be plugged into a XHCI bus.Additionally, no companion controllers (for USB 1 devices) are required.

    Advantages of XHCI:

    Virtualization-compatible hardware design, meaning XHCI emulation requires less CPU resourcesthan previous versions due to reduced polling overhead.

    USB passthrough of USB 3 devices is available.

    Limitations of XHCI:

    Does not work with Windows guests older than Windows 8.

    Not supported for Red Hat Enterprise Linux 5 guests.

    See Figure 20.15, Domain XML example for USB3/XHCI devices for a domain XML device examplefor XHCI devices.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    14

  • Chapter 3. Virtualization restrictionsThis chapter covers additional support and product restrictions of the virtualization packages in RedHat Enterprise Linux 7.

    3.1. KVM rest rict ionsThe following restrictions apply to the KVM hypervisor:

    Maximum vCPUs per guestRed Hat Enterprise Linux 7.1 increases the amount of vCPUs per guest to 240, up from 160in 7.0.

    Nested virtualiz at ionNested virtualization is disabled by default in Red Hat Enterprise Linux 7. Running a guestvirtual machine within a guest virtual machine is not supported by Red Hat.

    Constant TSC bitSystems without a Constant Time Stamp Counter require additional configuration. Refer toChapter 12, KVM guest timing management for details on determining whether you have aConstant Time Stamp Counter and configuration steps for fixing any related issues.

    Memory overcommitKVM supports memory overcommit and can store the memory of guest virtual machines inswap. A virtual machine will run slower if it is swapped frequently. The Red Hat CustomerPortal has an article on safely and efficiently determining the size of the swap partition,available here: https://access.redhat.com/site/solutions/15244. When KSM is used formemory overcommitting, make sure that the swap size follows the recommendationsdescribed in this article.

    ImportantWhen device assignment is in use, all virtual machine memory must be statically pre-allocated to enable DMA with the assigned device. Memory overcommit is thereforenot supported with device assignment.

    CPU overcommitIt is not recommended to have more than 10 virtual CPUs per physical processor core.Customers are encouraged to use a capacity planning tool in order to determine the CPUovercommit ratio. Estimating an ideal ratio is difficult as it is highly dependent on eachworkload. For instance, a guest virtual machine may consume 100% CPU on one use case,and multiple guests may be completely idle on another.

    Red Hat does not support running more vCPUs to a single guest than the amount of overallphysical cores that exist on the system. While Hyperthreads can be considered as cores,their performance can also vary from one scenario to the next, and they should not beexpected to perform as well as regular cores.

    Refer to Section 11.3, Overcommitting virtualized CPUs for tips and recommendations onovercommitting CPUs.

    Chapt er 3. Virt ualizat ion rest rict ions

    15

  • Virtualiz ed SCSI devicesSCSI emulation is not supported with KVM in Red Hat Enterprise Linux.

    Virtualiz ed IDE devicesKVM is limited to a maximum of four virtualized (emulated) IDE devices per guest virtualmachine.

    Para-virtualiz ed devicesPara-virtualized devices are also known as Virtio devices. They are purely virtual devicesdesigned to work optimally in a virtual machine.

    Red Hat Enterprise Linux 7 supports 32 PCI device slots per virtual machine, and 8 PCIfunctions per device slot. This gives a theoretical maximum of 256 PCI functions per guestwhen multi-function capabilities are enabled, and PCI bridges are used. Refer toSection 20.1.5, Creating PCI bridges for more information on PCI bridges andChapter 20, Guest virtual machine device configuration for more information on devices.

    Migrat ion rest rict ionsDevice assignment refers to physical devices that have been exposed to a virtual machine,for the exclusive use of that virtual machine. Because device assignment uses hardware onthe specific host where the virtual machine runs, migration and save/restore are notsupported when device assignment is in use. If the guest operating system supports hot-plugging, assigned devices can be removed prior to the migration or save/restore operationto enable this feature.

    Live migration is only possible between hosts with the same CPU type (that is, Intel to Intelor AMD to AMD only).

    For live migration, both hosts must have the same value set for the No eXecution (NX) bit,either on or off.

    For migration to work, cache=none must be specified for all block devices opened in writemode.

    WarningFailing to include the cache=none option can result in disk corruption.

    Storage rest rict ionsThere are risks associated with giving guest virtual machines write access to entire disks orblock devices (such as /dev/sdb). If a guest virtual machine has access to an entire blockdevice, it can share any volume label or partition table with the host machine. If bugs existin the host system's partition recognition code, this can create a security risk. Avoid this riskby configuring the host machine to ignore devices assigned to a guest virtual machine.

    WarningFailing to adhere to storage restrictions can result in risks to security.

    SR- IOV rest rict ions

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    16

  • SR-IOV is only thoroughly tested with the following devices (other SR-IOV devices may workbut have not been tested at the time of release):

    Intel 82576NS Gigabit Ethernet Controller (igb driver)

    Intel 82576EB Gigabit Ethernet Controller (igb driver)

    Intel 82599ES 10 Gigabit Ethernet Controller (ixgbe driver)

    Intel 82599EB 10 Gigabit Ethernet Controller (ixgbe driver)

    Core dumping rest rict ionsBecause core dumping is currently implemented on top of migration, it is not supportedwhen device assignment is in use.

    PCI device assignment rest rict ionsPCI device assignment (attaching PCI devices to virtual machines) requires host systems tohave AMD IOMMU or Intel VT-d support to enable device assignment of PCI-e devices.

    For parallel/legacy PCI, only single devices behind a PCI bridge are supported.

    Red Hat Enterprise Linux 7 has limited PCI configuration space access by guest devicedrivers. This limitation could cause drivers that are dependent on PCI configuration spaceto fail configuration.

    Platform support for interrupt remapping is required to fully isolate a guest with assigneddevices from the host. Without such support, the host may be vulnerable to interruptinjection attacks from a malicious guest. In an environment where guests are trusted, theadmin may opt-in to still allow PCI device assignment using the allow_unsafe_interrupts option to the vfio_iommu_type1 module. This may eitherbe done persistently by adding a .conf file (e.g. local.conf) to /etc/modprobe.dcontaining the following:

    options vfio_iommu_type1 allow_unsafe_interrupts=1

    or dynamically using the sysfs entry to do the same:

    # echo 1 > /sys/module/vfio_iommu_type1/parameters/allow_unsafe_interrupts

    3.2. Applicat ion rest rict ionsThere are aspects of virtualization which make it unsuitable for certain types of applications.

    Applications with high I/O throughput requirements should use KVM's para-virtualized drivers (virtiodrivers) for fully-virtualized guests. Without the virtio drivers certain applications may beunpredictable under heavy I/O loads.

    The following applications should be avoided due to high I/O requirements:

    kdump server

    netdump server

    You should carefully evaluate applications and tools that heavily utilize I/O or those that require real-time performance. Consider the virtio drivers or PCI device assignment for increased I/O performance.

    Chapt er 3. Virt ualizat ion rest rict ions

    17

  • Refer to Chapter 9, KVM Para-virtualized (virtio) Drivers for more information on the virtio drivers for fullyvirtualized guests. Refer to Chapter 20, Guest virtual machine device configuration for more informationon PCI device assignment.

    Applications suffer a small performance loss from running in virtualized environments. Theperformance benefits of virtualization through consolidating to newer and faster hardware should beevaluated against the potential application performance issues associated with using virtualization.

    3.3. Other rest rict ionsFor the list of all other restrictions and issues affecting virtualization read the Red Hat Enterprise Linux7 Release Notes. The Red Hat Enterprise Linux 7 Release Notes cover the present new features, knownissues and restrictions as they are updated or discovered.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    18

  • Chapter 4. Installing the virtualization packagesBefore you can use virtualization, the virtualization packages must be installed on your computer.Virtualization packages can be installed either during the host installation sequence or after hostinstallation using the yum command and Subscription Manager.

    The KVM hypervisor uses the default Red Hat Enterprise Linux kernel with the kvm kernel module.

    4.1. Configuring a Virtualizat ion Host installat ionThis section covers installing virtualization tools and virtualization packages as part of a fresh RedHat Enterprise Linux installation.

    NoteThe Red Hat Enterprise Linux Installation Guide, available fromhttps://access.redhat.com/site/documentation/Red_Hat_Enterprise_Linux/, covers installingRed Hat Enterprise Linux in detail.

    Procedure 4 .1. Installing the virtualiz at ion package group

    1. Launch the Red Hat Enterprise Linux 7 installat ion program

    Start an interactive Red Hat Enterprise Linux 7 installation from the Red Hat Enterprise LinuxInstallation CD-ROM, DVD or PXE.

    2. Cont inue installat ion up to sof tware select ion

    Complete the other steps up to the software selection step. The Installation Summaryscreen prompts the user to complete any steps still requiring attention.

    Chapt er 4 . Inst alling t he virt ualizat ion packages

    19

  • Figure 4 .1. The Installat ion Summary screen

    Software Selection defaults to Minimal Install. Open the Software Selection screento select the virtualization packages instead.

    3. Select the server type and package groups

    Red Hat Enterprise Linux 7 has two available options for installing a virtualization host: aminimal virtualization host with only the basic packages installed (Step 3.a), or avirtualization host with packages installed to allow management of guests through agraphical user interface (Step 3.b).

    a.

    Select ing a min imal virtualiz at ion host

    Select the Virtualization Host radio button under Base Environment, andthe Virtualization Platform checkbox under Add-Ons for Selected Environment. This installs a basic virtualization environment which can be run with virsh, or remotely over the network.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    20

  • Figure 4 .2. Virtualiz at ion Host selected in the sof tware select ion screen

    b.

    Select ing a virtualiz at ion host with a graphical user in terface

    Select the Server with GUI radio button under Base Environment, and thecheckboxes for Virtualization Client, Virtualization Hypervisor, and Virtualization Tools under Add-Ons for Selected Environment. Thisinstalls a virtualization environment along with graphical tools for installing andmanaging guest virtual machines.

    Chapt er 4 . Inst alling t he virt ualizat ion packages

    21

  • Figure 4 .3. Server with GUI selected in the sof tware select ion screen

    4. Finaliz e installat ion

    On the Installation Summary screen, complete the steps as necessary and click Begin Installtion.

    When the installation is complete, reboot the system.

    ImportantYou require a valid virtualization entitlement to receive updates for the virtualization packages.

    Installing KVM packages with Kickstart f i les

    Kickstart files allow for large, automated installations without a user manually installing eachindividual host system. This section describes how to create and use a Kickstart file to install Red HatEnterprise Linux with the Virtualization packages.

    In the %packages section of your Kickstart file, append the following package groups:

    @virtualization-hypervisor@virtualization-client@virtualization-platform@virtualization-tools

    For more information about Kickstart files, refer to the Red Hat Enterprise Linux Installation Guide,available from https://access.redhat.com/site/documentation/Red_Hat_Enterprise_Linux/.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    22

  • 4.2. Installing virtualizat ion packages on an exist ing Red HatEnterprise Linux systemThis section describes the steps for installing the KVM hypervisor on a working Red Hat EnterpriseLinux 7 or newer system.

    To install the packages, your machines must be registered. To register via Red Hat SubscriptionManager, run the subscription-manager register command and follow the prompts.

    If you do not have a valid Red Hat subscription, visit the Red Hat online store to obtain one.

    Installing the virtualiz at ion packages with yum

    To use virtualization on Red Hat Enterprise Linux you require at least the qemu-kvm and qemu-imgpackages. These packages provide the user-level KVM emulator and disk image manager on thehost Red Hat Enterprise Linux system.

    To install the qemu-kvm and qemu-img packages, run the following command:

    # yum install qemu-kvm qemu-img

    Several additional virtualization management packages are also available:

    Recommended virtualiz at ion packages

    virt-installProvides the virt-install command for creating virtual machines.

    libvirtThe libvirt package provides the server and host side libraries for interacting withhypervisors and host systems. The libvirt package provides the libvirtd daemon thathandles the library calls, manages virtual machines and controls the hypervisor.

    libvirt-pythonThe libvirt-python package contains a module that permits applications written in the Pythonprogramming language to use the interface supplied by the libvirt API.

    virt-managervirt-manager, also known as Virtual Machine Manager, provides a graphical tool foradministering virtual machines. It uses libvirt-client library as the management API.

    libvirt-clientThe libvirt-client package provides the client-side APIs and libraries for accessing libvirtservers. The libvirt-client package includes the virsh command line tool to manage andcontrol virtual machines and hypervisors from the command line or a special virtualizationshell.

    Install all of these recommended virtualization packages with the following command:

    # yum install virt-manager libvirt libvirt-python python-virtinst libvirt-client

    Chapt er 4 . Inst alling t he virt ualizat ion packages

    23

  • Installing Virtualiz at ion package groups

    The virtualization packages can also be installed from package groups. The following tabledescribes the virtualization package groups and what they provide.

    NoteNote that the qemu-img package is installed as a dependency of the Virtualizationpackage group if it is not already installed on the system. It can also be installed manuallywith the yum install qemu-img command as described previously.

    Table 4 .1. Virtualiz at ion Package Groups

    Package Group Descript ion MandatoryPackages

    Opt ional Packages

    VirtualizationHypervisor

    Smallest possiblevirtualization hostinstallation

    libvirt, qemu-kvm qemu-kvm-tools

    Virtualization Client Clients for installingand managingvirtualizationinstances

    gnome-boxes, virt-install, virt-manager,virt-viewer

    virt-top, libguestfs-tools, libguestfs-tools-c

    Virtualization Platform Provides an interfacefor accessing andcontrolling virtualmachines andcontainers

    libvirt, libvirt-client, virt-who

    fence-virtd-libvirt,fence-virtd-multicast,fence-virtd-serial,libvirt-cim, libvirt-java,libvirt-snmp, perl-Sys-Virt

    Virtualization Tools Tools for offline virtualimage management

    libguestfs libguestfs-java,libguestfs-tools,libguestfs-tools-c

    To install a package group, run the yum groupinstall groupname command. For instance, toinstall the Virtualiz at ion Tools package group, run the yum groupinstall "Virtualization Tools" command.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    24

  • Chapter 5. Guest virtual machine installation overviewAfter you have installed the virtualization packages on the host system you can create guestoperating systems. This chapter describes the general processes for installing guest operatingsystems on virtual machines. You can create guest virtual machines using the New button in virt -manager or use the command line interface virt-install . Both methods are covered by thischapter.

    Detailed installation instructions are available in the following chapters for specific versions of RedHat Enterprise Linux and Microsoft Windows.

    5.1. Guest virtual machine prerequisit es and considerat ionsVarious factors should be considered before creating any guest virtual machines. Not only shouldthe role of a virtual machine be considered before deployment, but regular ongoing monitoring andassessment based on variable factors (load, amount of clients) should be performed. Some factorsinclude:

    PerformanceGuest virtual machines should be deployed and configured based on their intended tasks.Some guest systems (for instance, guests running a database server) may require specialperformance considerations. Guests may require more assigned CPUs or memory based ontheir role and projected system load.

    Input /Output requirements and types of Input /OutputSome guest virtual machines may have a particularly high I/O requirement or may requirefurther considerations or projections based on the type of I/O (for instance, typical diskblock size access, or the amount of clients).

    StorageSome guest virtual machines may require higher priority access to storage or faster disktypes, or may require exclusive access to areas of storage. The amount of storage used byguests should also be regularly monitored and taken into account when deploying andmaintaining storage.

    Networking and network in f rast ructureDepending upon your environment, some guest virtual machines could require fasternetwork links than other guests. Bandwidth or latency are often factors when deploying andmaintaining guests, especially as requirements or load changes.

    Request requirementsSCSI requests can only be issued to guest virtual machines on virtio drives if the virtiodrives are backed by whole disks, and the disk device parameter is set to lun, as shown inthe following example:

    /usr/libexec/qemu-kvm

    5.2. Creat ing guests with virt -install

    Chapt er 5. Guest virt ual machine inst allat ion overview

    25

  • You can use the virt-install command to create guest virtual machines from the command line. virt-install is used either interactively or as part of a script to automate the creation of virtualmachines. Using virt-install with Kickstart files allows for unattended installation of virtualmachines.

    The virt-install tool provides a number of options that can be passed on the command line. Tosee a complete list of options run the following command:

    # virt-install --help

    Note that you need root privileges in order for virt-install commands to complete successfully.The virt-install man page also documents each command option and important variables.

    qemu-img is a related command which may be used before virt-install to configure storageoptions.

    An important option is the --graphics option which allows graphical installation of a virtualmachine.

    The following examples use a network bridge which must be created separately. See Section 10.4.2,Bridged networking with libvirt for details on creating a network bridge.

    Example 5.1. Using virt - install to install a Red Hat Enterprise Linux 6 guest virtualmachine

    This example creates a Red Hat Enterprise Linux 6 guest:

    virt-install \ --name=guest1-rhel6-64 \ --disk path=/var/lib/libvirt/images/guest1-rhel6-64.dsk,size=8,sparse=false,cache=none \ --graphics spice \ --vcpus=2 --ram=2048 \ --location=http://example1.com/installation_tree/RHEL6.4-Server-x86_64/os \ --network bridge=br0 \ --os-type=linux \ --os-variant=rhel6

    In Red Hat Enterprise Linux 7, the virtio-scsi controller is available for use in guests. If both the hostand guest support virtio-scsi, you can use it as follows:

    Example 5.2. Using virt - install to install a guest virtual machine with the virt io -scsicontro ller

    The items in bold are required on top of a standard installation in order to use the virtio-scsicontroller.

    virt-install \ --name=guest1-rhel6-64 \ --controller type=scsi,model=virtio-scsi \ --disk path=/var/lib/libvirt/images/guest1-rhel6-64.dsk,size=8,sparse=false,cache=none,bus=scsi \ --graphics spice \

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    26

  • --vcpus=2 --ram=2048 \ --location=http://example1.com/installation_tree/RHEL6.4-Server-x86_64/os \ --network bridge=br0 \ --os-type=linux \ --os-variant=rhel6

    Ensure that you select the correct os-type for your operating system when running this command.

    Refer to man virt-install for more examples.

    NoteWhen installing a Windows guest with virt-install , the --os-type=windows option isrecommended. This option prevents the CD-ROM from disconnecting when rebooting duringthe installation procedure. The --os-variant option further optimizes the configuration for aspecific guest operating system.

    5.3. Creat ing guests with virt -managervirt-manager, also known as Virtual Machine Manager, is a graphical tool for creating andmanaging guest virtual machines.

    Procedure 5.1. Creat ing a guest virtual machine with virt -manager

    1. Open virt -manager

    Start virt-manager. Launch the Virtual Machine Manager application from theApplicat ions menu and System Tools submenu. Alternatively, run the virt-managercommand as root.

    2. Opt ional: Open a remote hypervisor

    Select the hypervisor and click the Connect button to connect to the remote hypervisor.

    3. Create a new virtual machine

    The virt -manager window allows you to create a new virtual machine. Click the Create a new virtual machine button (Figure 5.1, Virtual Machine Manager window ) to open theNew VM wizard.

    Figure 5.1. Virtual Machine Manager window

    Chapt er 5. Guest virt ual machine inst allat ion overview

    27

  • The New VM wizard breaks down the virtual machine creation process into five steps:

    a. Naming the guest virtual machine and choosing the installation type

    b. Locating and configuring the installation media

    c. Configuring memory and CPU options

    d. Configuring the virtual machine's storage

    e. Configuring networking, architecture, and other hardware settings

    Ensure that virt-manager can access the installation media (whether locally or over thenetwork) before you continue.

    4. Specify name and installat ion type

    The guest virtual machine creation process starts with the selection of a name andinstallation type. Virtual machine names can have underscores (_), periods (. ), and hyphens(-).

    Figure 5.2. Name virtual machine and select installat ion method

    Type in a virtual machine name and choose an installation type:

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    28

  • Local install media ( ISO image or CDROM)This method uses a CD-ROM, DVD, or image of an installation disk (for example, .iso ).

    Network Install (HTTP, FTP, or NFS)This method involves the use of a mirrored Red Hat Enterprise Linux or Fedorainstallation tree to install a guest. The installation tree must be accessible througheither HTTP, FTP, or NFS.

    Network Boot (PXE)This method uses a Preboot eXecution Environment (PXE) server to install the guestvirtual machine. Setting up a PXE server is covered in the Deployment Guide. Toinstall via network boot, the guest must have a routable IP address or sharednetwork device. For information on the required networking configuration for PXEinstallation, refer to Section 5.4, Installing guest virtual machines with PXE .

    Import exist ing d isk imageThis method allows you to create a new guest virtual machine and import a diskimage (containing a pre-installed, bootable operating system) to it.

    Click Forward to continue.

    5. Conf igure installat ion

    Next, configure the OS type and Version of the installation. Ensure that you select theappropriate OS type for your virtual machine. Depending on the method of installation,provide the install URL or existing storage path.

    Chapt er 5. Guest virt ual machine inst allat ion overview

    29

  • Figure 5.3. Remote installat ion URL

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    30

  • Figure 5.4 . Local ISO image installat ion

    6. Conf igure CPU and memory

    The next step involves configuring the number of CPUs and amount of memory to allocate tothe virtual machine. The wizard shows the number of CPUs and amount of memory you canallocate; configure these settings and click Forward .

    Chapt er 5. Guest virt ual machine inst allat ion overview

    31

  • Figure 5.5. Conf iguring CPU and Memory

    7. Conf igure storage

    Assign storage to the guest virtual machine.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    32

  • Figure 5.6 . Conf iguring virtual storage

    If you chose to import an existing disk image during the first step, virt-manager will skipthis step.

    Assign sufficient space for your virtual machine and any applications it requires, then click Forward to continue.

    8. Final conf igurat ion

    Working with guests that are not Red Hat Enterprise Linux 7Any guest virtual machine that is of type Red Hat Enterprise Linux 5 or Red HatEnterprise Linux 4 will not be able to be installed using graphical mode. As such, youmust select "Cirrus" instead of "QXL" as a video card.

    Verify the settings of the virtual machine and click Finish when you are satisfied; doing sowill create the virtual machine with default networking settings, virtualization type, andarchitecture.

    Chapt er 5. Guest virt ual machine inst allat ion overview

    33

  • Figure 5.7. Verifying the conf igurat ion

    If you prefer to further configure the virtual machine's hardware first, check the Customiz econf igurat ion before install box first before clicking Finish. Doing so will open anotherwizard that will allow you to add, remove, and configure the virtual machine's hardwaresettings.

    After configuring the virtual machine's hardware, click Apply. virt-manager will then createthe virtual machine with your specified hardware settings.

    5.4 . Installing guest virtual machines with PXE

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    34

  • PXE guest installation requires a PXE server running on the same subnet as the guest virtualmachines you wish to install. The method of accomplishing this depends on how the virtualmachines are connected to the network. Contact Support if you require assistance setting up a PXEserver.

    5.4 .1. PXE installat ion with virt -installvirt-install PXE installations require both the --network=bridge:installationparameter, where installation is the name of your bridge, and the --pxe parameter.

    By default, if no network is found, the guest virtual machine attempts to boot from alternative bootabledevices. If there is no other bootable device found, the guest virtual machine pauses. You can usethe qemu-kvm boot parameter reboot-timeout to allow the guest to retry booting if no bootabledevice is found, like so:

    # qemu-kvm -boot reboot-timeout=1000

    Example 5.3. Fully-virtualiz ed PXE installat ion with virt - install

    # virt-install --hvm --connect qemu:///system \--network=bridge:installation --pxe --graphics spice \--name rhel6-machine --ram=756 --vcpus=4 \--os-type=linux --os-variant=rhel6 \--disk path=/var/lib/libvirt/images/rhel6-machine.img,size=10

    Note that the command above cannot be executed in a text-only environment. A fully-virtualized (--hvm) guest can only be installed in a text-only environment if the --location and --extra-args "console=console_type" are provided instead of the --graphics spice parameter.

    5.4 .2. PXE installat ion with virt -manager

    Procedure 5.2. PXE installat ion with virt -manager

    1.

    Select PXE

    Select PXE as the installation method and follow the rest of the steps to configure the OS type,memory, CPU and storage settings.

    Chapt er 5. Guest virt ual machine inst allat ion overview

    35

  • Figure 5.8. Select ing the installat ion method

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    36

  • Figure 5.9 . Select ing the installat ion type

    Chapt er 5. Guest virt ual machine inst allat ion overview

    37

  • Figure 5.10. Specifying virtualiz ed hardware details

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    38

  • Figure 5.11. Specifying storage details

    2.

    Start the installat ion

    The installation is ready to start.

    Chapt er 5. Guest virt ual machine inst allat ion overview

    39

  • Figure 5.12. Finaliz ing virtual machine details

    A DHCP request is sent and if a valid PXE server is found the guest virtual machine's installationprocesses will start.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    4 0

  • Chapter 6. Installing a Red Hat Enterprise Linux 7 guest virtualmachine on a Red Hat Enterprise Linux 7 hostThis chapter covers how to install a Red Hat Enterprise Linux 7 guest virtual machine on a Red HatEnterprise Linux 7 host.

    These procedures assume that the KVM hypervisor and all other required packages are installed andthe host is configured for virtualization.

    NoteFor more information on installing the virtualization packages, refer to Chapter 4, Installing thevirtualization packages.

    6.1. Creat ing a Red Hat Enterprise Linux 7 guest with local installat ionmediaThis procedure covers creating a Red Hat Enterprise Linux 7 guest virtual machine with a locallystored installation DVD or DVD image. DVD images are available from http://access.redhat.com forRed Hat Enterprise Linux 7.

    Procedure 6 .1. Creat ing a Red Hat Enterprise Linux 7 guest virtual machine with virt -manager

    1. Opt ional: Preparat ion

    Prepare the storage environment for the virtual machine. For more information on preparingstorage, refer to Chapter 16, Storage pools.

    ImportantVarious storage types may be used for storing guest virtual machines. However, for avirtual machine to be able to use migration features the virtual machine must becreated on networked storage.

    Red Hat Enterprise Linux 7 requires at least 1GB of storage space. However, Red Hatrecommends at least 5GB of storage space for a Red Hat Enterprise Linux 7 installation andfor the procedures in this guide.

    2. Open virt -manager and start the wiz ard

    Open virt-manager by executing the virt-manager command as root or opening Applications System Tools Virtual Machine Manager.

    Chapt er 6 . Inst alling a Red Hat Ent erprise Linux 7 guest virt ual machine on a Red Hat Ent erprise Linux 7 host

    4 1

  • Figure 6 .1. The Virtual Machine Manager window

    Click on the Create a new virtual machine button to start the new virtualized guestwizard.

    Figure 6 .2. The Create a new virtual machine but ton

    The New VM window opens.

    3. Name the virtual machine

    Virtual machine names can contain letters, numbers and the following characters: '_' , '. ' and'-' . Virtual machine names must be unique for migration and cannot consist only of numbers.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    4 2

  • Choose the Local install media (ISO image or CDROM) radio button.

    Figure 6 .3. The New VM window - Step 1

    Click Forward to continue.

    4. Select the installat ion media

    Select the appropriate radio button for your installation media.

    Chapt er 6 . Inst alling a Red Hat Ent erprise Linux 7 guest virt ual machine on a Red Hat Ent erprise Linux 7 host

    4 3

  • Figure 6 .4 . Locate your install media

    A. If you wish to install from a CD-ROM or DVD, select the Use CDROM or DVD radiobutton, and select the appropriate disk drive from the drop-down list of drives available.

    B. If you wish to install from an ISO image, select Use ISO image, and then click the Browse... button to open the Locate media volume window.

    Select the installation image you wish to use, and click Choose Volume.

    If no images are displayed in the Locate media volume window, click on the Browse Local button to browse the host machine for the installation image or DVD drivecontaining the installation disk. Select the installation image or DVD drive containing theinstallation disk and click Open; the volume is selected for use and you are returned to theCreate a new virtual machine wizard.

    ImportantFor ISO image files and guest storage images, the recommended location to use is /var/lib/libvirt/images/. Any other location may require additionalconfiguration by SELinux. Refer to the Red Hat Enterprise Linux Virtualization SecurityGuide or Red Hat Enterprise Linux SELinux User's and Administrator's Guide for moredetails on configuring SELinux.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    4 4

  • Select the operating system type and version which match the installation media you haveselected.

    Figure 6 .5. The New VM window - Step 2

    Click Forward to continue.

    5.

    Set RAM and virtual CPUs

    Choose appropriate values for the virtual CPUs and RAM allocation. These values affect thehost's and guest's performance. Memory and virtual CPUs can be overcommitted. For moreinformation on overcommitting, refer to Chapter 11, Overcommitting with KVM.

    Virtual machines require sufficient physical memory (RAM) to run efficiently and effectively.Red Hat supports a minimum of 512MB of RAM for a virtual machine. Red Hat recommends atleast 1024MB of RAM for each logical core.

    Assign sufficient virtual CPUs for the virtual machine. If the virtual machine runs a multi-threaded application, assign the number of virtual CPUs the guest virtual machine will requireto run efficiently.

    You cannot assign more virtual CPUs than there are physical processors (or hyper-threads)available on the host system. The number of virtual CPUs available is noted in the Up to X available field.

    Chapt er 6 . Inst alling a Red Hat Ent erprise Linux 7 guest virt ual machine on a Red Hat Ent erprise Linux 7 host

    4 5

  • Figure 6 .6 . The new VM window - Step 3

    Click Forward to continue.

    6. Storage

    Enable and assign storage for the Red Hat Enterprise Linux 7 guest virtual machine. Assignat least 5GB for a desktop installation or at least 1GB for a minimal installation.

    NoteLive and offline migrations require virtual machines to be installed on shared networkstorage. For information on setting up shared storage for virtual machines, refer toSection 19.3, Shared storage example: NFS for a simple migration .

    a. With the default local storage

    Select the Create a disk image on the computer's hard drive radiobutton to create a file-based image in the default storage pool, the

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    4 6

  • /var/lib/libvirt/images/ directory. Enter the size of the disk image to becreated. If the Allocate entire disk now check box is selected, a disk image ofthe size specified will be created immediately. If not, the disk image will grow as itbecomes filled.

    NoteAlthough the storage pool is a virtual container it is limited by two factors:maximum size allowed to it by qemu-kvm and the size of the disk on the hostphysical machine. Storage pools may not exceed the size of the disk on thehost physical machine. The maximum sizes are as follows:

    virtio-blk = 2^63 bytes or 8 Exabytes(using raw files or disk)Ext4 = ~ 16 TB (using 4 KB block size)XFS = ~8 Exabytesqcow2 and host file systems keep their own metadata and scalabilityshould be evaluated/tuned when trying very large image sizes. Using rawdisks means fewer layers that could affect scalability or max size.

    Figure 6 .7. The New VM window - Step 4

    Chapt er 6 . Inst alling a Red Hat Ent erprise Linux 7 guest virt ual machine on a Red Hat Ent erprise Linux 7 host

    4 7

  • Click Forward to create a disk image on the local hard drive. Alternatively, select Select managed or other existing storage, then select Browse toconfigure managed storage.

    b. With a storage pool

    If you selected Select managed or other existing storage in the previousstep to use a storage pool and clicked Browse, the Locate or create storage volume window will appear.

    Figure 6 .8. The Locate or create storage volume window

    i. Select a storage pool from the Storage Pools list.

    ii. Optional: Click on the New Volume button to create a new storage volume.The Add a Storage Volume screen will appear. Enter the name of the newstorage volume.

    Choose a format option from the Format dropdown menu. Format optionsinclude raw, cow, qcow, qcow2, vmdk, and vpc. Adjust other fields as desired.Note that the qcow version used here is version 3. To change the qcowversion refer to Section 29.20.2, Setting target elements

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    4 8

  • Figure 6 .9 . The Add a Storage Volume window

    Click Finish to continue.

    7. Verify and f in ish

    Verify there were no errors made during the wizard and everything appears as expected.

    Select the Customize configuration before install check box to change theguest's storage or network devices, to use the para-virtualized (virtio) drivers or to addadditional devices.

    Click on the Advanced options down arrow to inspect and modify advanced options. Fora standard Red Hat Enterprise Linux 7 installation, none of these options requiremodification.

    Chapt er 6 . Inst alling a Red Hat Ent erprise Linux 7 guest virt ual machine on a Red Hat Ent erprise Linux 7 host

    4 9

  • Figure 6 .10. The New VM window - local storage

    Click Finish to continue into the Red Hat Enterprise Linux installation sequence. For moreinformation on installing Red Hat Enterprise Linux 7 refer to the Red Hat Enterprise Linux 7Installation Guide.

    A Red Hat Enterprise Linux 7 guest virtual machine is now created from an ISO installation discimage.

    6.2. Creat ing a Red Hat Enterprise Linux 7 guest with a networkinstallat ion t ree

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    50

  • Procedure 6 .2. Creat ing a Red Hat Enterprise Linux 7 guest with virt -manager

    1. Opt ional: Preparat ion

    Prepare the storage environment for the guest virtual machine. For more information onpreparing storage, refer to Chapter 16, Storage pools.

    ImportantVarious storage types may be used for storing guest virtual machines. However, for avirtual machine to be able to use migration features the virtual machine must becreated on networked storage.

    Red Hat Enterprise Linux 7 requires at least 1GB of storage space. However, Red Hatrecommends at least 5GB of storage space for a Red Hat Enterprise Linux 7 installation andfor the procedures in this guide.

    2. Open virt -manager and start the wiz ard

    Open virt-manager by executing the virt-manager command as root or opening Applications System Tools Virtual Machine Manager.

    Chapt er 6 . Inst alling a Red Hat Ent erprise Linux 7 guest virt ual machine on a Red Hat Ent erprise Linux 7 host

    51

  • Figure 6 .11. The main virt -manager window

    Click on the Create a new virtual machine button to start the new virtual machinewizard.

    Figure 6 .12. The Create a new virtual machine but ton

    The Create a new virtual machine window opens.

    3. Name the virtual machine

    Virtual machine names can contain letters, numbers and the following characters: '_' , '. ' and'-' . Virtual machine names must be unique for migration and cannot consist only of numbers.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    52

  • Choose the installation method from the list of radio buttons.

    Figure 6 .13. The New VM window - Step 1

    Click Forward to continue.

    4. Provide the installation URL, and the Kickstart URL and Kernel options if required.

    Chapt er 6 . Inst alling a Red Hat Ent erprise Linux 7 guest virt ual machine on a Red Hat Ent erprise Linux 7 host

    53

  • Figure 6 .14 . The New VM window - Step 2

    Click Forward to continue.

    5. The remaining steps are the same as the ISO installation procedure. Continue from Step 5 ofthe ISO installation procedure.

    6.3. Creat ing a Red Hat Enterprise Linux 7 guest with PXEProcedure 6 .3. Creat ing a Red Hat Enterprise Linux 7 guest with virt -manager

    1. Opt ional: Preparat ion

    Prepare the storage environment for the virtual machine. For more information on preparingstorage, refer to Chapter 16, Storage pools.

    ImportantVarious storage types may be used for storing guest virtual machines. However, for avirtual machine to be able to use migration features the virtual machine must becreated on networked storage.

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    54

  • Red Hat Enterprise Linux 7 requires at least 1GB of storage space. However, Red Hatrecommends at least 5GB of storage space for a Red Hat Enterprise Linux 7 installation andfor the procedures in this guide.

    2. Open virt -manager and start the wiz ard

    Open virt-manager by executing the virt-manager command as root or opening Applications System Tools Virtual Machine Manager.

    Figure 6 .15. The main virt -manager window

    Click on the Create new virtualized guest button to start the new virtualized guestwizard.

    Chapt er 6 . Inst alling a Red Hat Ent erprise Linux 7 guest virt ual machine on a Red Hat Ent erprise Linux 7 host

    55

  • Figure 6 .16 . The create new virtualiz ed guest but ton

    The New VM window opens.

    3. Name the virtual machine

    Virtual machine names can contain letters, numbers and the following characters: '_' , '. ' and'-' . Virtual machine names must be unique for migration and cannot consist only of numbers.

    Choose the installation method from the list of radio buttons.

    Figure 6 .17. The New VM window - Step 1

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    56

  • Click Forward to continue.

    4. The remaining steps are the same as the ISO installation procedure. Continue from Step 5 ofthe ISO installation procedure. From this point, the only difference in this PXE procedure is onthe final New VM screen, which shows the Install: PXE Install field.

    Chapt er 6 . Inst alling a Red Hat Ent erprise Linux 7 guest virt ual machine on a Red Hat Ent erprise Linux 7 host

    57

  • Figure 6 .18. The New VM window - Step 5 - PXE Install

    Red Hat Ent erprise Linux 7 Virt ualizat ion Deployment and Administ rat ion Guide

    58