• Aucun résultat trouvé

Red Hat Enterprise Linux 5 Virtualization Guide

N/A
N/A
Protected

Academic year: 2022

Partager "Red Hat Enterprise Linux 5 Virtualization Guide"

Copied!
356
0
0

Texte intégral

(1)

Red Hat Enterprise Linux 5 Virtualization Guide

The definitive guide for virtualization on Red Hat Enterprise Linux

Christopher Curran

Jan Mark Holzer

(2)

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.

(3)

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

(4)

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

(5)

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

(6)

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 325

B. Additional resources 327

B.1. Online resources ... 327

(7)

C. Revision History 335 D. Colophon 341

(8)
(9)

This book is the Red Hat Enterprise Linux Virtualization Guide. The Guide covers all aspects of using and managing virtualization products included with Red Hat Enterprise Linux.

1. About this book

This book is divided into 7 parts:

• System Requirements

• Installation

• Configuration

• Administration

• Reference

• Tips and Tricks

• Troubleshooting

2. Document Conventions

This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information.

In PDF and paper editions, this manual uses typefaces drawn from the Liberation Fonts1 set. The Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not,

alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later includes the Liberation Fonts set by default.

2.1. Typographic Conventions

Four typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows.

Mono-spaced Bold

Used to highlight system input, including shell commands, file names and paths. Also used to highlight key caps and key-combinations. For example:

To see the contents of the file my_next_bestselling_novel in your current working directory, enter the cat my_next_bestselling_novel command at the shell prompt and press Enter to execute the command.

The above includes a file name, a shell command and a key cap, all presented in Mono-spaced Bold and all distinguishable thanks to context.

Key-combinations can be distinguished from key caps by the hyphen connecting each part of a key- combination. For example:

1 https://fedorahosted.org/liberation-fonts/

(10)

x

Press Enter to execute the command.

Press Ctrl-Alt-F1 to switch to the first virtual terminal. Press Ctrl-Alt-F7 to return to your X-Windows session.

The first sentence highlights the particular key cap to press. The second highlights two sets of three key caps, each set pressed simultaneously.

If source code is discussed, class names, methods, functions, variable names and returned values mentioned within a paragraph will be presented as above, in Mono-spaced Bold. For example:

File-related classes include filesystem for file systems, file for files, and dir for directories. Each class has its own associated set of permissions.

Proportional Bold

This denotes words or phrases encountered on a system, including application names; dialogue box text; labelled buttons; check-box and radio button labels; menu titles and sub-menu titles. For example:

Choose System > Preferences > Mouse from the main menu bar to launch Mouse Preferences. In the Buttons tab, click the Left-handed mouse check box and click Close to switch the primary mouse button from the left to the right (making the mouse suitable for use in the left hand).

To insert a special character into a gedit file, choose Applications > Accessories

> Character Map from the main menu bar. Next, choose Search > Find… from the Character Map menu bar, type the name of the character in the Search field and click Next. The character you sought will be highlighted in the Character Table. Double- click this highlighted character to place it in the Text to copy field and then click the Copy button. Now switch back to your document and choose Edit > Paste from the gedit menu bar.

The above text includes application names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in Proportional Bold and all distinguishable by context.

Note the > shorthand used to indicate traversal through a menu and its sub-menus. This is to avoid the difficult-to-follow 'Select Mouse from the Preferences sub-menu in the System menu of the main menu bar' approach.

Mono-spaced Bold Italic or Proportional Bold Italic

Whether Mono-spaced Bold or Proportional Bold, the addition of Italics indicates replaceable or variable text. Italics denotes text you do not input literally or displayed text that changes depending on circumstance. For example:

To connect to a remote machine using ssh, type ssh username@domain.name at a shell prompt. If the remote machine is example.com and your username on that machine is john, type ssh john@example.com.

The mount -o remount file-system command remounts the named file system. For example, to remount the /home file system, the command is mount -o remount /home.

(11)

To see the version of a currently installed package, use the rpm -q package command. It will return a result as follows: package-version-release.

Note the words in bold italics above — username, domain.name, file-system, package, version and release. Each word is a placeholder, either for text you enter when issuing a command or for text displayed by the system.

Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and important term. For example:

When the Apache HTTP Server accepts requests, it dispatches child processes or threads to handle them. This group of child processes or threads is known as a server-pool. Under Apache HTTP Server 2.0, the responsibility for creating and maintaining these server-pools has been abstracted to a group of modules called Multi-Processing Modules (MPMs). Unlike other modules, only one module from the MPM group can be loaded by the Apache HTTP Server.

2.2. Pull-quote Conventions

Two, commonly multi-line, data types are set off visually from the surrounding text.

Output sent to a terminal is set in Mono-spaced Roman and presented thus:

books Desktop documentation drafts mss photos stuff svn books_tests Desktop1 downloads images notes scripts svgs

Source-code listings are also set in Mono-spaced Roman but are presented and highlighted as follows:

package org.jboss.book.jca.ex1;

import javax.naming.InitialContext;

public class ExClient {

public static void main(String args[]) throws Exception

{

InitialContext iniCtx = new InitialContext();

Object ref = iniCtx.lookup("EchoBean");

EchoHome home = (EchoHome) ref;

Echo echo = home.create();

System.out.println("Created Echo");

System.out.println("Echo.echo('Hello') = " + echo.echo("Hello"));

} }

(12)

xii

2.3. Notes and Warnings

Finally, we use three visual styles to draw attention to information that might otherwise be overlooked.

Note

A Note is a tip or shortcut or alternative approach to the task at hand. Ignoring a note should have no negative consequences, but you might miss out on a trick that makes your life easier.

Important

Important boxes detail things that are easily missed: configuration changes that only apply to the current session, or services that need restarting before an update will apply.

Ignoring Important boxes won't cause data loss but may cause irritation and frustration.

Warning

A Warning should not be ignored. Ignoring warnings will most likely cause data loss.

3. We need feedback

If you find a typographical error in the Virtualization Guide, or if you have thought of a way to make this manual better, we would love to hear from you! Please submit a report in Bugzilla: http://

bugzilla.redhat.com/bugzilla/ against the component Virtualization_Guide.

If you have a suggestion for improving the documentation, try and be as specific as possible when describing it. If you have found an error, please include the section number and some of the surrounding text so we can find it easily.

4. How should CIO's think about virtualization

by Lee Congdon, Chief Information Officer, Red Hat, Inc.

You may already be heavily invested in the rapidly emerging technology of virtualization. If so, consider some of the ideas below for further exploiting the technology. If not, now is the right time to get started.

Virtualization provides a set of tools for increasing flexibility and lowering costs, things that are important in every enterprise and Information Technology organization. Virtualization solutions are becoming increasingly available and rich in features.

Since virtualization can provide significant benefits to your organization in multiple areas, you should be establishing pilots, developing expertise and putting virtualization technology to work now.

Virtualization for Innovation

In essence, virtualization increases flexibility by decoupling an operating system and the services and applications supported by that system from a specific physical hardware platform. It allows the establishment of multiple virtual environments on a shared hardware platform.

(13)

Organizations looking to innovate find that the ability to create new systems and services without installing additional hardware (and to quickly tear down those systems and services when they are no longer needed) can be a significant boost to innovation.

Among possible approaches are the rapid establishment of development systems for the creation of custom software, the ability to quickly set up test environments, the capability to provision alternate software solutions and compare them without extensive hardware investments, support for rapid prototyping and agile development environments, and the ability to quickly establish new production services on demand.

These environments can be created in house or provisioned externally, as with Amazon’s EC2 offering. Since the cost to create a new virtual environment can be very low, and can take advantage of existing hardware, innovation can be facilitated and accelerated with minimal investment.

Virtualization can also excel at supporting innovation through the use of virtual environments for training and learning. These services are ideal applications for virtualization technology. A student can start course work with a known, standard system environment. Class work can be isolated from the production network. Learners can establish unique software environments without demanding exclusive use of hardware resources.

As the capabilities of virtual environments continue to grow, we’re likely to see increasing use of virtualization to enable portable environments tailored to the needs of a specific user. These

environments can be moved dynamically to an accessible or local processing environment, regardless of where the user is located. The user’s virtual environments can be stored on the network or carried on a portable memory device.

A related concept is the Appliance Operating System, an application package oriented operating system designed to run in a virtual environment. The package approach can yield lower development and support costs as well as insuring the application runs in a known, secure environment. An Appliance Operating System solution provides benefits to both application developers and the consumers of those applications.

How these applications of virtualization technology apply in your enterprise will vary. If you are already using the technology in more than one of the areas noted above, consider an additional investment in a solution requiring rapid development. If you haven’t started with virtualization, start with a training and learning implementation to develop skills, then move on to application development and testing.

Enterprises with broader experience in virtualization should consider implementing portable virtual environments or application appliances.

Virtualization for Cost Savings

Virtualization can also be used to lower costs. One obvious benefit comes from the consolidation of servers into a smaller set of more powerful hardware platforms running a collection of virtual environments. Not only can costs be reduced by reducing the amount of hardware and reducing the amount of unused capacity, but application performance can actually be improved since the virtual guests execute on more powerful hardware.

Further benefits include the ability to add hardware capacity in a non-disruptive manner and to dynamically migrate workloads to available resources.

Depending on the needs of your organization, it may be possible to create a virtual environment for disaster recovery. Introducing virtualization can significantly reduce the need to replicate identical hardware environments and can also enable testing of disaster scenarios at lower cost.

(14)

xiv

Virtualization provides an excellent solution for addressing peak or seasonal workloads. If you have complementary workloads in your organization, you can dynamically allocate resources to the applications which are currently experiencing the greatest demand. If you have peak workloads that you are currently provisioning inside your organization, you may be able to buy capacity on demand externally and implement it efficiently using virtual technology.

Cost savings from server consolidation can be compelling. If you are not exploiting virtualization for this purpose, you should start a program now. As you gain experience with virtualization, explore the benefits of workload balancing and virtualized disaster recovery environments.

Virtualization as a Standard Solution

Regardless of the specific needs of your enterprise, you should be investigating virtualization as part of your system and application portfolio as the technology is likely to become pervasive. We expect operating system vendors to include virtualization as a standard component, hardware vendors to build virtual capabilities into their platforms, and virtualization vendors to expand the scope of their offerings.

If you don’t have plans to incorporate virtualization in your solution architecture, now is a very good time to identify a pilot project, allocate some underutilized hardware platforms, and develop expertise with this flexible and cost-effective technology. Then, extend your target architectures to incorporate virtual solutions. Although substantial benefits are available from virtualizing existing services, building new applications with an integrated virtualization strategy can yield further benefits in both manageability and availability.

You can learn more about Red Hat’s virtualization solutions at http://www.redhat.com/products/

(15)

Limitations for Virtualization with Red Hat Enterprise Linux System requirements, support

restrictions and limitations

These chapters outline the system requirements, support restrictions, and limitations of virtualization on Red Hat Enterprise Linux.

(16)
(17)

System requirements

This chapter lists system requirements for successfully running virtualization on Red Hat Enterprise Linux. You require a system running Red Hat Enterprise Linux 5 Server with the virtualization packages. The host a configured hypervisor (either Xen or KVM). For information on installing the hypervisor, read Chapter 5, Installing the virtualization packages.

Minimum system requirements

• 6GB free disk space

• 2GB of RAM.

Recommended system requirements

• 6GB plus the required disk space recommended by the guest operating system per guest. For most operating systems more than 6GB of disk space is recommended.

• One processor core or hyper-thread for each virtualized CPU and one for the hypervisor.

• 2GB of RAM plus additional RAM virtualized guests.

KVM overcommit

The KVM hypervisor supports guests using more than the available RAM and processor cores for virtualized guests. For information on safely overcommitting resources with KVM refer to Section 28.4, “Overcommitting with KVM”.

Xen para-virtualization requirements

Para-virtualized guests require a Red Hat Enterprise Linux 5 installation tree available over the network using the NFS, FTP or HTTP protocols.

Xen full virtualization requirements

Full virtualization with the Xen Hypervisor requires:

• an Intel processor with the Intel VT extensions,

• an AMD processor with the AMD-V extensions, or

• an Intel Itanium processor.

Refer to Section 28.6, “Verifying virtualization extensions” to determine if your processor has the virtualization extensions.

KVM requirements

The KVM hypervisor requires:

• an Intel processor with the Intel VT and the Intel 64 extensions, or

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

(18)

4

Refer to Section 28.6, “Verifying virtualization extensions” to determine if your processor has the virtualization extensions.

Storage support

The supported guest storage methods are:

• files on local storage,

• physical disk partitions,

• locally connected physical LUNs,

• LVM partitions, and

• iSCSI and Fibre Channel based LUNs.

File based guest storage

File based guest images should be stored in the /var/lib/xen/images/ folder. If you use a different directory you must add the directory to the SELinux policy. Refer to Section 11.1, “SELinux and virtualization” for details.

(19)

Xen restrictions and support

Red Hat Enterprise Linux 5 supports various architecture combinations for hosts and virtualized guests. This lists tested compatible guests for Red Hat Enterprise Linux 5 hosts. Other combinations may be possible but are not tested and are unsupported by Red Hat.

The x86 architecture

The 32 bit Red Hat Enterprise Linux kernel-xen package on x86-compatible systems is limited to 16 processor cores.

Supported fully virtualized guests

Operating system Support level Red Hat Enterprise Linux 3 x86 Optimized Red Hat Enterprise Linux 4 x86 Optimized Red Hat Enterprise Linux 5 x86 Optimized Windows Server 2000 32-Bit Supported Windows Server 2003 32-Bit Supported

Windows XP 32-Bit Supported

Windows Vista 32-Bit Supported

Note, other 32 bit operating systems may work but are not tested and unsupported.

To utilize full virtualization on Red Hat Enterprise Linux 5 your processor must have an Intel-VT or AMD-V enabled processor.

Supported para-virtualized guest

Operating system Support level Red Hat Enterprise Linux 4 x86

Update 5 and higher

Optimized Red Hat Enterprise Linux 5 x86 Optimized

To utilize para-virtualization on Red Hat Enterprise Linux 5 your processor must have the Physical Address Extension (PAE) instruction set.

AMD64 and Intel 64 architecture

The kernel-xen package on AMD64 and Intel 64 machines has the following processor limitations:

• Red Hat Enterprise Linux 5.0 supports up to 32 CPU processor cores.

• Red Hat Enterprise Linux 5.1 supports up to 32 CPU processor cores.

• Red Hat Enterprise Linux 5.2 supports up to 64 CPU processor cores.

• Red Hat Enterprise Linux 5.3 supports up to 126 CPU processor cores.

• Red Hat Enterprise Linux 5.4 supports up to 256 CPU processor cores.

(20)

6

Supported fully virtualized guests

Operating system Support level Red Hat Enterprise Linux 3

x86-64

Optimized Red Hat Enterprise Linux 3 x86 Optimized Red Hat Enterprise Linux 4

AMD64/Intel 64

Optimized Red Hat Enterprise Linux 4 x86 Optimized Red Hat Enterprise Linux 5

AMD64/Intel 64

Optimized Red Hat Enterprise Linux 5 x86 Optimized Windows Server 2000 32-Bit Supported Windows Server 2003 32-Bit Supported

Windows XP 32-Bit Supported

Windows Vista 32-Bit Supported Windows Vista 64-Bit Supported Windows Server 2008 32-Bit Supported Windows Server 2008 64-Bit Supported

Solaris 32 bit Supported

Other x86 and AMD64 or Intel 64 based operating systems may work but are not and unsupported.

Supported para-virtualized guest

Operating system Support level Red Hat Enterprise Linux 4

AMD64/Intel 64 Update 5 and higher

Optimized

Red Hat Enterprise Linux 4 x86 Update 5 and higher

Technology preview in 5.2 and 5.3. Fully supported in 5.4 and newer.

Red Hat Enterprise Linux 5 AMD64/Intel 64

Optimized

Red Hat Enterprise Linux 5 x86 Technology preview in 5.2 and 5.3. Fully supported in 5.4 and newer.

Intel Itanium architecture

The kernel-xen package on Itanium systems is limited to 32 processor cores.

Supported fully virtualized guests

Operating system Support level Red Hat Enterprise Linux 3

Itanium

Supported Red Hat Enterprise Linux 4

Itanium

Optimized

(21)

Itanium

Windows Server 2003 for Itanium-based Systems

Supported

Supported para-virtualized guest

Operating system Support level Red Hat Enterprise Linux 5

Itanium

Optimized

Itanium® support

Virtualization with the Xen hypervisor on the Intel Itanium architecture requires the guest firmware image package, refer to Installing the Xen hypervisor with yum for more information.

(22)
(23)

KVM restrictions and support

Important

KVM only supports AMD64 and Intel 64 versions of Red Hat Enterprise Linux. Other architectures are not supported at this time.

The Red Hat Enterprise Linux kvm package is limited to 64 processor cores. This limit applies except on certain platforms where the limit is 96 processor cores.

Supported fully virtualized guests

Operating system Support level

Red Hat Enterprise Linux 3 x86 Optimized with para-virtualized drivers Red Hat Enterprise Linux 4 x86 Optimized with para-virtualized drivers Red Hat Enterprise Linux 4 AMD

64 and Intel 64

Optimized with para-virtualized drivers Red Hat Enterprise Linux 5 x86 Optimized with para-virtualized drivers Red Hat Enterprise Linux 5 AMD

64 and Intel 64

Optimized with para-virtualized drivers Windows Server 2003 R2 32-Bit Optimized with para-virtualized drivers Windows Server 2003 R2 64-Bit Optimized with para-virtualized drivers Windows Server 2003 Service

Pack 2 32-Bit

Optimized with para-virtualized drivers Windows Server 2003 Service

Pack 2 64-Bit

Optimized with para-virtualized drivers

Windows XP 32-Bit Optimized with para-virtualized drivers (network driver only) Windows Vista 32-Bit Supported

Windows Vista 64-Bit Supported

Windows Server 2008 32-Bit Optimized with para-virtualized drivers Windows Server 2008 64-Bit Supported

(24)
(25)

Virtualization limitations

This chapter covers the limitations of the virtualization packages.

This chapter covers additional limitations of virtualization technology in Red Hat Enterprise Linux.

4.1. General limitations for virtualization

Switching hypervisors

Presently, there are no applications for switching Xen-based guests to KVM or KVM-based guests to Xen. Guests can only be used on the hypervisor type that they were created on. There is an application in development at time of writing which may be released with future version of Red Hat Enterprise Linux

Other limitations

For the list of all other limitations and issues affecting virtualization read the Red Hat Enterprise Linux Release Notes for your version. The Release Notes cover the present new features, known issues and limitations as they are updated or discovered.

Test before deployment

You should test for the maximum anticipated load and virtualized network stress before deploying heavy I/O applications. Stress testing is important as there are performance drops caused by virtualization with increased I/O usage.

4.2. KVM limitations

The following limitations apply to the KVM hypervisor:

Constant TSC bit

Systems without a Constant Time Stamp Counter require additional configuration. Refer to Chapter 17, KVM guest timing management for details on determining whether you have a Constant Time Stamp Counter and configuration steps for fixing any related issues.

Memory overcommit

KVM supports memory overcommit and can store guests' memory in swap. A guest will run slower if it is swapped frequently. When KSM is used, make sure that the swap size is the size of the overcommit ratio.

CPU overcommit

It is not supported to have more than 10 virtual CPUs per physical processor core. Any number of overcommitted virtual CPUs above the number of physical processor cores may cause problems with certain virtualized guests.

Overcommitting CPUs has some risk and can lead to instability. Refer to Section 28.4,

“Overcommitting with KVM” for tips and recommendations on overcommitting CPUs.

Virtualized SCSI devices

SCSI emulation is presently not supported. Virtualized SCSI devices are completely disabled in KVM.

(26)

12

Virtualized IDE devices

KVM is limited to a maximum of four virtualized (emulated) IDE devices per guest.

Para-virtualized devices

Para-virtualized devices, which use the virtio drivers, are PCI devices. Presently, guests are limited to a maximum of 32 PCI devices. Some PCI devices are critical for the guest to run and these devices cannot be removed. The default, required devices are:

• the host bridge,

• the ISA bridge and usb bridge (The usb and isa bridges are the same device),

• the graphics card (using either the Cirrus or qxl driver), and

• the memory balloon device.

Out of the 32 available PCI devices for a guest 4 are not removable. This means there are only 28 PCI slots available for additional devices per guest. Every para-virtualized network or block device uses one slot. Each guest can use up to 28 additional devices made up of any combination of para-virtualized network, para-virtualized disk devices, or other PCI devices using VTd.

Migration limitations

Live migration is only possible with CPUs from the same vendor (that is, Intel to Intel or AMD to AMD only).

The No eXecution (NX) bit in Must be set on or off for both CPUs for live migration.

4.3. Xen limitations

Note

All limitations in this chapter are limitations for Red Hat Enterprise Linux 5.4 except where noted. Older versions may have smaller limitations.

Xen host (dom0) limitations

• A limit of 100 block devices using the tap:aio driver and file-based devices per host. The total number of block devices attached to para-virtualized guests cannot exceed 100 devices per host.

Working around the para-virtualized device limit

There are two methods for working around the para-virtualized device limit: using phy devices or using LVM on the guest.

A host has no limit to the number of phy devices it can have if it has sufficient resources.

LVM, or similar logical partitioning tool, can be used on a block device to create additional logical partitions on a single para-virtualized block device.

(27)

Xen Para-virtualization limitations

• A maximum total of 256 devices per virtualized guest.

• A maximum of 15 network devices per virtualized guest.

Xen full virtualization limitations

• A maximum of four virtualized (emulated) IDE devices per guest.

Devices using the para-virtualized drivers for fully-virtualized guests do not have this limitation.

• Virtualized (emulated) IDE devices are limited by the total number of loopback devices supported by the system. The default number of available loopback devices on Red Hat Enterprise Linux 5.4 is 8. That is all virtualized guests on the system can have no more than 8 virtualized (emulated) IDE devices.

For more information on loopback devices, refer to Red Hat KnowledgeBase1.

Using more than 8 loopback devices

By default, Red Hat Enterprise Linux limits the number of loopback devices available.

This number can be raised by modifying the kernel limit.

In the /etc/modprobe.conf add the following line:

options loop max_loop=64

Reboot the machine or run the following commands to update the kernel:

# rmmod loop

# modprobe loop

• A limit of 100 para-virtualized block devices per host. The total number of block devices (using the tap:aio driver) attached to para-virtualized guests cannot exceed 100 devices.

• A maximum of 256 block devices using the para-virtualized drivers per virtualized guest.

• A maximum of 15 network devices per virtualized guest.

• A maximum of 15 virtualized SCSI devices per virtualized guest.

4.4. Application limitations

There are aspects of virtualization which make virtualization unsuitable for certain types of applications.

Applications with high I/O throughput requirements should use the para-virtualized drivers for fully virtualized guests. Without the para-virtualized drivers certain applications may be unstable under heavy I/O loads.

The following applications should be avoided for their high I/O requirement reasons:

kdump server

(28)

14

netdump server

You should carefully evaluate databasing applications before running them on a virtualized guest.

Databases generally use network and storage I/O devices intensively. These applications may not be suitable for a fully virtualized environment. Consider para-virtualization or para-virtualized drivers for increased I/O performance. Refer to Chapter 14, Xen Para-virtualized Drivers for more information on the para-virtualized drivers for fully virtualized guests.

Other applications and tools which heavily utilize I/O or require real-time performance should be evaluated carefully. Using full virtualization with the para-virtualized drivers (refer to Chapter 14, Xen Para-virtualized Drivers) or para-virtualization results in better performance with I/O intensive applications. Applications still suffer a small performance loss from running in virtualized

environments. The performance benefits of virtualization through consolidating to newer and faster hardware should be evaluated against the potential application performance issues associated with using fully virtualized hardware.

(29)

Virtualization installation topics

These chapters describe setting up the host and installing virtualized guests with Red Hat Enterprise Linux. It is recommended to read these chapters carefully to ensure successful installation of

virtualized guest operating systems.

(30)
(31)

Installing the virtualization packages

Before you can use virtualization, the virtualization packages must be installed on Red Hat Enterprise Linux. Virtualization packages can be installed either during the installation sequence or after

installation using the yum command and the Red Hat Network (RHN).

You can install both the KVM and Xen hypervisors on a single system. The Xen hypervisor uses the kernel-xen package and the KVM hypervisor uses the default Red Hat Enterprise Linux kernel with the kvm kernel module. Xen and KVM each use a different kernel and only one hypervisor can be active at any given time. Red Hat recommends to only install one hypervisor, the hypervisor you want to use for virtualization.

To change hypervisor from Xen to KVM or KVM to Xen refer to Section 28.2, “Changing between the KVM and Xen hypervisors”.

5.1. Installing Xen with a new Red Hat Enterprise Linux installation

This section covers installing virtualization tools and Xen packages as part of a fresh Red Hat Enterprise Linux installation.

Need help installing?

The Installation Guide (available from redhat.com1) covers installing Red Hat Enterprise Linux in detail.

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

2. You must enter a valid installation number when prompted to receive access to the virtualization and other Advanced Platform packages.

(32)

18

3. Complete the other steps up to the package selection step.

Select the Virtualization package group and the Customize Now radio button.

(33)

4. Select the Virtualization package group. This selects the Xen hypervisor, virt-manager, libvirt and virt-viewer for installation.

(34)

20

5. Customize the packages (if required)

Customize the Virtualization group if you require other virtualization packages.

Press Close followed by Next to continue the installation.

Note

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

Installing Xen packages with Kickstart files

This section describes how to use a Kickstart file to install Red Hat Enterprise Linux with the Xen hypervisor packages. Kickstart files allow for large, automated installations without a user manually installing each individual system. The steps in this section will assist you in creating and using a Kickstart file to install Red Hat Enterprise Linux with the virtualization packages.

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

%packages

@virtualization

(35)

For Intel Itanium systems

Fully virtualized guests on the Itanium® architecture require the guest firmware image package (xen-ia64-guest-firmware). Append this package to your kickstart file.

xen-ia64-guest-firmware

More information on Kickstart files can be found on Red Hat's website, redhat.com2, in the Installation Guide.

5.2. Installing Xen packages on an existing Red Hat Enterprise Linux system

The section describes the steps necessary to install the virtualization packages on a working Red Hat Enterprise Linux system.

Adding packages to your list of Red Hat Network entitlements

This section describes how to enable Red Hat Network (RHN) entitlements for the virtualization packages. You need these entitlements enabled to install and update the virtualization packages on Red Hat Enterprise Linux. You require a valid Red Hat Network account in order to install virtualization packages on Red Hat Enterprise Linux.

In addition, your machines must be registered with RHN. To register an unregistered installation of Red Hat Enterprise Linux, run the rhn_register command and follow the prompts.

If you do not have a valid Red Hat subscription, visit the Red Hat online store3.

Procedure 5.1. Adding the Virtualization entitlement with RHN 1. Log in to RHN4 using your RHN username and password.

2. Select the systems you want to install virtualization on.

3. In the System Properties section the present systems entitlements are listed next to the Entitlements header. Use the (Edit These Properties) link to change your entitlements.

4. Select the Virtualization checkbox.

Your system is now entitled to receive the virtualization packages. The next section covers installing these packages.

Installing the Xen hypervisor with yum

To use virtualization on Red Hat Enterprise Linux you need the xen and kernel-xen packages.

The xen package contains the hypervisor and basic virtualization tools. The kernel-xen package contains a modified Linux kernel which runs as a virtual machine guest on the hypervisor.

To install the xen and kernel-xen packages, run:

2 http://www.redhat.com/docs/manuals/enterprise/

3 https://www.redhat.com/wapps/store/catalog.html

(36)

22

# yum install xen kernel-xen

Fully virtualized guests on the Itanium® architecture require the guest firmware image package (xen- ia64-guest-firmware) from the supplementary installation DVD. This package can also be can be installed from RHN with the yum command:

# yum install xen-ia64-guest-firmware

It is advised to install additional virtualization packages for management and configuration.

