Novell SUSE LINUX ENTERPRISE DESKTOP 11 Virtualization with Xen

SUSE Linux Enterprise
www.novell.com11 SP1
August18,2010 Virtualization with Xen
Desktop
Virtualization with Xen
All content is copyright © 2006–2010 Novell, Inc. All rights reserved.
Legal Notice
This manual may be freely reproduced, duplicated and distributed either as such or as part of a bundled package in electronic and/or printed format, provided however that the following conditions are ful­lled:
That this copyright notice and the names of authors and contributors appear clearly and distinctively on all reproduced, duplicated and distributed copies. That this manual, specically for the printed format, is reproduced and/or distributed for noncommercial use only. The express authorization of Novell, Inc must be obtained prior to any other use of any manual or part thereof.
For Novell trademarks, see the Novell Trademark and Service Mark list http://www.novell
.com/company/legal/trademarks/tmlist.html. * Linux is a registered trademark of
Linus Torvalds. All other third party trademarks are the property of their respective owners. A trademark symbol (®, ™ etc.) denotes a Novell trademark; an asterisk (*) denotes a third party trademark.
All information found in this book has been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. Neither Novell, Inc., SUSE LINUX Products GmbH, the authors, nor the translators shall be held liable for possible errors or the consequences thereof.
Contents
About This Manual vii
Part I Getting Started with Xen 1
1 Introduction to Xen Virtualization 3
1.1 Basic Components . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Understanding Virtualization Modes . . . . . . . . . . . . . . . . . 5
1.3 Xen Virtualization Architecture . . . . . . . . . . . . . . . . . . . . 5
1.4 The Virtual Machine Host . . . . . . . . . . . . . . . . . . . . . . 6
2 Setting Up a Virtual Machine Host 9
2.1 Best Practices and Suggestions . . . . . . . . . . . . . . . . . . . 10
2.2 Managing Domain0 Memory . . . . . . . . . . . . . . . . . . . . 11
2.3 Network Card in Fully Virtualized Guests . . . . . . . . . . . . . . . 12
2.4 Starting the Virtual Machine Host . . . . . . . . . . . . . . . . . . 14
2.5 PCI Pass-Through . . . . . . . . . . . . . . . . . . . . . . . . . 15
3 Setting Up Virtual Machines 19
3.1 Creating a Virtual Machine . . . . . . . . . . . . . . . . . . . . . 20
3.2 Installing an Operating System . . . . . . . . . . . . . . . . . . . 21
3.3 Including Add-On Products in the Installation . . . . . . . . . . . . . 25
3.4 Using the Command Line to Create Virtual Machines . . . . . . . . . . 26
3.5 Deleting Virtual Machines . . . . . . . . . . . . . . . . . . . . . 26
3.6 Using an Existing SUSE Linux Enterprise Desktop Virtual Machine . . . . . 27
3.7 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . 28
4 Updating SLE 10 Systems to SLE 11 29
4.1 Boot Loader Conguration . . . . . . . . . . . . . . . . . . . . . 30
Part II Advanced Congurations 31
5 Managing a Virtualization Environment 33
5.1 Virtual Machine Manager . . . . . . . . . . . . . . . . . . . . . 34
5.2 Controlling the Host by Modifying Xend Settings . . . . . . . . . . . . 36
5.3 Conguring a Virtual Machine by Modifying its Xend Settings . . . . . . 37
5.4
The xm Command . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.5 Automatic Starting of Domains . . . . . . . . . . . . . . . . . . . 40
5.6 Migrating Xen VM Guest Systems . . . . . . . . . . . . . . . . . . 41
6 Virtual Networking 45
6.1 Virtual Bridges . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.2 Network Devices for Guest Systems . . . . . . . . . . . . . . . . . 47
6.3 Host Based Routing in Xen . . . . . . . . . . . . . . . . . . . . . 48
6.4 Creating a Masqueraded Network Setup . . . . . . . . . . . . . . . 51
6.5 Special Congurations . . . . . . . . . . . . . . . . . . . . . . . 53
7 Block Devices in Xen 59
7.1 Mapping Physical Storage to Virtual Disks . . . . . . . . . . . . . . . 59
7.2 File-Backed Virtual Disks and Loopback Devices . . . . . . . . . . . . 61
7.3 Resizing Block Devices . . . . . . . . . . . . . . . . . . . . . . . 62
8 Virtualization: Conguration Options and Settings 63
8.1 Virtual CD Readers . . . . . . . . . . . . . . . . . . . . . . . . 63
8.2 Remote Access Methods . . . . . . . . . . . . . . . . . . . . . . 66
8.3 VNC Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
8.4 Virtual Keyboards . . . . . . . . . . . . . . . . . . . . . . . . . 69
8.5 Using PVUSB . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
8.6 Using Lock Files . . . . . . . . . . . . . . . . . . . . . . . . . . 74
8.7 HVM Features . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Part III Administration and Best Practices 77
9 Administration Tasks 79
9.1 The Boot Loader Program . . . . . . . . . . . . . . . . . . . . . 79
9.2 Sparse Image Files and Disk Space . . . . . . . . . . . . . . . . . . 82
9.3 Migrating Virtual Machines . . . . . . . . . . . . . . . . . . . . . 84
9.4 Passing Key Combinations to Virtual Machines . . . . . . . . . . . . . 84
9.5 Monitoring Xen . . . . . . . . . . . . . . . . . . . . . . . . . . 85
9.6 Extra Guest Descriptions in Xen Conguration . . . . . . . . . . . . . 87
9.7 Providing Host Information for VM Guest Systems . . . . . . . . . . . 88
10 Save and Restore of Virtual Machines 91
10.1 Saving Virtual Machines . . . . . . . . . . . . . . . . . . . . . . 91
10.2 Restoring Virtual Machines . . . . . . . . . . . . . . . . . . . . . 92
10.3 Virtual Machine States . . . . . . . . . . . . . . . . . . . . . . . 93
11 Xen as High Availability Virtualization Host 95
11.1 Xen HA with Remote Storage . . . . . . . . . . . . . . . . . . . . 95
11.2 Xen HA with Local Storage . . . . . . . . . . . . . . . . . . . . . 96
11.3 Xen HA and Private Bridges . . . . . . . . . . . . . . . . . . . . . 97
12 SUSE Linux Virtual Machines 99
12.1 Using the Add-On Products Program . . . . . . . . . . . . . . . . 100
12.2 Virtual Machine Clock Settings . . . . . . . . . . . . . . . . . . . 100
12.3 Updating a Network Installation Source . . . . . . . . . . . . . . . 102
13 Virtual Machine Drivers 105
Part IV Appendix 107
A Virtual Machine Initial Start-Up Files 109
B SXP Conguration Options 113

