Red Hat Enterprise Linux 5 Virtualization Guide The definitive guide for virtua

Red Hat Enterprise Linux 5 Virtualization Guide The definitive guide for virtualization on Red Hat Enterprise Linux Christopher Curran Jan Mark Holzer Virtualization Guide Red Hat Enterprise Linux 5 Virtualization Guide The definitive guide for virtualization on Red Hat Enterprise Linux Edition 4 Author Christopher Curran ccurran@redhat.com Author Jan Mark Holzer Copyright © 2008,2009 Red Hat, Inc. This material may only be distributed subject to the terms and conditions set forth in the Open Publication License, V1.0 or later (the latest version of the OPL is presently available at http://www.opencontent.org/openpub/). Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc. in the United States and other countries. All other trademarks referenced herein are the property of their respective owners. 1801 Varsity Drive Raleigh, NC 27606-2072 USA Phone: +1 919 754 3700 Phone: 888 733 4281 Fax: +1 919 754 3701 PO Box 13588 Research Triangle Park, NC 27709 USA The Red Hat Enterprise Linux Virtualization Guide contains information on installation, configuring, administering, tips, tricks and troubleshooting virtualization technologies used in Red Hat Enterprise Linux. iii Preface ix 1. About this book .............................................................................................................. ix 2. Document Conventions ................................................................................................... ix 2.1. Typographic Conventions ..................................................................................... ix 2.2. Pull-quote Conventions ........................................................................................ xi 2.3. Notes and Warnings ............................................................................................ xii 3. We need feedback ........................................................................................................ xii 4. How should CIO's think about virtualization ..................................................................... xii I. Requirements and Limitations for Virtualization with Red Hat Enterprise Linux 1 1. System requirements 3 2. Xen restrictions and support 5 3. KVM restrictions and support 9 4. Virtualization limitations 11 4.1. General limitations for virtualization ..................................................................... 11 4.2. KVM limitations .................................................................................................. 11 4.3. Xen limitations .................................................................................................... 12 4.4. Application limitations ......................................................................................... 13 II. Installation 15 5. Installing the virtualization packages 17 5.1. Installing Xen with a new Red Hat Enterprise Linux installation .............................. 17 5.2. Installing Xen packages on an existing Red Hat Enterprise Linux system ................ 21 5.3. Installing KVM with a new Red Hat Enterprise Linux installation ............................. 22 5.4. Installing KVM packages on an existing Red Hat Enterprise Linux system ............... 26 6. Virtualized guest installation overview 29 6.1. Creating guests with virt-install ............................................................................ 29 6.2. Creating guests with virt-manager ....................................................................... 29 6.3. Installing guests with PXE ................................................................................... 37 7. Guest operating system installation procedures 45 7.1. Installing Red Hat Enterprise Linux 5 as a para-virtualized guest ............................ 45 7.2. Installing Red Hat Enterprise Linux as a fully virtualized guest ............................... 82 7.3. Installing Windows XP as a fully virtualized guest ................................................. 91 7.4. Installing Windows Server 2003 as a fully virtualized guest .................................. 108 7.5. Installing Windows Server 2008 as a fully virtualized guest .................................. 111 III. Configuration 123 8. Virtualized block devices 125 8.1. Creating a virtualized floppy disk controller ......................................................... 125 8.2. Adding storage devices to guests ...................................................................... 126 8.3. Configuring persistent storage in Red Hat Enterprise Linux 5 ............................... 129 8.4. Add a virtualized CD-ROM or DVD device to a guest .......................................... 131 9. Shared storage and virtualization 133 9.1. Using iSCSI for storing guests ........................................................................... 133 Virtualization Guide iv 9.2. Using NFS for storing guests ............................................................................ 133 9.3. Using GFS2 for storing guests .......................................................................... 133 10. Server best practices 135 11. Security for virtualization 137 11.1. SELinux and virtualization ............................................................................... 137 11.2. SELinux considerations ................................................................................... 138 12. Network Configuration 139 12.1. Network address translation (NAT) with libvirt ................................................... 139 12.2. Bridged networking with libvirt ......................................................................... 140 13. Pre-Red Hat Enterprise Linux 5.4 Xen networking 143 13.1. Configuring multiple guest network bridges to use multiple Ethernet cards ........... 143 13.2. Red Hat Enterprise Linux 5.0 Laptop network configuration ............................... 144 14. Xen Para-virtualized Drivers 149 14.1. System requirements ...................................................................................... 150 14.2. Para-virtualization Restrictions and Support ...................................................... 151 14.3. Installing the Para-virtualized Drivers ............................................................... 153 14.3.1. Common installation steps .................................................................... 153 14.3.2. Installation and Configuration of Para-virtualized Drivers on Red Hat Enterprise Linux 3 ........................................................................................... 154 14.3.3. Installation and Configuration of Para-virtualized Drivers on Red Hat Enterprise Linux 4 ........................................................................................... 158 14.3.4. Installation and Configuration of Para-virtualized Drivers on Red Hat Enterprise Linux 5 ........................................................................................... 161 14.4. Para-virtualized Network Driver Configuration ................................................... 163 14.5. Additional Para-virtualized Hardware Configuration ........................................... 169 14.5.1. Virtualized Network Interfaces ............................................................... 169 14.5.2. Virtual Storage Devices ........................................................................ 169 15. KVM Para-virtualized Drivers 171 15.1. Installing the KVM Windows para-virtualized drivers .......................................... 171 IV. Administration 179 16. Managing guests with xend 181 17. KVM guest timing management 183 18. Xen live migration 187 18.1. A live migration example ................................................................................. 188 18.2. Configuring guest live migration ....................................................................... 196 19. KVM live migration 197 19.1. Live migration requirements ............................................................................ 197 19.2. Share storage example: NFS for a simple migration .......................................... 198 19.3. Live KVM migration with virsh ......................................................................... 199 19.4. Migrating with virt-manager ............................................................................. 200 20. Remote management of virtualized guests 209 20.1. Remote management with SSH ....................................................................... 209 20.2. Remote management over TLS and SSL ......................................................... 210 20.3. Transport modes ............................................................................................. 211 v V. Virtualization Reference Guide 215 21. Virtualization tools 217 22. Managing guests with virsh 221 23. Managing guests with the Virtual Machine Manager (virt-manager) 231 23.1. The open connection window .......................................................................... 231 23.2. The Virtual Machine Manager main window ...................................................... 232 23.3. The Virtual Machine Manager details window .................................................. 233 23.4. Virtual Machine graphical console ................................................................... 234 23.5. Starting virt-manager ....................................................................................... 235 23.6. Restoring a saved machine ............................................................................ 236 23.7. Displaying guest details .................................................................................. 237 23.8. Status monitoring ............................................................................................ 242 23.9. Displaying guest identifiers .............................................................................. 244 23.10. Displaying a guest's status ........................................................................... 245 23.11. Displaying virtual CPUs ................................................................................ 246 23.12. Displaying CPU usage .................................................................................. 247 23.13. Displaying memory usage ............................................................................ 248 23.14. Managing a virtual network ............................................................................ 249 23.15. Creating a virtual network .............................................................................. 251 24. The xm command quick reference 259 25. Configuring the Xen kernel boot parameters 263 26. Configuring ELILO 265 27. Xen configuration files 269 VI. Tips and Tricks 277 28. Tips and tricks 279 28.1. Automatically starting guests ........................................................................... 279 28.2. Changing between the KVM and Xen hypervisors ............................................. 279 28.2.1. Xen to KVM ......................................................................................... 279 28.2.2. KVM to Xen ......................................................................................... 281 28.3. Using qemu-img ............................................................................................. 283 28.4. Overcommitting with KVM ............................................................................... 284 28.5. Modifying /etc/grub.conf ................................................................................... 286 28.6. Verifying virtualization extensions ..................................................................... 287 28.7. Identifying guest type and implementation ........................................................ 287 28.8. Generating a new unique MAC address ........................................................... 288 28.9. Limit network bandwidth for a Xen guest .......................................................... 289 28.10. Configuring Xen processor affinities ............................................................... 290 28.11. Modifying the Xen hypervisor ......................................................................... 290 28.12. Very Secure ftpd ........................................................................................ 291 28.13. Configuring LUN Persistence ......................................................................... 292 28.14. Disable SMART disk monitoring for guests ..................................................... 293 28.15. Cleaning up old Xen configuration files ........................................................... 294 28.16. Configuring a VNC Server ............................................................................. 294 28.17. Cloning guest configuration files .................................................................... 294 28.18. Duplicating an existing guest and its configuration file ..................................... 295 29. Creating custom libvirt scripts 297 Virtualization Guide vi 29.1. Using XML configuration files with virsh ........................................................... 297 VII. Troubleshooting 299 30. Troubleshooting Xen 301 30.1. Debugging and troubleshooting Xen ................................................................ 301 30.2. Log files overview ........................................................................................... 303 30.3. Log file descriptions ........................................................................................ 303 30.4. Important directory locations ............................................................................ 304 30.5. Troubleshooting with the logs .......................................................................... 304 30.6. Troubleshooting with the serial console ............................................................ 305 30.7. Para-virtualized guest console access .............................................................. 305 30.8. Fully virtualized guest console access .............................................................. 306 30.9. Accessing data on guest disk image ................................................................ 306 30.10. Common Xen problems ................................................................................. 307 30.11. Guest creation errors ..................................................................................... 307 30.12. Troubleshooting with serial consoles .............................................................. 308 30.12.1. Serial console output for Xen .............................................................. 308 30.12.2. Xen serial console output from para-virtualized guests .......................... 308 30.12.3. Serial console output from fully virtualized guests ................................. 309 30.13. Guest configuration files ................................................................................ 310 30.14. Interpreting Xen error messages .................................................................... 311 30.15. The layout of the log directories ..................................................................... 314 31. Troubleshooting 315 31.1. Identifying available storage and partitions ....................................................... 315 31.2. After rebooting Xen-based guests the console freezes ...................................... 315 31.3. Virtualized Ethernet devices are not found by networking tools ........................... 315 31.4. Loop device errors .......................................................................................... 315 31.5. Failed domain creation caused by a memory shortage ...................................... 316 31.6. Wrong kernel image error ................................................................................ 316 31.7. Wrong kernel image error - non-PAE kernel on a PAE platform .......................... 317 31.8. Fully-virtualized 64 bit guest fails to boot .......................................................... 317 31.9. A missing localhost entry causes virt-manager to fail ......................................... 317 31.10. Microcode error during guest boot ................................................................. 318 31.11. Wrong bridge configured on the guest causing hot plug script timeouts .............. 318 31.12. Python depreciation warning messages when starting a virtual machine ............ 319 31.13. Enabling Intel VT and AMD-V virtualization hardware extensions in BIOS .......... 320 32. Troubleshooting the Xen para-virtualized drivers 321 32.1. Red Hat Enterprise Linux 5 Virtualization log file and directories ......................... 321 32.2. Para-virtualized guest fail to load on a Red Hat Enterprise Linux 3 guest operating system ..................................................................................................... 322 32.3. A warning message is displayed while installing the para-virtualized drivers on Red Hat Enterprise Linux 3 ..................................................................................... 323 32.4. Manually loading the para-virtualized drivers .................................................... 323 32.5. Verifying the para-virtualized drivers have successfully loaded ........................... 324 32.6. The system has limited throughput with para-virtualized drivers .......................... 324 A. Xen system architecture uploads/s3/ virtualization-guide.pdf

  • 26
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager