Novell SUSE LINUX ENTERPRISE DESKTOP 11 SP1 - 8-18-2010 VIRTUALIZATION WITH ZEN Manual

Virtualization with xen
Table of Contents

Advertisement

Quick Links

SUSE Linux Enterprise
Desktop
11 SP1
August 18, 2010
Virtualization with Xen
www.novell.com

Advertisement

Table of Contents
loading

Summary of Contents for Novell SUSE LINUX ENTERPRISE DESKTOP 11 SP1 - 8-18-2010 VIRTUALIZATION WITH ZEN

  • Page 1 SUSE Linux Enterprise Desktop 11 SP1 www.novell.com Virtualization with Xen August 18, 2010...
  • Page 2 That this manual, specifically 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. http://www.novell For Novell trademarks, see the Novell Trademark and Service Mark list .com/company/legal/trademarks/tmlist.html.
  • Page 3: Table Of Contents

    Contents About This Manual Part I Getting Started with Xen 1 Introduction to Xen Virtualization Basic Components ......Understanding Virtualization Modes .
  • Page 4 4 Updating SLE 10 Systems to SLE 11 Boot Loader Configuration ..... Part II Advanced Configurations 5 Managing a Virtualization Environment Virtual Machine Manager .
  • Page 5 Sparse Image Files and Disk Space ....Migrating Virtual Machines ..... Passing Key Combinations to Virtual Machines .
  • Page 7: About This Manual

    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 configuration, make reliable security updates available, and support development projects.
  • Page 8 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 files the program may read, write, and execute) or the auditing system that reliably collects informa- tion about any security-relevant events.
  • Page 9 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- http://www.novell.com/documentation...
  • Page 10: Documentation Conventions

    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 http://www.novell bottom of each page in the online documentation or go to .com/documentation/feedback.html and enter your comments there.
  • Page 11: Part I Getting Started With Xen

    Part I. Getting Started with Xen...
  • Page 13: Introduction To Xen Virtualization

    Introduction to Xen Virtualization Virtualization of operating systems is used in many different computing areas. It finds 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.
  • Page 14 • 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.
  • Page 15: Understanding Virtualization Modes

    AMD* Virtualization or Intel* Virtualization Technology. Some guest operating systems hosted in full virtualization mode, can be configured 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.
  • Page 16: The Virtual Machine Host

    Figure 1.1 Virtualization Architecture 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 unmodified operating system, such as Windows Server 2003 or Windows XP.
  • Page 17 Figure 1.2 Desktop Showing Virtual Machine Manager and Virtual Machines Introduction to Xen Virtualization...
  • Page 19: Setting Up A Virtual Machine Host

    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.
  • Page 20: Best Practices And Suggestions

    System Compo- Minimum Requirements nent Free Disk Space 7 GB of available disk space for the host. Optical Drive DVD-ROM Drive Hard Drive 20 GB Network Device Ethernet 100 Mbps IP Address • One IP address on a subnet for the host. •...
  • Page 21: Managing Domain0 Memory

    • 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. •...
  • Page 22: Network Card In Fully Virtualized Guests

    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. 3 Run YaST > Boot Loader. 4 Select the Xen section.
  • Page 23 (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 configuration at Section 5.3, “Configuring 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...
  • Page 24: Starting The Virtual Machine Host

    For more about Kdump, see also .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.
  • Page 25: Pci Pass-Through

    2 Select the option to automatically start the NTP daemon during boot. Provide 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.
  • Page 26 The configuration 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 Configuring the Hypervisor for PCI Pass-Through 1 Select a device to reassign to a VM Guest.
  • Page 27: For More Information

    Adding the device while installing: During installation, add the pci line to the configuration file: 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 fly. 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...
  • Page 28 • http://software.intel.com/en-us/articles/ i n t e l - v i r t u a l i z a t i o n - t e c h n o l o g y - f o r - d i r e c t e d - i o - v t - d - e n h a n c i n g - i n t e l - p l a t f o r m s - f o r - e f f i c i e n t - v i r t u a l i z a t i o n - o f - i o - d e v i c e s / •...
  • Page 29: Setting Up Virtual Machines

    Setting Up Virtual Machines A virtual machine is comprised of data and operating system files that define 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.
  • Page 30: Creating A Virtual Machine

    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 file (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.
  • Page 31: Installing An Operating System

    If the wizard does not appear or the vm-install command does not work, review the process of installing and starting the virtualization host server. The virtualization software might not be installed properly. 3.2 Installing an Operating System You can choose to run an installation program or choose a disk or disk image that already has an installed and bootable operating system.
  • Page 32 Figure 3.2 Summary When running through the creation of a VM Guest, the following steps have to be ac- complished: 1 Select if the VM Guest should run as full or paravirtualized guest. If your computer supports hardware-assisted virtualization, you can create a vir- tual machine that runs in fully virtual mode.
  • Page 33 The user interface to the name of the virtual machine also offers the possibility to add a description to the newly generated guest. 3 The Hardware page allows you to specify the amount of memory and number of virtual processors for your virtual machine. Initial Memory The amount of memory initially allocated to the virtual machine (specified in megabytes).
  • Page 34 For best performance, create each virtual disk from an entire disk or a partition. For the next best performance, create an image file but do not create it as a sparse image file. A virtual disk based on a sparse image file delivers the most disk- space flexibility but slows installation and disk access speeds.
  • Page 35: Including Add-On Products In The Installation

    8 The operating system can be installed from a CD/DVD device or an ISO image file. In addition, if you are installing a SUSE Linux operating system, you can install the operating system from a network installation source. If you are installing a paravirtual machine's operating system from CD or DVD, you probably should remove the virtual CD reader from the virtual machine after completing the installation.
  • Page 36: Using The Command Line To Create Virtual Machines

    xvda Main system disk. xvdb ISO image of the installation medium. xvdc ISO image of the Add-On product. During the installation, add the Add-On product to the installation by entering the device path. Commonly, this path looks like hd:///?device=/dev/xvd<letter>. In the special example with “xvdc”...
  • Page 37: Using An Existing Suse Linux Enterprise Desktop Virtual Machine

    3.6 Using an Existing SUSE Linux Enterprise Desktop Virtual Machine In SUSE Linux Enterprise Desktop 10 SP1 and later, the device naming is different than the device naming of SUSE Linux Enterprise Desktop 10. Therefore, a SUSE Linux Enterprise Desktop 10 VM Guest will not be able to find its root file system when running on a SUSE Linux Enterprise Desktop 11 SP1 VM Host Server.
  • Page 38: Troubleshooting

    3.7 Troubleshooting In some circumstances, problems may occur during the installation of the VM Guest. This section describes some known problems and their solutions. During boot, the system hangs The software I/O translation buffer allocates a large chunk of low memory early in the bootstrap process.
  • Page 39 Updating SLE 10 Systems to SLE 11 The update of a Xen VM Host Server is done similarly to the update of a normal SUSE Linux Enterprise system. Simply follow the update description of the new SUSE Linux Enterprise system. To update a SLE 10 SP1 or later virtual machine to SLE 11, complete the following procedure.
  • Page 40: Boot Loader Configuration

    8 Specify the SUSE Linux Enterprise installation source as the Installation Source for the virtual machine. 9 Run through the virtual machine update the same way, as if it would be a physical machine. 10 Click OK to create the virtual machine and start the installation program. A new window displaying the installation program opens on the Domain0.
  • Page 41: Part Ii Advanced Configurations

    Part II. Advanced Configurations...
  • Page 43: Managing A Virtualization Environment

    Managing a Virtualization Environment Graphical utilities, text-based commands, and modified configuration files are methods you can choose from to manage your virtualization environment.Virtual Machine Manager is a graphical utility available in YaST that can be launched from the virtual machine Domain0. Figure 5.1 Desktop Showing Virtual Machine Manager and Virtual Machines Managing a Virtualization Environment...
  • Page 44: Virtual Machine Manager

    From a command line interface on the virtual machine host, you can use the vm-install and xm commands to create and manage virtual machines. You can also edit configuration files to change the settings of the virtual machine host or a virtual machine.
  • Page 45 From remote, the Virtual Machine Manager can also be started as normal user without administrative rights. To start it, run the command virt-manager. If the local ma- chine does not manage virtual domains, the Virtual Machine Manager first has to connect the managing domain of a Xen VM Host Server.
  • Page 46: Controlling The Host By Modifying Xend Settings

    5.2 Controlling the Host by Modifying Xend Settings The Xend is a key component of Xen virtualization. It performs management functions and stores settings that relate to the host environment and each virtual machine. You can customize Xend to meet your specific configuration requirements. Important services that must be configured in this file are: •...
  • Page 47: Configuring A Virtual Machine By Modifying Its Xend Settings

    • To stop the Xend daemon, enter rcxend stop. • To restart the Xend daemon, enter rcxend restart. • To check the status of the Xend daemon, enter rcxend status. The parameters in the xend-config.sxp file can be customized to meet your re- quirements for virtualization.
  • Page 48: The Xm Command

    where vm_name is the name of the virtual machine you want to modify and filename is whatever you want to name the text file. 2 Use a text editor to make and save any desired changes. (domain (domid 1) (bootloader /usr/bin/pygrub) (on_crash destroy) (uuid aa6969f3-8012-24f0-1e3a-35f150001950) (bootloader_args -q)
  • Page 49 For a complete list of the available xm commands, run xm help. For each command, there is a more detailed help available that is obtained with the extra parameter --help. More information about the respective subcommands is available in the manual page of xm.
  • Page 50: Automatic Starting Of Domains

    • Some xm commands return no textual information even though the action is com- pleted. In some instances, for example, when shutting down a virtual machine, the action can take several seconds to complete. To verify that the action has completed, you might need to view its status another way, such as, using the xm list com- mand.
  • Page 51: Migrating Xen Vm Guest Systems

    5.6 Migrating Xen VM Guest Systems With Xen it is possible to migrate a VM Guest system from one VM Host Server to another with almost no service interruption. This could be used for example to move a busy VM Guest to a VM Host Server that has stronger hardware or is not yet loaded. Or, if a service of a VM Host Server is required, all VM Guest systems running on this machine can be migrated to other machines in order to avoid interruption of service.
  • Page 52 VM Guest system. Common possibilities include: • iSCSI can be set up to give access to the same block devices from different systems http://www.novell at the same time. For more information about iSCSI, see .com/documentation/sles11/stor_admin/data/cha_inst_system _iscsi.html.
  • Page 53 5.6.3 Migrating VM Guest Systems The actual migration of the VM Guest system is done with the command: xm migrate --live <domain_name> <host> The option --live must be set to migrate a system that is currently running. The speed of the migration depends on how fast the memory print can be saved to disk, sent to the new VM Host Server and loaded there.
  • Page 55: Virtual Networking

    Virtual Networking All VM Guest need some means to communicate either with other VM Guest systems or with a local network. The network interface to the VM Guest system is made of a split device driver, which means, that any virtual Ethernet device has a corresponding network interface in Domain0.
  • Page 56: Virtual Bridges

    6.1 Virtual Bridges When using SUSE Linux Enterprise Desktop the system configures one bridge for each physical network device by default. For each virtual bridge, a physical Ethernet device is enslaved, and the IP address assigned to the bridge. To add a new bridge, for example, after installing an additional Ethernet device, or to create a bridge that is not connected to a real network, proceed as follows: 1 Start yast2 >...
  • Page 57: Network Devices For Guest Systems

    6.2 Network Devices for Guest Systems The Xen hypervisor is able to provide different types of network interfaces to the VM Guest systems. The preferred network device should be a paravirtualized network inter- face. This yields the highest transfer rates with the lowest requirements to the system. Up to eight network interfaces may be provided for each VM Guest.
  • Page 58: Host Based Routing In Xen

    information may be read from the device naming in Domain0. All virtual devices follow the rule vif<domain number>.<interface_number>. For example, if you want to know the device name for the third interface (eth2) of the VM Guest with id 5, the device in Domain0 would be vif5.2. To obtain a list of all available interfaces, run the command ip a.
  • Page 59 earth with the IP 192.168.1.20, and the VM Guest has the name alice with the IP 192.168.1.21. Procedure 6.1 Configuring a routed IPv4 VM Guest 1 Make sure that alice is shut down. Either use virt-manager or the respective xm commands to shutdown and check. 2 Prepare the network configuration on the VM Host Server earth: 2a Create a hotplug interface that will be used to route the traffic.
  • Page 60 2d To make sure that the switches and routers that the VM Host Server is con- nected to know about the routed interface, activate proxy_arp on earth. Add the following lines to /etc/sysctl.conf: net.ipv4.conf.default.proxy_arp = 1 net.ipv4.conf.all.proxy_arp = 1 2e Activate all changes with the commands: /etc/init.d/boot.sysctl start rcnetwork restart 3 Proceed with configuring the Xen configuration of the VM Guest.
  • Page 61: Creating A Masqueraded Network Setup

    192.168.1.20 - - eth0 default 192.168.1.20 - - 5 Finally, test the network connection from the VM Guest to the world outside as well as from the network to your VM Guest. 6.4 Creating a Masqueraded Network Setup Creating a masqueraded network setup is quite similar to the routed setup. However, there is no proxy_arp needed, and some firewall rules are different.
  • Page 62 FW_ROUTE="yes" • Switch on masquerading in the firewall: FW_MASQUERADE="yes" • Tell the firewall, which network should be masqueraded: FW_MASQ_NETS="192.168.100.1/32" • Remove the networks from the masquerading exceptions: FW_NOMASQ_NETS="" • Finally, restart the firewall with the command: rcSuSEfirewall2 restart 2c Add a static route to the interface of dolly. To accomplish this, add the fol- lowing line to the end of /etc/sysconfig/network/routes: 192.168.100.1 - - dolly.0 2d Activate all changes with the command:...
  • Page 63: Special Configurations

    3e Activate the new configuration and start the VM Guest. 4 The remaining configuration tasks has to be accomplished from inside the VM Guest. 4a Open a console to the VM Guest either with virt-manager or with xm console and log on. 4b Check whether the guest IP is set to 192.168.100.1.
  • Page 64 (device (vif (bridge br0) (mac 00:16:3e:4f:94:a9) (backend 0) (uuid bf840a86-6aa9-62df-f8df-a7cf8c192c24) (script /etc/xen/scripts/vif-bridge) To add a maximum transfer rate, add a parameter rate to this configuration as in: (device (vif (bridge br0) (mac 00:16:3e:4f:94:a9) (rate 100Mb/s) (backend 0) (uuid bf840a86-6aa9-62df-f8df-a7cf8c192c24) (script /etc/xen/scripts/vif-bridge) Note, that the rate is either Mb/s (megabit per second) or MB/s (megabyte per second).
  • Page 65 6.5.2 Monitoring the Network Traffic To monitor the traffic on a specific interface, the little application iftop is a nice program that displays the current network traffic in a terminal. When running a Xen VM Host Server, you have to define the interface that is monitored. The interface that Domain0 uses to get access to the physical network is the bridge de- vice, for example br0.
  • Page 66 To configure a bonding device, use the following procedure: 1 Run YaST > Network Devices > Network Settings. 2 Use Add and change the Device Type to Bond. Proceed with Next. 3 Select how to assign the IP address to the bonding device. Three methods are at your disposal: •...
  • Page 67 • balance-xor • broadcast • 802.3ad • balance-tlb • balance-alb 6 Make sure that the parameter miimon=100 is added to the Bond Driver Options. Without this parameter, the data integrity is not checked regularly. 7 Click Next and leave YaST with OK to create the device. All modes, and lots of more options are explained in detail in the Linux Ethernet Bonding Driver HOWTO found at /usr/src/linux/Documentation/ networking/bonding.txt after installing the package kernel-source.
  • Page 68 2 In the Hardware Dialog, select Device Type VLAN. 3 Change the value of Configuration Name to the ID of your VLAN. Note that VLAN ID 1 is commonly used for managing purposes. 4 Press Next. 5 Select the interface that the VLAN device should connect to below Real Interface for VLAN.
  • Page 69: Block Devices In Xen

    Block Devices in Xen 7.1 Mapping Physical Storage to Virtual Disks Virtual disks can be based on the following types of physical devices and files. Each type includes an example statement. • A physical disk device, such as a DVD, that is accessible as a device to the host. phy:/dev/cdrom •...
  • Page 70 • A remote storage device specified using a Fibre Channel (NPIV) protocol. npiv:210400e08b80c40f To specify a mapping between physical storage and the virtual disk, you might need to edit the virtual machine’s disk information. Follow the instructions in Section 5.3, “Configuring a Virtual Machine by Modifying its Xend Settings”...
  • Page 71: File-Backed Virtual Disks And Loopback Devices

    Protocol Description Example tap:qcow: QEMU disk images accessed by using tap:qcow:/path/file blktap iscsi: iSCSI targets using connections initiated iscsi:IQN,LUN from domain 0 npiv: Fibre Channel connections initiated from npiv:NPIV,LUN domain 0 7.2 File-Backed Virtual Disks and Loopback Devices When a virtual machine is running, each of its file-backed virtual disks consumes a loopback device on the host.
  • Page 72: Resizing Block Devices

    7.3 Resizing Block Devices While it is always possible to add new block devices to a VM Guest system, it is sometimes more desirable to increase the size of an existing block device. In case such a system modification is already planned during deployment of the VM Guest, some basic considerations should be done: •...
  • Page 73: Virtualization: Configuration Options And Settings

    It is provided as a courtesy and does not imply that all documented options and tasks are supported by Novell, Inc. 8.1 Virtual CD Readers Virtual CD readers can be set up when a virtual machine is created or added to an ex- isting virtual machine.
  • Page 74 Paravirtualized guests can use the device type tap:cdrom:. This partly emulates the behavior of the real CD reader, and allows CDs to be changed. It is even possible to use the eject command to open the tray of the CD reader. 8.1.2 Virtual CD Readers on Fully Virtual Machines A fully virtual machine can have up to four block devices comprised of virtual CD...
  • Page 75 6 When assigning an image file, use the following command: xm block-attach alice file:/path/to/file.iso xvdb r 7 The image files may easily be removed by using virt-manager. However, note that when adding CD readers, virt-manager uses a different device backend for the CD reader that is not capable of changing CDs. 8 A new block device, such as /dev/xvdb, is added to the virtual machine.
  • Page 76: Remote Access Methods

    2 If the virtual CD reader is mounted, unmount it from within the virtual machine. Enter cat /proc/partitions in the virtual machine's terminal to view its block devices. 3 Run Virtual Machine Manager. 4 Select the virtual machine, then click Details. 5 Click Hardware >...
  • Page 77: Vnc Viewer

    can then use Virtual Machine Manager and the xm command to manage virtual machines and the vm-install command to create them. Text Only You can use the ssh command from a remote computer to log in to a virtual ma- chine host and access its text-based console.
  • Page 78 To access the virtual machine from the local console running a VNC viewer client, enter one of the following commands: • vncviewer ::590# • vncviewer :# # is the VNC viewer port number assigned to the virtual machine. When accessing the VM Guest from a machine other than Domain0, use the following syntax: vncviewer 192.168.1.20::590# In this case, the IP address of Domain0 is 192.168.1.20.
  • Page 79: Virtual Keyboards

    Assign higher port numbers to avoid conflict with port numbers assigned by the VNC viewer, which uses the lowest available port number. 8.3.2 Using SDL instead of a VNC Viewer If you access a virtual machine's display from the virtual machine host console (known as local or on-box access), you might want to use SDL instead of VNC viewer.
  • Page 80 To view a virtual machine's current keymap entry, enter the following command on the Domain0: xm list -l vm_name | grep keymap You can specify a keymap entry to be used for all virtual machines and keymap entries for specific machines. •...
  • Page 81 Language Keymap Setting English (US) en-us Spanish Finnish French French-Belgium fr-be French-Canada fr-ca French-Switzerland fr-ch Hungarian Icelandic Italian Japanese Dutch Dutch-Belgium nl-be Norwegian Polish Portuguese Portuguese-Brazil pt-br Russian Swedish Virtualization: Configuration Options and Settings...
  • Page 82: Using Pvusb

    8.5 Using PVUSB USB (Universal Serial Bus) is a common method to extend the capabilities of a work- station. It is possible to attach an arbitrary number of devices to the machine, providing for example extended storage, additional keyboard or mouse, Webcams and other de- vices.
  • Page 83 5 If you installed the package usb-utils, you can now see the host controller in the USB device list with the command lsusb. 6 Check if you can list the virtual host controller from the VM Host Server with the command xm usb-list alice 7 On the VM Host Server system, check, which devices may be assigned to a guest with the command: xm usb-list-assignable-devices...
  • Page 84: Using Lock Files

    8.6 Using Lock Files When working with several VM Host Server systems that may run a pool of guests, a common task is to ensure that the guest systems are not started twice. Depending on the used block and network devices, this could lead to network problems as well as corrupted block devices.
  • Page 85 Procedure 8.2 Select Boot Device in virt-manager 1 Start virt-manager and connect to the needed Xen host. 2 Right-click the stopped machine, and select Open. 3 Choose Details to get an overview over the VM Guest. 4 Select Boot Options. 5 A drop down box appears, that gives you a selection of bootable devices.
  • Page 86 Intel http://www.intel.com/Assets/PDF/appnote/241618.pdf The cpuid is organized in several 32 bit bitmasks. In an sxp configuration, a cpuid entry that just supplies values with the default policy would look like the following: (cpuid ( (0 (eax xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) (edx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) (ebx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) (ecx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) The respective bits may be changed by using the following values: Force the corresponding bit to 1...
  • Page 87: Part Iii Administration And Best Practices

    Part III. Administration and Best Practices...
  • Page 89: Administration Tasks

    Administration Tasks 9.1 The Boot Loader Program The boot loader controls how the virtualization software boots and runs. You can modify the boot loader properties by using YaST, or by directly editing the boot loader configuration file. The YaST boot loader program is located at YaST > System > Boot Loader. The Boot Loader Settings screen lists the sections that appear as options on the boot menu.
  • Page 90 Figure 9.1 Boot Loader Settings Select the Xen section, then click Edit to manage the way the boot loader and Xen function. Figure 9.2 Boot Loader Settings: Section Management You can use the Boot Loader program to specify functionality, such as: •...
  • Page 91 • Specify the kernel image and initial RAM disk. • Select a specific hypervisor. • Pass additional parameters to the hypervisor (see /usr/share/doc/packages/ xen/pdf/user.pdf section “Xen Boot Options” after installing the package xen-doc-pdf). You can customize your virtualization environment by editing the /boot/grub/ menu.lst file.
  • Page 92: Sparse Image Files And Disk Space

    For more information about hypervisor parameters, see /usr/share/doc/ packages/xen/pdf/user.pdf section “Xen Boot Options” after installing the package xen-doc-pdf. The first module line specifies the directory and filename of the Linux kernel to load. Replace kernel_parameters with the parameters to pass to the kernel. These parameters are the same parameters as those that can be passed to a standard Linux kernel on physical computer hardware.
  • Page 93 -l /dev/xvdb. The device name depends on the actually increased device. The resizing of the file system inside the sparse file involves tools that are depending on the actual file system. This is described in detail in the Storage Administration Guide, http://www.novell.com/documentation/sles11/stor_admin/ found at data/bookinfo.html.
  • Page 94: Migrating Virtual Machines

    9.3 Migrating Virtual Machines A running virtual machine can be migrated from its source virtual machine host to an- other virtual machine host. This functionality is referred to as live migration. For live migration the virtual machine being migrated must have access to its storage in exactly the same location on both, source and destination host platforms.
  • Page 95: Monitoring Xen

    For example, to pass Ctrl + Alt + F2 to a Linux virtual machine, press Ctrl three times, then press Alt + F2 . You can also press Alt three times, then press Ctrl + F2 . The sticky key functionality is available in the Virtual Machine Manager during and after installing a virtual machine.
  • Page 96 9.5.2 Monitor Xen with xentop Information is also available when only a standard terminal is available on no X envi- ronment. The preferred tool to gather information in this case is xentop. Unfortunately, this tool needs a rather broad terminal, else it inserts line breaks into the display. xentop has several command keys that can give you more information about the system that is monitored.
  • Page 97: Extra Guest Descriptions In Xen Configuration

    brctl In a standard setup, all the Xen VM Guest systems are attached to a virtual network bridge. brctl allows you to determine the connection between the bridge and the virtual network adapter in the VM Guest system. For example, the output of brctl show may look like the following: bridge name bridge id...
  • Page 98: Providing Host Information For Vm Guest Systems

    graphical interface for changing the name also contains an extra description line, that may be used to add a single line of text. When using the Xen configuration files in /etc/xen/vm, the syntax for setting the description looks like this: description="Responsible: tux@example.com"...
  • Page 99 4 Start the vhostmd daemon with the command rcvhostmd start. If vhostmd should be started automatically during startup of the system, run the command: chkconfig vhostmd on 5 Attach the image file /dev/shm/vhostmd0 to the VM Guest system named alice with the command: xm block-attach alice tap:aio:/dev/shm/vhostmd0 xvdb r 6 Log on on the VM Guest system.
  • Page 101: 0 Save And Restore Of Virtual Machines

    Save and Restore of Virtual Machines 10.1 Saving Virtual Machines The save operation preserves the exact state of the virtual machine’s memory. The op- eration is slightly similar to hibernating a computer. The virtual machine is off, but it can be quickly restored to its previously saved running condition. The operation does not make a copy of any portion of the virtual machine’s virtual disk.
  • Page 102: Restoring Virtual Machines

    2 Select the virtual machine. 3 Click Open to view the virtual machine console or Details to view virtual machine information. 4 Select Virtual Machine > Save from the menu. 5 Name and save the file. Procedure 10.2 Save a Virtual Machine’s Current State (xm Command) 1 Make sure the virtual machine to be saved is running.
  • Page 103: Virtual Machine States

    3 Select the hypervisor that should restore the virtual machine. On the local machine, this is localhost. 4 In Virtual Machine Manager, click File > Restore Saved Machine from the drop- down menu. 5 Specify the previously saved file. 6 Click Open. The virtual machine and the guest operating system are restored to the previously saved state.
  • Page 104 • c - crashed - The virtual machine has crashed and is not running. • d - dying - The virtual machine is in the process of shutting down or crashing. Virtualization with Xen...
  • Page 105: 1 Xen As High Availability Virtualization Host

    Xen as High Availability Virtualization Host Setting up two Xen hosts as a failover system has several advantages compared to a setup where every server runs on dedicated hardware. • Failure of a single server does not cause major interruption of the service. •...
  • Page 106: Xen Ha With Local Storage

    When setting up a new system, one of the main considerations is, if a dedicated storage area network should be implemented. The following possibilities are available: Table 11.1 Xen Remote Storage Method Complexi- Comments Ethernet Note, that all block device traffic goes over the same Ethernet interface as the network traffic.
  • Page 107: Xen Ha And Private Bridges

    During the setup, each of the required block devices should use its own DRBD device. The setup of such a system is quite a complex task. An example that is actually used http://en.opensuse.org/Xen3 in a productive environment is described in _and_Distributed_Local_Storage.
  • Page 109: 2 Suse Linux Virtual Machines

    SUSE Linux Virtual Machines On current SUSE Linux Enterprise systems, Xen is fully integrated into the product. It may be used as VM Host Server or VM Guest. To change the size of the VNC display, an extra option must be supplied to the Xen boot options.
  • Page 110: Using The Add-On Products Program

    12.1 Using the Add-On Products Program The Add-On Products program is available during the SLE operating system installation and after installation at YaST > Software > Add-On Products. It allows you to install additional products that may reside on a separate CD, ISO image file, or installation source.
  • Page 111 that need to be synchronized. To effectively use an external time source, such as NTP, for time synchronization on a virtual machine, the virtual machine's independent wall- clock setting must be enabled (set to 1). Otherwise, it will continue to synchronize its time with its host.
  • Page 112: Updating A Network Installation Source

    /srv/ftp. Create this directory manually, if it does not exist already. 1 Get the latest kernel package for your system from the Novell Customer Center. 2 Create a directory for executables in your home directory: mkdir -p $HOME/bin 3 Copy the script create_update_source.sh from http://www.suse...
  • Page 113 cd $HOME/bin wget http://www.suse.de/~ug/tools/create_update_source.sh chmod 755 create_update_source.sh 4 Install the package inst-source-utils. Then, change your working direc- tory to your network installation source. 5 Run the command $HOME/bin/create_update_source.sh /srv/ftp. 6 Copy all updated packages to the directory /srv/ftp/updates/suse/ <arch>/. 7 Run the following commands to make all the new packages known to the instal- lation source: cd /srv/ftp/updates/suse;...
  • Page 115: 3 Virtual Machine Drivers

    The SUSE® Linux Enterprise Virtual Machine Driver Pack is available as an add-on product for SUSE Linux Enterprise Desktop. For detailed information please refer to http://www.novell.com/products/vmdriverpack/. Virtual Machine Drivers...
  • Page 117: Part Iv Appendix

    Part IV. Appendix...
  • Page 119 Virtual Machine Initial Start-Up Files During the process of creating a new virtual machine, initial start-up settings are written to a file created at /etc/xen/vm/. During the creation process, the virtual machine starts according to settings in this file, but the settings are then transferred and stored in xend for ongoing operations.
  • Page 120 Table A.1 Initial start-Up File Entries and Descriptions Entry Description disk = Virtual disks for the virtual machine. For example: disk = [ 'file:/var/lib/xen/images/VM1_SLES10/hda,xvda,w' This entry specifies a virtual disk based on a file ( file:) named hda and located at /var/lib/xen/images/VM1_SLES10/.
  • Page 121 Entry Description on_crash = Specifies the action that the virtual machine performs when the operating system crashes. extra = Parameters passed to the kernel. bootloader = Location and filename of the domU boot loader. bootentry = Location of the kernel and initial ramdisk. ostype = Type of operating system.
  • Page 123 SXP Configuration Options The Xend can read and write all of its configurations in a semi-structured form, also called “S-expression”. These expressions are either stand-alone, or have another expres- sion as argument. For example, to define that a VM Guest has 2 CPUs available, the expression would look like: (domain (vcpus 2)
  • Page 124 domain (5) domain — Top Xend VM Guest SXP Configuration Element Synopsis (domain { bootloader | bootloader_args | cpus |cpu_time | description | device | features | image | maxmem | memory | name | online_vcpus | on_crash | on_poweroff | on_reboot | on_xend_start | on_xend_stop | shadow_memory | start_time | status | store_mfn | uuid | vcpus }) The top level element of each VM Guest configuration is “(domain)”.
  • Page 125 (cpu_time 59.157413326) description Extra description for a VM Guest. (description 'HVM guest') device (device { console | pci | vbd | vfb | vif | vkbd | vusb }) All devices that are presented to the VM Guest start with the element “device” 1 console (console { location | protocol | uuid }) Defines the console that can be accessed with xm console id.
  • Page 126 1.3 uuid Unique identifier for this device. Example: (uuid 7892de3d-2713-a48f-c3ba-54a7574e283b) 2 pci (pci { dev | uuid }) Defines the device of a PCI device that is dedicated to the given VM Guest. The PCI device number is organized as [[[[domain]:]bus]:][slot][.[func]]. 2.1 dev (dev { bus | domain | func | slot | uuid | vslt }) Defines the path to the PCI device that is dedicated to the given VM Guest.
  • Page 127 vslt Defines the virtual slot for the PCI device in the VM Guest system. (vslt 0x0) 2.2 uuid Unique identifier for this device. Example: (uuid 9bef35d3-17c6-ac75-ac28-1aecb1cb509d) 3 vbd (vbd { backend | bootable | dev | mode | protocol | uname | uuid | VDI }) Defines a virtual block device.
  • Page 128 3.5 protocol Defines the IO protocol to use for the VM Guest. Example: (protocol x86_64-abi) 3.6 uname Defines where the virtual block device really stores its data. See also Section 7.1, “Mapping Physical Storage to Virtual Disks” (page 59). Example: (uname file:/var/lib/xen/images/sles11/disk1) 3.7 uuid Unique identifier for the current virtual block device.
  • Page 129 (location localhost:5900) 4.3 type Defines whether to use VNC or SDL. VNC will only provide a server that has to be connected from a client. SDL provides a display that is started on creation of the VM Guest. Example: (type vnc) 4.4 uuid Unique identifier for the current virtual frame buffer device.
  • Page 130 5.2 bridge Defines the bridge where the virtual network interface should connect to. Example: (bridge br0) 5.3 mac Defines the mac address of the virtual network interface. The mac addresses reserved for Xen virtual network interfaces look like 00:16:3E:xx:xx:xx. Example: (mac 00:16:3e:32:e7:81) 5.4 model When using emulated IO, this defines the network interface that should be presented...
  • Page 131 6.1 backend Defines the backend domain that is used for paravirtualized keyboard interfaces. Exam- ple: (backend 0) 7 vusb (vusb { backend | num-ports | usb-ver | port-? }) Defines a virtual USB controller for the VM Guest. This is needed before any USB device can be assigned to the guest.
  • Page 132 image (image { linux | HVM }) This is the container for the main machine configuration. The actual image type is either Linux or HVM for fully virtualized guests. HVM is only available if your computer supports VMX and also activates this feature during boot. 1 linux (linux { args | device_model | kernel | notes }) The linux image definition is used for paravirtualized Linux installations.
  • Page 133 | pae | pci | rtc_timeoffset | serial | stdvga | timer_mode | usb | usbdevice | vnc | vncunused | xauthority }) The HVM image definition is used for all fully virtualized installations. 2.1 acpi Defines if ACPI (Advanced Configuration and Power Interface) functionality should be available to the VM Guest.
  • Page 134 2.7 hap Defines if hardware assisted paging should be enabled. Enabled with value 1, disabled with value 0. Example: (hap 1) 2.8 hpet Defines if the emulated multimedia timer hpet should be activated. Enabled with value 1, disabled with value 0. Example: (hpet 0) 2.9 isa Defines if an ISA-only system should be emulated.
  • Page 135 2.14 monitor Defines if the device model (for example, qemu-dm) should use monitor. Use Ctrl + Alt + 2 in the VNC viewer to connect to the monitor. Example: (monitor 0) 2.15 nographic Defines if the device model should disable the graphics support. Example: (nographic 0) 2.16 notes Displays several settings and features available to the current VM Guest.
  • Page 136 (serial /dev/ttyS0) 2.21 stdvga Defines if a standard vga (cirrus logic) device should be used. Example: (stdvga 0) 2.22 timer_mode Defines if the timer should be delayed when ticks are missed or if the real time should always be used. 0 delays the virtual time, 1 always uses the real time. (timer_mode 0) 2.23 usb Defines if USB devices should be emulated.
  • Page 137 maxmem Defines how much memory in MB can be assigned to the VM Guest while running. Example: (maxmem 1024) memory Defines the initial amount of memory in MB of the VM Guest. Example: (memory 512) name The name of the VM Guest as it appears in different managing utilities. Example: (name sles11) online_vcpus Number of CPUs that are currently available to the VM Guest.
  • Page 138 2 coredump-restart Dumps the core of the VM Guest before restarting it. Example: (on_crash coredump-restart) 3 destroy The VM Guest is cleaned up. Example: (on_crash destroy) 4 preserve In order to clean up a VM Guest with preserve status, it has to be destroyed manually. Example: (on_crash preserve) 5 rename-restart...
  • Page 139 Defines the behavior after a domain exits because of a reboot. For details about the available parameters, see the section called “on_crash” (page 127). on_xend_start (on_xend_start { destroy | preserve | rename-restart | rename | start }) Defines the behavior when Xend starts. For details about the available parameters, see the section called “on_crash”...
  • Page 140 The VM Guest is suspended. The VM Guest is running. Example: (status 0) store_mfn Number of shared pages for the current VM Guest. Example: (store_mfn 262141) uuid Unique identifier for this VM Guest. Example: (uuid 7892de3d-2713-a48f-c3ba-54a7574e283b) vcpus Number of virtually available CPUs in the current VM Guest. Example: (vcpus 2) Virtualization with Xen...

This manual is also suitable for:

Suse linux enterprise desktop 11 sp1

Table of Contents