About This Manual

This manual offers an introduction to virtualization technology of your SUSE Linux Enterprise Desktop. It features an overview of the various elds of application and in­stallation types of each of the platforms supported by SUSE Linux Enterprise Desktop as well as a short description of the installation procedure.
Many chapters in this manual contain links to additional documentation resources. This includes additional documentation that is available on the system as well as documen­tation available on the Internet.
For an overview of the documentation available for your product and the latest docu­mentation updates, refer to http://www.novell.com/documentation.
Quality service is also available. Experts can answer questions about installation or conguration, make reliable security updates available, and support development projects.
Documentation regarding the Open Enterprise Server 2 is found at http://www
.novell.com/documentation/oes2/index.html.

1 Available Documentation

We provide HTML and PDF versions of our books in different languages. The following manuals for users and administrators are available on this product:
KDE User Guide (↑KDE User Guide)
Introduces the KDE desktop of SUSE Linux Enterprise Desktop. It guides you through using and conguring the desktop and helps you perform key tasks. It is intended mainly for users who want to make efcient use of KDE as their default desktop.
GNOME User Guide (↑GNOME User Guide)
Introduces the GNOME desktop of SUSE Linux Enterprise Desktop. It guides you through using and conguring the desktop and helps you perform key tasks. It is intended mainly for end users who want to make efcient use of GNOME desktop as their default desktop.
Application Guide (↑Application Guide)
Learn how to use and congure key desktop applications on SUSE Linux Enterprise Desktop. This guide introduces browsers and e-mail clients as well as ofce appli­cations and collaboration tools. It also covers graphics and multimedia applications.
Deployment Guide (↑Deployment Guide)
Shows how to install single or multiple systems and how to exploit the product inherent capabilities for a deployment infrastructure. Choose from various approach­es, ranging from a local installation or a network installation server to a mass de­ployment using a remote-controlled, highly-customized, and automated installation technique.
Administration Guide (↑Administration Guide)
Covers system administration tasks like maintaining, monitoring and customizing an initially installed system.
Security Guide (↑Security Guide)
Introduces basic concepts of system security, covering both local and network se­curity aspects. Shows how to make use of the product inherent security software like Novell AppArmor (which lets you specify per program which les the program may read, write, and execute) or the auditing system that reliably collects informa­tion about any security-relevant events.
System Analysis and Tuning Guide (↑System Analysis and Tuning Guide)
An administrator's guide for problem detection, resolution and optimization. Find how to inspect and optimize your system by means of monitoring tools and how to efciently manage resources. Also contains an overview of common problems and solutions and of additional help and documentation resources.
Virtualization with Xen (page 1)
Offers an introduction to virtualization technology of your product. It features an overview of the various elds of application and installation types of each of the platforms supported by SUSE Linux Enterprise Server as well as a short description of the installation procedure.
In addition to the comprehensive manuals, several quick start guides are available:
KDE Quick Start (↑KDE Quick Start)
Gives a short introduction to the KDE desktop and some key applications running on it.
viii Virtualization with Xen
GNOME Quick Start (↑GNOME Quick Start)
Gives a short introduction to the GNOME desktop and some key applications running on it.
OpenOfce.org Quick Start
Gives a short introduction into the OpenOfce.org suite and its modules for writing texts, working with spreadsheets, or creating graphics and presentations.
Installation Quick Start (↑Installation Quick Start)
Lists the system requirements and guides you step-by-step through the installation of SUSE Linux Enterprise Desktop from DVD, or from an ISO image.
Linux Audit Quick Start
Gives a short overview how to enable and congure the auditing system and how to execute key tasks such as setting up audit rules, generating reports, and analyzing the log les.
Novell AppArmor Quick Start
Helps you understand the main concepts behind Novell® AppArmor.
Find HTML versions of most product manuals in your installed system under /usr/ share/doc/manual or in the help centers of your desktop. Find the latest documen­tation updates at http://www.novell.com/documentation where you can
download PDF or HTML versions of the manuals for your product.