Recommended virtualization packages: lists the recommended packages.

Recommended virtualization packages:

python-virtinst

Provides the virt-install command for creating virtual machines.

libvirt

libvirt is an API library for interacting with hypervisors. libvirt uses the xm virtualization framework and the virsh command line tool to manage and control virtual machines.

libvirt-python

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

virt-manager

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

Install the other recommended virtualization packages:

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

5.3. Installing KVM with a new Red Hat Enterprise Linux installation

This section covers installing virtualization tools and KVM package as part of a fresh Red Hat Enterprise Linux installation.

Need help installing?

The Installation Guide (available from redhat.com5) covers installing Red Hat Enterprise Linux in detail.

You need a valid installation number

You cannot select the virtualization packages during the installation without a valid installation number.

(37)

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

2. You must enter a valid installation number when prompted to receive access to the virtualization and other Advanced Platform packages.

3. Complete the other steps up to the package selection step.

Select the Virtualization package group and the Customize Now radio button.

(38)

24

4. Select the KVM package group. Deselect the Virtualization package group. This selects the KVM hypervisor, virt-manager, libvirt and virt-viewer for installation.

(39)

5. Customize the packages (if required)

Customize the Virtualization group if you require other virtualization packages.

Press Close followed by Next to continue the installation.

Note

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

Installing KVM packages with Kickstart files

This section describes how to use a Kickstart file to install Red Hat Enterprise Linux with the KVM hypervisor packages. Kickstart files allow for large, automated installations without a user manually installing each individual system. The steps in this section will assist you in creating and using a Kickstart file to install Red Hat Enterprise Linux with the virtualization packages.

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

%packages

@kvm

(40)

26

More information on Kickstart files can be found on Red Hat's website, redhat.com6, in the Installation Guide.

5.4. Installing KVM packages on an existing Red Hat Enterprise Linux system

The section describes the steps for installing the KVM hypervisor on a working Red Hat Enterprise Linux 5.4 or newer.

Adding packages to your list of Red Hat Network entitlements

This section describes how to enable Red Hat Network (RHN) entitlements for the virtualization packages. You need these entitlements enabled to install and update the virtualization packages on Red Hat Enterprise Linux. You require a valid Red Hat Network account in order to install virtualization packages on Red Hat Enterprise Linux.

In addition, your machines must be registered with RHN. To register an unregistered installation of Red Hat Enterprise Linux, run the rhn_register command and follow the prompts.

If you do not have a valid Red Hat subscription, visit the Red Hat online store7.

Procedure 5.2. Adding the Virtualization entitlement with RHN 1. Log in to RHN8 using your RHN username and password.

2. Select the systems you want to install virtualization on.

3. In the System Properties section the present systems entitlements are listed next to the Entitlements header. Use the (Edit These Properties) link to change your entitlements.

4. Select the Virtualization checkbox.

Your system is now entitled to receive the virtualization packages. The next section covers installing these packages.

Installing the KVM hypervisor with yum

To use virtualization on Red Hat Enterprise Linux you require the kvm package. The kvm package contains the KVM kernel module providing the KVM hypervisor on the default Red Hat Enterprise Linux kernel.

To install the kvm package, run:

# yum install kvm

Now, install additional virtualization management packages.

Recommended virtualization packages:

python-virtinst

Provides the virt-install command for creating virtual machines.

6 http://www.redhat.com/docs/manuals/enterprise/

7 https://www.redhat.com/wapps/store/catalog.html

(41)

libvirt

libvirt is an API library for interacting with hypervisors. libvirt uses the xm virtualization framework and the virsh command line tool to manage and control virtual machines.

libvirt-python

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

virt-manager

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

Install the other recommended virtualization packages:

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

(42)
(43)

Virtualized guest installation overview

After you have installed the virtualization packages on the host system you can create guest operating systems. This chapter describes the general processes for installing guest operating systems on virtual machines. You can create guests using the New button in virt-manager or use the command line interface virt-install. Both methods are covered by this chapter.

Detailed installation instructions are available for specific versions of Red Hat Enterprise Linux, other Linux distributions, Solaris and Windows. Refer to Chapter 7, Guest operating system installation procedures for those procedures.

6.1. Creating guests with virt-install

You can use the virt-install command to create virtualized guests from the command line.

virt-install is used either interactively or as part of a script to automate the creation of virtual machines. Using virt-install with Kickstart files allows for unattended installation of virtual machines.

The virt-install tool provides a number of options one can pass on the command line. To see a complete list of options run:

$ virt-install --help

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 storage options.

An important option is the --vnc option which opens a graphical window for the guest's installation.

This example creates a Red Hat Enterprise Linux 3 guest, named rhel3support, from a CD-ROM, with virtual networking and with a 5 GB file-based block device image. This example uses the KVM hypervisor.

# virt-install --accelerate --hvm --connect qemu:///system \ --network network:default \

--name rhel3support --ram=756\

--file=/var/lib/libvirt/images/rhel3support.img \ --file-size=6 --vnc --cdrom=/dev/sr0

Example 6.1. Using virt-install with KVM to create a Red Hat Enterprise Linux 3 guest

# virt-install --name fedora11 --ram 512 --file=/var/lib/libvirt/images/

fedora11.img \

--file-size=3 --vnc --cdrom=/var/lib/libvirt/images/fedora11.iso Example 6.2. Using virt-install to create a fedora 11 guest

6.2. Creating guests with virt-manager

virt-manager, also known as Virtual Machine Manager, is a graphical tool for creating and managing virtualized guests.

(44)

30

Procedure 6.1. Creating a virtualized guest with virt-manager 1. To start virt-manager run the following command as root:

# virt-manager &

The virt-manager command opens a graphical user interface window. Various functions are not available to users without root privileges or sudo configured, including the New button and you will not be able to create a new virtualized guest.

