Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Applies to SUSE Linux Enterprise Server 11 SP4

3 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. If the operating system has not been optimized for the virtual machine host environment, the unmodified OS can run only on hardware-assisted virtualization computer hardware, in full virtualization mode, and requires specific device drivers to be loaded. The hardware that is presented to the VM Guest depends on the configuration 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
Note: Virtual Machine Architectures

The virtual machine host runs only on 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, however, run both 32-bit and 64-bit operating system.

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.

  • 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.

  • 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 installation sources, see the SUSE Linux Enterprise Server Deployment Guide.

For further prerequisites, consult the manuals of the respective operating system to install.

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 configuration file for the Xen guests that is used for the installation is stored at /etc/xen/vm/. The default location for image files is /var/lib/xen/images. Be aware, that the configuration may be changed later on, but these changes will only be available in the Xend. For more information about Xend, see Section 5.3, “Configuring a Virtual Machine by Modifying its Xend Settings”.

Launch the Create Virtual Machine Wizard by using one of the following methods:

  • From the virtualization host server desktop, click YaST › Virtualization › Create Virtual Machines

  • From within Virtual Machine Manager, click New.

  • At the command line, enter vm-install.

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.

Installing an Operating System
Figure 3.1: Installing an Operating System

If you choose to run an installation program, you are presented with a list of operating systems. Select the one you want to install.

The Summary page shows you a summary of the virtual machine you are creating. You can click on any of the headings to edit the information.

Summary
Figure 3.2: Summary

When running through the creation of a VM Guest, the following steps have to be accomplished:

  1. Select if the VM Guest should run as full or paravirtualized guest.

    If your computer supports hardware-assisted virtualization, you can create a virtual machine that runs in fully virtual mode. If you are installing an operating system that is modified for virtualization, you can create a virtual machine that runs in paravirtual mode. For more information about virtualization modes, see Section 1.2, “Understanding Virtualization Modes”.

  2. Each virtual machine must have a unique name. The name entered on this page is used to create and name the virtual machine’s configuration file. The configuration file contains parameters that define the virtual machine and is saved to the /etc/xen/vm/ directory.

    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).

    Maximum Memory

    The largest amount of memory the virtual machine will ever need.

    Virtual Processors

    If desired, you can specify that the virtual machine has more virtual CPUs than the number of physical CPUs. You can specify up to 32 virtual CPUs: however, for best performance, the number of virtual processors should be less than or equal to the number of physical processors.

  4. In Peripheral Devices, select the keymap layout and graphics mode to use:

    No Graphics Support

    The virtual machine operates like a server without a monitor. You can access the operating system through operating system supported services, such as SSH or VNC.

    Paravirtualized Graphics Adapter

    Requires that an appropriate graphics driver is installed in the operating system.

  5. A virtual machine must have at least one virtual disk. Virtual disks can be:

    • File backed, which means that the virtual disk is a single image file on a larger physical disk.

    • A sparse image file, which means that the virtual disk is a single image file, but the space is not preallocated.

    • Configured from a block device, such as an entire disk, partition, or volume. For more information about available physical storage, see Section 7.1, “Mapping Physical Storage to Virtual Disks”.

    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.

    By default, a single, file-backed virtual disk is created as a sparse image file in /var/lib/xen/images/vm_name where vm_name is the name of the virtual machine. You can change this configuration to meet your specific requirements.

  6. If you want to install from DVD or CD-ROM, add the drive to the list of available hard disks. To learn about device names of the available optical drives, run hwinfo --cdrom and search for the line starting with Device File:. Add this device file to the available hard disks of the VM Guest. The device type that should be used for DVD or CD-ROMs is tap:cdrom.

    Instead of the real DVD or CD-ROM drive, you can also add the ISO image of an installation medium. For more details, see Section 8.1.1, “Virtual CD Readers on Paravirtual Machines”.

    Note, that each CD-Rom drive or ISO image can only be used by one VM Guest at the same time. When installing many VM Guest systems, it may be better to use a network installation source.

  7. By default, a single virtual network card is created for the virtual machine. It has a randomly generated MAC address that you can change to fit your desired configuration. The virtual network card will be attached to a default bridge configured in the host. You can also create additional virtual network cards in the Network Adapters page of vm-install. For more details about virtual networking, see Chapter 6, Virtual Networking.

    Note
    Note: Using Arbitrary Bridge Names

    If installing a fully virtualized guest and you are using a bridge name that is different than the default names, explicitly specify the bridge by selecting the bridge name from the Source menu on the Virtual Network Adapter page. Paravirtual guests by definition are aware they are running on a virtualization platform and therefore, do not need to have the bridge explicitly specified, thus leaving Source as Default will suffice.

  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. Otherwise it would not be available for other installations.

    If the installation program is capable of recognizing an installation profile, response file, or script, you can automate the installation settings by specifying the location of the profile, response file, or script you want to use. For example, SUSE Linux uses an AutoYaST profile, NetWare uses a NetWare Response File, and Red Hat uses a Kickstart file to move through the installation screens with no interaction.

    You can also pass instructions to the kernel at install time by entering parameters for the Additional Arguments field. These arguments may either be kernel options, or options for linuxrc. More information about linuxrc can be found in the Deployment Guide.