2 Feedback

Several feedback channels are available:
Bugs and Enhancement Requests
For services and support options available for your product, refer to http://www
.novell.com/services/.
To report bugs for a product component, please use http://support.novell
.com/additional/bugreport.html.
Submit enhancement requests at https://secure-www.novell.com/rms/
rmsTool?action=ReqActions.viewAddPage&return=www.
About This Manual ix
User Comments
We want to hear your comments and suggestions about this manual and the other documentation included with this product. Use the User Comments feature at the
bottom of each page in the online documentation or go to http://www.novell
.com/documentation/feedback.html and enter your comments there.

3 Documentation Conventions

The following typographical conventions are used in this manual:
/etc/passwd: directory names and lenames
placeholder: replace placeholder with the actual value
PATH: the environment variable PATH
ls, --help: commands, options, and parameters
user: users or groups
Alt, Alt + F1: a key to press or a key combination; keys are shown in uppercase as
on a keyboard
File, File > Save As: menu items, buttons
Dancing Penguins (Chapter Penguins, ↑Another Manual): This is a reference to a chapter in another manual.
x Virtualization with Xen
Part I. Getting Started with Xen

Introduction to Xen Virtualization

Virtualization of operating systems is used in many different computing areas. It nds its applications in server consolidation, energy saving efforts, or the ability to run older software on new hardware, for example. This chapter introduces and explains the components and technologies you need to understand to set up and manage a Xen-based virtualization environment.

1.1 Basic Components

The basic components of a Xen-based virtualization environment are the Xen hypervisor, the Domain0, any number of other VM Guests, and the tools, commands, and congu­ration les that let you manage virtualization. Collectively, the physical computer run­ning all these components is referred to as a VM Host Server because together these components form a platform for hosting virtual machines.
The Xen Hypervisor
The Xen hypervisor, sometimes referred to generically as a virtual machine monitor, is an open-source software program that coordinates the low-level interaction be­tween virtual machines and physical hardware.
The Domain0
The virtual machine host environment, also referred to as Domain0 or controlling domain, is comprised of several components, such as:
1
Introduction to Xen Virtualization 3
• The SUSE Linux operating system, which gives the administrator a graphical and command line environment to manage the virtual machine host components and its virtual machines.
NOTE
The term “Domain0” refers to a special domain that provides the manage­ment environment. This may be run either in graphical or in command line mode.
• The xend daemon (xend), which stores conguration information about each virtual machine and controls how virtual machines are created and managed.
• A modied version of QEMU, which is an open-source software program that emulates a full computer system, including a processor and various peripherals. It provides the ability to host operating systems in full virtualization mode.
Xen-Based Virtual Machines
A Xen-based virtual machine, also referred to as a VM Guest or DomU consists of the following components:
• At least one virtual disk that contains a bootable operating system. The virtual disk can be based on a le, partition, volume, or other type of block device.
• Virtual machine conguration information, which can be modied by exporting a text-based conguration le from xend or through Virtual Machine Manager.
• A number of network devices, connected to the virtual network provided by the controlling domain.
Management Tools, Commands, and Conguration Files
There is a combination of GUI tools, commands, and conguration les to help you manage and customize your virtualization environment.
4 Virtualization with Xen

