Product SiteDocumentation Site

Lab 2 - Create Virtual Machines

Lab 2 shows you how to create Red Hat Enterprise Linux virtual machines and use templates. The goal of this lab is to have at least two running virtual machines, and be able to connect to them.
This lab assumes that you have successfully installed and configured Red Hat Enterprise Virtualization, and have the necessary Red Hat Enterprise Linux installation images. You should have completed Lab 1 - Install and Configure Basic Setup if you are on Track A or Lab 9 - Install and Configure Minimal Setup if you are on Track B.
Lab 2 - Objectives
This lab takes you through the tasks necessary to create Red Hat Enterprise Linux virtual machines. In addition, you will learn how to create and use virtual machine templates. This lab should take you about 25 minutes.
Section 1, “Create a Red Hat Enterprise Linux Virtual Machine” shows you how to create a new Red Hat Enterprise Linux virtual machine, configure storage and networking, and install the operating system. (10 minutes)
Section 2, “Create a Red Hat Enterprise Linux Template” shows you how to use the Red Hat Enterprise Linux virtual machine as a basis to create a template. (10 minutes)
Section 3, “Clone a Red Hat Enterprise Linux Virtual Machine” shows you how to clone a virtual machine from the Red Hat Enterprise Linux template. (5 minutes)

1. Create a Red Hat Enterprise Linux Virtual Machine

In your current configuration, you should have at least one host available for running virtual machines, and the required installation images in your ISO domain. This section guides you through the creation of a Red Hat Enterprise Linux 6 virtual server. You will perform a normal attended installation using a virtual DVD.
To create a Red Hat Enterprise Linux server
  1. Navigate to the Tree pane and click Expand All. Click the VMs icon in the Default cluster under the Default data center. On the Virtual Machines tab, click New Server.
    Create new Red Hat Enterprise Linux server
    Figure 20. Create new Red Hat Enterprise Linux server

    Fill in the Name field, set the Memory Size to 1 GB, and set the Operating System to Red Hat Enterprise Linux 6.x. You may alter other settings but this example retains the defaults. Click OK to create the virtual machine.
  2. A New Virtual Machine - Guide Me window opens. This allows you to define networks for the virtual machine. Click Configure Network Interfaces.
    New Network Interface configurations
    Figure 21. New Network Interface configurations

    Retain all the default settings and click OK.

    Note

    Red Hat VirtIO is the default selection for Red Hat Enterprise Linux virtual machines. This para-virtualizes network traffic to the guest and improves performance.
  3. You are returned to the Guide Me window. This time, click Configure Virtual Disks to add storage to the virtual machine.
    New Virtual Disk configurations
    Figure 22. New Virtual Disk configurations

    In the Size (GB) field, enter 15. Retain all other default settings and click OK.
  4. Click Configure Later to close the Guide Me window. Your new Red Hat Enterprise Linux 6 virtual machine displays in the Virtual Machines tab.
You have now created your first Red Hat Enterprise Linux virtual machine. Before you can use your virtual machine, install an operating system on it.
To install the Red Hat Enterprise Linux operating system
  1. Before you can use your virtual machine, you have to install an operating system on it. To do so, right click the virtual machine and select Run Once. Configure the following options:
    • Attach CD: Red Hat Enterprise Linux 6
    • Boot Sequence: CD-ROM
    • Display protocol: SPICE
  2. Retain the default settings for the other options and click OK to start the virtual machine.
  3. Select the virtual machine and click the Console ( ) icon. As this is your first time connecting to the virtual machine, allow the installation of SPICE ActiveX and the SPICE client.
  4. After the SPICE plugins have been installed, select the virtual machine and click Console again. This displays a window to the virtual machine, where you will be prompted to begin the installation process. For further instructions, see the Red Hat Enterprise Linux Installation Guide.
  5. After the installation has completed, reboot the virtual machine.
You can now connect to your Red Hat Enterprise Linux 6 virtual machine and start using it.