If all the information on the Summary screen is correct, click OK to create the virtual machine. A Virt Viewer screen appears and at this point you begin the installation of your OS. From this point on, follow the regular installation instructions for installing your OS.

3.3 Including Add-On Products in the Installation

In order to include an Add-On product in the installation process of a VM Guest, it is necessary to provide the installation system with both, the standard installation images and the image for the Add-On product.

First, add the system disk, the SUSE Linux Enterprise Server 11 SP4 installation image and the physical CD-ROM or Add-On image as disks to the VM Guest. For example, you may have:

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 as Add-On product, this would look like:

hd:///?device=/dev/xvdc

3.4 Using the Command Line to Create Virtual Machines

From the command line, you can enter vm-install to run a text version of the Create Virtual Machine Wizard. The text version of the wizard is helpful in environments without a graphical user interface. This command defaults to using a graphical user interface if available and if no options were given on the command line.

For information on scripting a virtual machine installation, see the man pages of vm-install and vm-install-jobs.

3.5 Deleting Virtual Machines

When you use Virtual Machine Manager or the xm command to delete a virtual machine, it no longer appears as a virtual machine, but its initial start-up file and virtual disks are not automatically deleted.

To delete all components of a virtual machine configured with a file-backed virtual disk, you must manually delete its virtual disk image file (/var/lib/xen/images/) and its initial start-up file (/etc/xen/vm).

3.6 Using an Existing SUSE Linux Enterprise Server Virtual Machine

In SUSE Linux Enterprise Server 10 SP1 and later, the device naming is different than the device naming of SUSE Linux Enterprise Server 10. Therefore, a SUSE Linux Enterprise Server 10 VM Guest will not be able to find its root file system when running on a SUSE Linux Enterprise Server 11 SP4 VM Host Server.

To be able to still boot the system, you must know which device is used for the root partition of your virtual system. For example, hdaxx will be changed to xvdaxx where xx is the partition number.

When booting the system, append an extra root option to the kernel command line, that tells the system about its root file system. If your VM Guest used to live on /dev/hda2, append the string root=/dev/xvda2 to the kernel command line. This option should enable you to boot the system, although additional file systems still will not be available to the system.

To make all the needed file systems available to the VM Guest, do the following:

In order to have a valid initial RAM disk that knows about the new location of the root file system, run the command mkinitrd.

  1. Start the VM Guest with the extra root= command line as explained above.

  2. Log into the system as user root.

  3. Edit the file /etc/fstab and correct all device entries.

  4. Edit the virtual machine’s /boot/grub/menu.lst file. At the kernel line, fix the root= and the resume= parameters according the new naming schema.

  5. Reboot the virtual machine.

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. If the requests for memory exceed the size of the buffer it usually results in a hung boot process. To check if this is the case, switch to console 10 and check the output there for a message similar to

kernel: PCI-DMA: Out of SW-IOMMU space for 32768 bytes at device 000:01:02.0

In this case you need to increase the size of the swiotlb. Enter swiotlb=128 on the Domain0 command line. Note that the number can be adjusted up or down to find the optimal size for the machine.

Print this page