1.2 Understanding Virtualization Modes

Guest operating systems are hosted on virtual machines in either full virtualization mode or paravirtual mode. Each virtualization mode has advantages and disadvantages.
• Full virtualization mode lets virtual machines run unmodied operating systems, such as Windows* Server 2003 and Windows XP, but requires the computer running as the VM Host Server to support hardware-assisted virtualization technology, such as AMD* Virtualization or Intel* Virtualization Technology.
Some guest operating systems hosted in full virtualization mode, can be congured to run the Novell* Virtual Machine Drivers instead of drivers originating from the operating system. Running virtual machine drivers improves performance dramat­ically on guest operating systems, such as Windows XP and Windows Server 2003. For more information, see Chapter 13, Virtual Machine Drivers (page 105).
• Paravirtual mode does not require the host computer to support hardware-assisted virtualization technology, but does require the guest operating system to be modied for the virtualization environment. Typically, operating systems running in paravir­tual mode enjoy better performance than those requiring full virtualization mode.
Operating systems currently modied to run in paravirtual mode are referred to as paravirtualized operating systems and include SUSE Linux Enterprise Desktop 11 and NetWare® 6.5 SP8.

1.3 Xen Virtualization Architecture

The following graphic depicts a virtual machine host with four virtual machines. The Xen hypervisor is shown as running directly on the physical hardware platform. Note, that the controlling domain is also just a virtual machine, although it has several addi­tional management tasks compared to all other virtual machines.
Introduction to Xen Virtualization 5
Figure 1.1
On the left, the virtual machine host’s Domain0 is shown running the SUSE Linux op­erating system. The two virtual machines shown in the middle are running paravirtualized operating systems. The virtual machine on the right shows a fully virtual machine run­ning an unmodied operating system, such as Windows Server 2003 or Windows XP.
Virtualization Architecture

1.4 The Virtual Machine Host

After you install the virtualization components and reboot the computer, the GRUB boot loader menu displays a Xen menu option. Selecting the Xen menu option loads the Xen hypervisor and starts the Domain0 running the SUSE Linux operating system.
Running on Domain0, the SUSE Linux operating system displays the installed text console or desktop environment, such as GNOME or KDE. The terminals of VM Guest systems are displayed in their own window inside the controlling Domain0 when opened.
6 Virtualization with Xen
Figure 1.2
Desktop Showing Virtual Machine Manager and Virtual Machines
Introduction to Xen Virtualization 7

Setting Up a Virtual Machine Host

This section documents how to set up and use SUSE Linux Enterprise Desktop 11 SP1 as a virtual machine host.
In most cases, the hardware requirements for the Domain0 are the same as those for the SUSE Linux Enterprise Desktop operating system, but additional CPU, disk, memory, and network resources should be added to accommodate the resource demands of all planned VM Guest systems.
TIP
Remember that VM Guest systems, just like physical machines, perform better when they run on faster processors and have access to more system memory.
The following table lists the minimum hardware requirements for running a typical virtualized environment. Additional requirements have to be added for the number and type of the respective guest systems.
Table 2.1
nent
Hardware Requirements
Minimum RequirementsSystem Compo-
2
Computer with Pentium II or AMD K7 450 MHz processorComputer
512 MB of RAM for the hostMemory
Setting Up a Virtual Machine Host 9
Minimum RequirementsSystem Compo-
nent
7 GB of available disk space for the host.Free Disk Space
DVD-ROM DriveOptical Drive
20 GBHard Drive
Ethernet 100 MbpsNetwork Device
IP Address • One IP address on a subnet for the host.
• One IP address on a subnet for each VM Guest.
Xen virtualization technology is available in SUSE Linux Enterprise Desktop products based on code path 10 and later. Code path 10 products include Open Enterprise Server 2 Linux, SUSE Linux Enterprise Desktop 10, SUSE Linux Enterprise Desktop 10, and openSUSE 10.x.
The virtual machine host requires a number of software packages and their dependencies to be installed. To install all necessary packages, run YaST Software Management, select View > Patterns and choose Xen Virtual Machine Host Server for installation. The in­stallation can also be performed with YaST using the module Virtualization > Install Hypervisor and Tools.
After the Xen software is installed, restart the computer.
Updates are available through your update channel. To be sure to have the latest updates installed, run YaST Online Update after the installation has nished.