2. Open the File -> Open Connection. The dialog box below appears. . Select a hypervisor and click the Connect button:

(45)

3. The virt-manager window allows you to create a new virtual machine. Click the New button to create a new guest. This opens the wizard shown in the screenshot.

(46)

32

4. The Create a new virtual system window provides a summary of the information you must provide in order to create a virtual machine:

Review the information for your installation and click the Forward button.

(47)

5. The Choosing a virtualization method window appears. Choose between Para-virtualized or Fully virtualized.

Full virtualization requires a system with Intel® VT or AMD-V processor. If the virtualization extensions are not present the fully virtualized radio button or the Enable kernel/hardware acceleration will not be selectable. The Para-virtualized option will be grayed out if kernel- xen is not the kernel running presently.

If you connected to a KVM hypervisor only full virtualization is available.

Choose the virtualization type and click the Next button.

(48)

Chapter 6. Virtualized guest installation overview

34

6. The Locating installation media prompt asks for the installation media for the type of installation you selected. This screen is dependent on what was selected in the previous step.

a. The para-virtualized installation requires an installation tree accessible using one of the following network protocols: HTTP, FTP or NFS. The installation media URL must contain a Red Hat Enterprise Linux installation tree. This tree is hosted using NFS, FTP or HTTP.

The network services and files can be hosted using network services on the host or another mirror.

Using a CD-ROM or DVD image (tagged as an .iso file), mount the CD-ROM image and host the mounted files with one of the mentioned protocols.

b. A fully virtualized guest installation require bootable installation DVDs, CD-ROMs or images of bootable installation DVDs or CD-ROMs (with the .iso or .img file type) locally. Windows installations use DVD, CD-ROM or .iso file. Many Linux and UNIX-like operating systems use an .iso file to install a base system before finishing the installation with a network based installation tree.

After selecting the appropriate installation media, click the Forward button.

(49)

Creating guests with virt-manager

7. The Assigning storage space window displays. Choose a disk partition, LUN or create a file based image for the guest storage.

The convention for file based images in Red Hat Enterprise Linux 5 all file based guest images are in the /var/lib/xen/images/ directory. Other directory locations for file based images are prohibited by SELinux. If you run SELinux in enforcing mode, refer to Section 11.1, “SELinux and virtualization” for more information on installing guests.

Your guest storage image should be larger than the size of the installation, any additional packages and applications, and the size of the guests swap file. The installation process will choose the size of the guest's swap file based on size of the RAM allocated to the guest.

Allocate extra space if the guest needs additional space for applications or other data. For example, web servers require additional space for log files.

Choose the appropriate size for the guest on your selected storage type and click the Forward button.

lib/xen/images/. If you are using a different location (such as /xen/images/ in this example) make sure it is added to your SELinux policy and relabeled before you continue with the installation (later in the document you will find information on how to modify your SELinux policy).

(50)

36

8. The Allocate memory and CPU window displays. Choose appropriate values for the virtualized CPUs and RAM allocation. These values affect the host's and guest's performance.

Guests require sufficient physical memory (RAM) to run efficiently and effectively. Choose a memory value which suits your guest operating system and application requirements. Most operating system require at least 512MB of RAM to work responsively. Remember, guests use physical RAM. Running too many guests or leaving insufficient memory for the host system results in significant usage of virtual memory. Virtual memory is significantly slower causing degraded system performance and responsiveness. Ensure to allocate sufficient memory for all guests and the host to operate effectively.

Assign sufficient virtual CPUs for the virtualized guest. If the guest runs a multithreaded application assign the number of virtualized CPUs it requires to run most efficiently. Do not assign more virtual CPUs than there are physical processors (or hyper-threads) available on the host system. It is possible to over allocate virtual processors, however, over allocating has a significant, negative affect on guest and host performance due to processor context switching overheads.

(51)

9. The ready to begin installation window presents a summary of all configuration information you entered. Review the information presented and use the Back button to make changes, if necessary. Once you are satisfied click the Finish button and to start the installation process.

A VNC window opens showing the start of the guest operating system installation process.

This concludes the general process for creating guests with virt-manager. Chapter 7, Guest operating system installation procedures contains step-by-step instructions to installing a variety of common operating systems.

6.3. Installing guests with PXE

This section covers the steps required to install guests with PXE. PXE guest installation requires a shared network device, also known as a network bridge. The procedures below cover creating a bridge and the steps required to utilize it the bridge for a PXE installation.

(52)

38

1. Create a new bridge

a. Create a new network script file in the /etc/sysconfig/network-scripts/ directory.

This example creates a file named ifcfg-installation which makes a bridge named installation

# cd /etc/sysconfig/network-scripts/

# vim ifcfg-installation DEVICE=installation TYPE=Bridge

BOOTPROTO=dhcp ONBOOT=yes

Warning

The line, TYPE=Bridge, is case-sensitive. It must have uppercase 'B' and lower case 'ridge'.

b. Start the new bridge.

# ifup installation

c. There are no interfaces added to the new bridge yet. Use the brctl show command to view details about network bridges on the system.

# brctl show

bridge name bridge id STP enabled interfaces installation 8000.000000000000 no

virbr0 8000.000000000000 yes

The virbr0 bridge is the default bridge used by libvirt for Network Address Translation (NAT) on the default Ethernet device.

(53)

2. Add an interface to the new bridge

Edit the configuration file for the interface. Add the BRIDGE parameter to the configuration file with the name of the bridge created in the previous steps.

# Intel Corporation Gigabit Network Connection DEVICE=eth1

BRIDGE=installation BOOTPROTO=dhcp

HWADDR=00:13:20:F7:6E:8E ONBOOT=yes

After editing the configuration file, restart networking or reboot.

# service network restart