2.1 Best Practices and Suggestions

When installing and conguring the SUSE Linux Enterprise operating system on the host, be aware of the following best practices and suggestions:
10 Virtualization with Xen
If the host should always run as Xen host, run YaST System > Boot Loader and activate the Xen boot entry as default boot section.
In YaST, click System > Boot Loader.
Change the default boot to the Xen label, then click Set as Default.
Click Finish.
• Close Virtual Machine Manager if you are not actively using it and restart it when needed. Closing Virtual Machine Manager does not affect the state of virtual ma­chines.
• For best performance, only the applications and processes required for virtualization should be installed on the virtual machine host.
• When using both, iSCSI and OCFS2 to host Xen images, the latency required for OCFS2 default timeouts in SP2 may not be met. To recongure this timeout, run
/etc/init.d/o2cb configure or edit O2CB_HEARTBEAT_THRESHOLD in the system conguration.

2.2 Managing Domain0 Memory

When the host is set up, a percentage of system memory is reserved for the hypervisor, and all remaining memory is automatically allocated to Domain0.
A better solution is to set a default amount of memory for Domain0, so the memory can be allocated appropriately to the hypervisor. An adequate amount would be 20 percent of the total system memory up to 2 GB. An appropriate minimum amount would be 512 MB.
2.2.1 Setting a Maximum Amount of Memory
Determine the amount of memory to set for Domain0.
1
Setting Up a Virtual Machine Host 11
2
At Domain0, type xm info to view the amount of memory that is available on the machine. The memory that is currently allocated by Domain0 can be deter-
mined with the command xm list.
Run YaST > Boot Loader.
3
Select the Xen section.
4
5
In Additional Xen Hypervisor Parameters, add dom0_mem=mem_amount where mem_amount is the maximum amount of memory to allocate to Domain0. Add K, M, or G, to specify the size, for example, dom0_mem=768M.
Restart the computer to apply the changes.
6
2.2.2 Setting a Minimum Amount of Memory
To set a minimum amount of memory for Domain0, edit the dom0-min-mem param­eter in the /etc/xen/xend-config.sxp le and restart Xend. For more informa-
tion, see Section 5.2, “Controlling the Host by Modifying Xend Settings” (page 36).

2.3 Network Card in Fully Virtualized Guests

In a fully virtualized guest, the default network card is an emulated Realtek network card. However, it also possible to use the split network driver to run the communication between Domain0 and a VM Guest. By default, both interfaces are presented to the VM Guest, because the drivers of some operating systems require both to be present.
When using SUSE Linux Enterprise, only the paravirtualized network cards are available for the VM Guest by default. The following network options are available:
emulated
To use a “emulated” network interface like an emulated Realtek card, specify (type ioemu) in the vif device section of the Xend conguration. An example
conguration would look like:
12 Virtualization with Xen
(device
(vif
(bridge br0) (uuid e2b8f872-88c7-0a4a-b965-82f7d5bdd31e) (devid 0) (mac 00:16:3e:54:79:a6) (model rtl8139) (type ioemu)
)
)
Find more details about editing the Xend conguration at Section 5.3, “Conguring a Virtual Machine by Modifying its Xend Settings” (page 37).
paravirtualized
When not specifying a model or type, Xend uses the paravirtualized network inter­face:
(device
(vif
(bridge br0) (mac 00:16:3e:50:66:a4) (script /etc/xen/scripts/vif-bridge) (uuid 0a94b603-8b90-3ba8-bd1a-ac940c326514) (backend 0)
)
)
emulated and paravirtualized
If the administrator should be offered both options, simply specify both, type and model. The Xend conguration would look like:
(device
(vif
(bridge br0) (uuid e2b8f872-88c7-0a4a-b965-82f7d5bdd31e) (devid 0) (mac 00:16:3e:54:79:a6) (model rtl8139) (type netfront)
)
)
In this case, one of the network interfaces should be disabled on the VM Guest.
Setting Up a Virtual Machine Host 13

2.4 Starting the Virtual Machine Host

If virtualization software is correctly installed, the computer boots to display the GRUB boot loader with a Xen option on the menu. Select this option to start the virtual machine host.
NOTE: Xen and Kdump
In Xen, the hypervisor manages the memory resource. If you need to reserve system memory for a recovery kernel in Domain0, this memory has to be re­served by the hypervisor. Thus, it is necessary to add the parameter crashkernel=size@offset to the kernel line instead of using the line with the other boot options. For more about Kdump, see also http://www
.novell.com/rc/docrepository/public/37/basedocument .2007-09-13.2960758124/4622069_f_en.pdf.
If the Xen option is not on the GRUB menu, review the steps for installation and verify that the GRUB boot loader has been updated. If the installation has been done without selecting the Xen pattern, run the YaST Software Management, select the lter Patterns and choose Xen Virtual Machine Host Server for installation.
After booting the hypervisor, the Domain0 virtual machine starts and displays its graphical desktop environment. If you did not install a graphical desktop, the command line environment appears.
TIP: Graphics Problems
Sometimes it may happen that the graphics system does not work properly. In this case, add vga=ask to the boot parameters. To activate permanent settings, use vga=mode-0x??? where ??? is calculated as 0x100 + VESA mode from
http://en.wikipedia.org/wiki/VESA_BIOS_Extensions, e.g.
vga=mode-0x361.
Before starting to install virtual guests, make sure that the system time is correct. To do this, congure NTP (Network Time Protocol) on the controlling domain:
In YaST select Network Services > NTP Conguration.
1
14 Virtualization with Xen
Select the option to automatically start the NTP daemon during boot. Provide
2
the IP address of an existing NTP time server, then click Finish.
NOTE: Time Services on Virtual Guests
Hardware clocks commonly are not very precise. All modern operating systems try to correct the system time compared to the hardware time by means of an additional time source. To get the correct time on all VM Guest systems, also activate the network time services on each respective guest or make sure that the guest uses the system time of the host. For more about Independent Wallclocks in SUSE Linux Enterprise Desktop see Section 12.2, “Virtual Ma­chine Clock Settings” (page 100).
For more information about managing virtual machines, see Chapter 5, Managing a Virtualization Environment (page 33).

2.5 PCI Pass-Through