Verify the interface is attached with the brctl show command:

# brctl show

bridge name bridge id STP enabled interfaces installation 8000.001320f76e8e no eth1

virbr0 8000.000000000000 yes 3. Security configuration

Configure iptables to allow all traffic to be forwarded across the bridge.

# iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT

# service iptables save

# service iptables restart

Disable iptables on bridges

Alternatively, prevent bridged traffic from being processed by iptables rules. In / etc/sysctl.conf append the following lines:

net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0 Reload the kernel parameters configured with sysctl

# sysctl -p /etc/sysctl.conf 4. Restart libvirt before the installation

Restart the libvirt daemon.

# service libvirtd reload

(54)

40

The bridge is configured, you can now begin an installation.

PXE installation with virt-install

For virt-install append the --network=bridge:BRIDGENAME installation parameter where installation is the name of your bridge. For PXE installations use the --pxe parameter.

# virt-install --accelerate --hvm --connect qemu:///system \ --network=bridge:installation --pxe\

--name EL10 --ram=756 \ --vcpus=4

--os-type=linux --os-variant=rhel5

--file=/var/lib/libvirt/images/EL10.img \ Example 6.3. PXE installation with virt-install

PXE installation with virt-manager

The steps below are the steps that vary from the standard virt-manager installation procedures. For the standard installations refer to Chapter 7, Guest operating system installation procedures.

(55)

1. Select PXE

Select PXE as the installation method.

(56)

42

2. Select the bridge

Select Shared physical device and select the bridge created in the previous procedure.

(57)

3. Start the installation

The installation is ready to start.

A DHCP request is sent and if a valid PXE server is found the guest installation processes will start.

(58)
(59)

Guest operating system installation procedures

This chapter covers how to install various guest operating systems in a virtualized environment on Red Hat Enterprise Linux. To understand the basic processes, refer to Chapter 6, Virtualized guest installation overview.

7.1. Installing Red Hat Enterprise Linux 5 as a para- virtualized guest

This section describes how to install Red Hat Enterprise Linux 5 as a para-virtualized guest. Para- virtualization is a faster than full virtualization and supports all of the advantages of full virtualization.

Para-virtualization requires a special, supported kernel, the kernel-xen kernel.

Important note on para-virtualization

Para-virtualization only works with the Xen hypervisor. Para-virtualization does not work with the KVM hypervisor.

Ensure you have root access before starting the installation.

This method installs Red Hat Enterprise Linux from a remote server. The installation instructions presented in this section are similar to installing from the minimal installation live CD-ROM.

Create para-virtualized Red Hat Enterprise Linux 5 guests using virt-manager or virt-install. For instructions on virt-manager, refer to the procedure in Section 6.2, “Creating guests with virt- manager”.

Create a para-virtualized guest with the command line based virt-install tool. The --vnc option shows the graphical installation. The name of the guest in the example is rhel5PV, the disk image file is rhel5PV.dsk and a local mirror of the Red Hat Enterprise Linux 5 installation tree is ftp://10.1.1.1/trees/RHEL5-B2-Server-i386/. Replace those values with values accurate for your system and network.

# virt-install -n rhel5PV -r 500 \

-f /var/lib/libvirt/images/rhel5PV.dsk -s 3 --vnc -p \ -l ftp://10.1.1.1/trees/RHEL5-B2-Server-i386/

Automating installation

Red Hat Enterprise Linux can be installed without a graphical interface or manual input.

Use Kickstart files to automate the installation process.

Using either method opens this window, displaying the initial boot phases of your guest:

(60)

46

After your guest has completed its initial boot, the standard installation process for Red Hat Enterprise Linux starts. For most systems the default answers are acceptable.

(61)

Procedure 7.1. Para-virtualized Red Hat Enterprise Linux guest installation procedure 1. Select the language and click OK.

(62)

48

2. Select the keyboard layout and click OK.

(63)

3. Assign the guest's network address. Choose to use DHCP (as shown below) or a static IP address:

(64)

50

4. If you select DHCP the installation process will now attempt to acquire an IP address:

(65)

5. If you chose a static IP address for your guest this prompt appears. Enter the details on the guest's networking configuration:

a. Enter a valid IP address. Ensure the IP address you enter can reach the server with the installation tree.

b. Enter a valid Subnet mask, default gateway and name server address.

Select the language and click OK.

(66)

52

6. This is an example of a static IP address configuration:

(67)

7. The installation process now retrieves the files it needs from the server:

Once the initial steps are complete the graphical installation process starts.

(68)

54

If you are installing a Beta or early release distribution confirm that you want to install the operating system. Click Install Anyway, and then click OK:

(69)

Références

Documents relatifs

To configure an interface with static network settings using i fcfg files, for an interface with the name eth0, create a file with name i fcfg -eth0 in the /etc/sysco nfi g

Red Hat Enterprise Linux 7 provides a number of tools that are useful for monitoring system performance and diagnosing performance problems related to I/O and file systems and

Red Hat Enterprise Linux 7 saves power on graphics and display devices by eliminating several sources of unnecessary consumption. LVDS reclo

Red Hat Enterprise Linux 7 moves the resource management settings from the process level to the application level by binding the system of cgroup hierarchies with the systemd

Run the following command to e xamine the inte rnal s tructure of a SCAP docume nt and dis play us e ful information s uch as the docume nt type , s pe cification ve rs ion, a

In the case of storage devices, Red Linux Enterprise Linux contains ud ev rules that create symbolic links in the /d ev/d i sk directory allowing storage devices to be referred to

To start the test, run the command stap -v -e ' pro be vfs. This command simply instructs SystemTap to print read perfo rmed then exit properly once a virtual file system read

To display the current date and time along with detailed information about the configuration of the system and hardware clock, run the ti med atectl command with no additional