To take full advantage of VM Guest systems, it is sometimes necessary to assign spe­cic PCI devices to a dedicated domain. When using fully virtualized guests, this functionality is only available if the chipset of the system supports this feature, and if it is activated from the BIOS.
This feature is available from both, AMD* and Intel*. For AMD machines, the feature is called IOMMU, in Intel speak, this is VT-d. Note that Intel-VT technology is not sufcient to use this feature for fully virtualized guests. To make sure that your com­puter supports this feature, ask your supplier specically to deliver a system that supports PCI Pass-Through.
Limitations
• Some graphics drivers use highly optimized ways to access DMA. This is not always supported, and thus using graphics cards may be difcult.
• When accessing PCI devices behind a PCIe bridge, all of the PCI devices must be assigned to a single guest. This limitations does not apply to PCIe devices.
• Guests with dedicated PCI devices cannot be live migrated to a different host.
Setting Up a Virtual Machine Host 15
The conguration of PCI Pass-Through is twofold. First, the hypervisor must be in­formed at boot time that a PCI device should be available for reassigning. Second, the PCI device must be assigned to the VM Guest.
2.5.1 Conguring the Hypervisor for PCI Pass-Through
1
Select a device to reassign to a VM Guest. To do this run lspci and read the device number. For example, if lspci contains the following line:
06:01.0 Ethernet controller: Digital Equipment Corporation DECchip 21142/43 (rev 41)
In this case, the PCI number is (06:01.0).
Run YaST > System > Boot Loader.
2
3
Select the Xen section and press Edit.
Add the PCI number to the Optional Kernel Command Line Parameter line:
4
pciback.hide=(06:01.0)
5
When preparing for fully virtualized guests, add the parameter iommu=1 to Additional Xen Hypervisor Parameters.
Press OK and nish YaST.
6
Reboot the system.
7
Check if the device is in the list of assignable devices with the command
8
xm pci-list-assignable-devices
2.5.2 Assigning PCI Devices to VM Guest Systems
There are several possibilities to dedicate a PCI device to a VM Guest:
16 Virtualization with Xen
Adding the device while installing:
During installation, add the pci line to the conguration le:
pci=['06:01.0']
Hot adding PCI devices to VM Guest systems
The command xm may be used to add or remove PCI devices on the y. To Add the device with number 06:01.0 to a guest with name sles11 use:
xm pci-attach sles11 06:01.0
Adding the PCI device to Xend
To add the device to the Xend database, add the following section to the Xend database:
(device
(pci
(dev
(slot 0x01) (domain 0x0) (bus 0x06) (vslt 0x0) (func 0x0)
)
)
)
For more information about modifying the Xend database, see Section 5.3, “Con­guring a Virtual Machine by Modifying its Xend Settings” (page 37).
After assigning the PCI device to the VM Guest, the guest system must care for the conguration and device drivers for this device.
2.5.3 For More Information
There are several resources that provide interesting information about PCI Pass-Through in the net:
• http://wiki.xensource.com/xenwiki/VTdHowTo
http://software.intel.com/en-us/forums/ virtualization-software-development/topic/56802/page/1/
Setting Up a Virtual Machine Host 17
http://software.intel.com/en-us/articles/ intel-virtualization-technology-for-directed-io-vt-d-enhancing-intel-platforms-for-efficient-virtualization-of-io-devices/
http://www.amd.com/us-en/assets/content_type/white_papers _and_tech_docs/34434.pdf
18 Virtualization with Xen

Setting Up Virtual Machines

A virtual machine is comprised of data and operating system les that dene the virtual environment. Virtual machines are hosted and controlled by the VM Host Server. This section provides generalized instructions for installing virtual machines.
Virtual machines have few if any requirements above those required to run the operating system. If the operating system has not been optimized for the virtual machine host environment, the unmodied OS can run only on hardware-assisted virtualization computer hardware, in full virtualization mode, and requires specic device drivers to be loaded. The hardware that is presented to the VM Guest depends on the conguration of the Xend.
You should be aware of any licensing issues related to running a single licensed copy of an operating system on multiple virtual machines. Consult the operating system license agreement for more information.
NOTE: Virtual Machine Architectures
The virtual machine host runs only on x86, AMD64 and Intel 64 hardware. It does not run on other system architectures such as Itanium, or POWER. A 64­bit virtual machine host can also run a 32-bit operating system, while a 32-bit host cannot run a 64-bit client. This holds true for both, the controlling domain and all further guests.
3
Setting Up Virtual Machines 19

3.1 Creating a Virtual Machine

Before creating a virtual machine, you need the following:
Install a host server as described in Chapter 2, Setting Up a Virtual Machine Host (page 9).
• If you want to use an automated installation le (AutoYaST, NetWare® Response File, or RedHat Kickstart), you should create and download it to a directory on the host machine server or make it available on the network.
• For NetWare and OES Linux virtual machines, you need a static IP address for each virtual machine you create.
• If you are installing Open Enterprise Server (OES) 2 Linux, you need a network installation source for OES 2 Linux software. For procedures to create the installa­tion sources, see the SUSE Linux Enterprise Desktop Deployment Guide.
For further prerequisites, consult the manuals of the respective operating system to in­stall.
The Create Virtual Machine Wizard (YaST > Virtualization > Create Virtual Machines) helps you through the steps required to create a virtual machine and install its operating system. The information that follows is generalized for installing any operating system.
The actual conguration le for the Xen guests that is used for the installation is stored at /etc/xen/vm/. The default location for image les is /var/lib/xen/images.
Be aware, that the conguration may be changed later on, but these changes will only be available in the Xend. For more information about Xend, see Section 5.3, “Cong­uring a Virtual Machine by Modifying its Xend Settings” (page 37).
Launch the Create Virtual Machine Wizard by using one of the following methods:
From the virtualization host server desktop, click YaST > Virtualization > Create
Virtual Machine
From within Virtual Machine Manager, click New.
At the command line, enter vm-install.
20 Virtualization with Xen
Loading...
+ 110 hidden pages