Bookmark this page

Guided Exercise: Installing Virtual Machines

In this lab, you will install a virtual machine in your Red Hat Virtualization environment.

Outcomes

You should be able to install a new virtual machine, associate that machine with available logical networks, and install the qemu-guest-agent package.

Log in to workstation as student using student as the password.

On workstation, run the lab vms-install start command. This command runs a start script that determines if the Red Hat Virtualization environment is configured and working.

[student@workstation ~]$ lab vms-install start
  1. Download the RHEL 7.6 boot ISO file to the /home/student/Downloads directory on workstation, in preparation for uploading the file to RHV-M. You will use this boot ISO to initiate the installation of a RHEL 7.6 virtual machine.

    [student@workstation ~]$ wget -P ~/Downloads \
    http://materials.example.com/rhel-server-7.6-x86_64-boot.iso
    ...output omitted...
    HTTP request sent, awaiting response... 200 OK
    Length: 571473920 (545M) [application/octet-stream]
    Saving to: ‘/home/student/Downloads/rhel-server-7.6-x86_64-boot.iso’
    ...output omitted...
  2. Use the RHV-M Administration Portal to upload the RHEL 7.6 boot ISO file.

    1. On workstation, open Firefox and navigate to https://rhvm.lab.example.com.

    2. Click the Administration Portal link, and log in using admin as the username, redhat as the password, and internal as the profile.

    3. View existing disks by clicking Storage in the menu, and then selecting Disks.

    4. Open the Upload Image wizard by clicking Upload in the upper-right corner, and then selecting Start.

    5. Select the RHEL 7.6 boot ISO by clicking the Choose File button. In the File Upload window, click Downloads in the menu and then double-click the rhel-server-7.6-x86_64-boot.iso file to choose that file. Locate the rhel-server-7.6-x86_64-boot.iso if it was downloaded to a different location.

    6. In the Upload Image window, verify that Data Center is set to development and Storage Domain is set to iscsi-data . Accept the default settings for everything else.

    7. In a previous guided exercise, you should have downloaded the ovirt-engine certificate. Click the Test Connection button to verify this. If clicking the Test Connection button returns a green success box, then you are ready to upload. If clicking the Test Connection button returns an orange warning box, then click the ovirt-engine certificate link within the warning box. Select the check box next to Trust this CA to identify websites, and then click the OK button. Next, click the Test Connection button again. It should return a green success box.

      Important

      If you forget to enable the check box next to Trust this CA to identify websites, the following procedure will return you to the applicable window:

      1. Open Preferences for Firefox, and then select Privacy & Security in the left menu.

      2. Scroll down to the Security section and click the View Certificates... button.

      3. In the Certificate Manager window, scroll down to lab.example.com, click rhvm.lab.example.com.34088 to highlight it, and then click the Delete or Distrust button.

      4. Back on the Preferences tab for Privacy & Security, scroll up to the Cookies and Site Data section, and then click the Clear Data... button.

      5. Accept the default selections and click the Clear button. Confirm your choice by clicking the Clear Now button in the new window that displays.

    8. Click the OK button to start the upload process.

  3. Verify that the ISO uploaded successfully.

    1. The Disks table should list a disk with an Alias of rhel-server-7.6-x86_64-boot.iso. Within a few minutes, the disk Status will update to OK.

  4. Navigate to Compute in the menu bar, and then select Virtual Machines to see a list of existing virtual machines.

  5. Create a new virtual machine named rhel-vm1, in the clusterone cluster of the development data center, according to the following specifications:

    Install the virtual machine with Red Hat Enterprise Linux 7. Create a Small instance customized to use two CPUs. Optimize the virtual machine for the Server type. Create a disk image that is 3 GB in size. Associate the network interface for this virtual machine with the vm-net logical network. Use the Advanced option to set the memory balloon device enabled.

    1. On the Compute >> Virtual Machines page, click the New button. In the New Virtual Machine window that opens, select the following settings:

      • In the Cluster section, choose the clusterone cluster.

      • As the Operating System, select Red Hat Enterprise Linux 7.x x64.

      • Click the Instance Type drop-down list and choose Small.

      • Click the Optimized for drop-down list and choose Server. Note that the Instance Type previously selected changes from Small to Custom.

      • In the Name field, type rhel-vm1 as the name for the virtual machine.

      • In the Description field, type RHEL Guest using development data center.

      Note

      Selecting an instance type populates memory and CPU values for the virtual machine. These values are visible from the System tab when viewing advanced options. Although choosing either Server or High Performance from the Optimized for menu will switch the Instance Type menu back to Custom, the memory and CPU values for the instance type that you selected will remain the same.

    2. In the New Virtual Machine window, configure a disk for the new VM. On the Instance Images line, click the Create button. Specify the Size of the image as 3 GB. Leave all other options with their default values and confirm by clicking the OK button.

      Notice that there is a new entry under the Instance Images line. This entry confirms that the new image, defined in the previous step, will be created for the new virtual machine, once accepted.

    3. Assign the logical network vm-net to nic1.

      In the bottom part of the New Virtual Machine window, choose a network interface by clicking the Please select an item list next to the nic1 network card. From the list, choose the vm-net/vm-net logical network.

    4. Click the Show Advanced Options button.

      Click the System tab to access the CPU and memory settings for this virtual machine.

      Change the value in the Total Virtual CPUs line to 2.

      Click the Resource Allocation tab to access settings for memory allocation.

      Make sure that the check box for Memory Balloon Device Enabled option is enabled.

    5. To confirm the creation of this virtual machine, click the OK button.

      Notice that on the list of available virtual machines, the new rhel-vm1 virtual machine is displayed.

  6. Temporarily modify the configuration of the virtual machine so that it boots using the Red Hat Enterprise Linux installation image in the virtual CD-ROM/DVD-ROM device, and then boot it.

    1. Click the name of the rhel-vm1 virtual machine. In the Run drop-down list, select Run Once.

    2. Click the + icon next to Boot Options to open the Boot Options window.

    3. Select the check box next to Attach CD. From the drop-down list of available ISO files, choose the Red Hat Enterprise Linux boot ISO rhel-server-7.6-x86_64-boot.iso. This inserts the ISO file into the virtual CD-ROM/DVD-ROM drive.

    4. In the Predefined Boot Sequence list, choose the CD-ROM by clicking on it. With the CD-ROM highlighted, click the Up button once, to bring the CD-ROM drive to the top of the Boot Sequence list.

    5. Click the OK button to confirm your changes and to boot the virtual machine from the Red Hat Enterprise Linux boot ISO.

  7. Open the virtual machine console, and begin a Kickstart installation of the virtual machine.

    1. Once the virtual machine has started, and the console button becomes available, click the Console button to start the Red Hat Enterprise Linux installation. Open the console.vv file using Remote Viewer by clicking the OK button.

    2. When you hover over the console window, a prompt displays to either deny or allow the Remote Viewer to inhibit shortcuts. Click the Allow button.

    3. It may take a minute to get to the installation screen. When it displays, highlight Install Red Hat Enterprise Linux 7.6, and then press the Tab key to edit the installer options.

    4. The editor should open with the cursor automatically positioned at the end of the existing kernel arguments. At the end of the kernel command line, add a space and the argument inst.ks=http://materials.example.com/static/small-7.6.cfg to specify the location of your Kickstart file.

    5. Press Enter to start the Kickstart installation of the virtual machine.

  8. Watch for the installation to complete. Please be patient as the installation may take up to 10 minutes to complete. After the installation completes, the virtual machine automatically reboots from the CD. Do not worry if it looks like the virtual machine wants to proceed with another installation.

  9. Close the console and then power off the virtual machine by clicking the Shutdown drop-down menu and then selecting Power Off. Click the OK button to confirm that you want to power off the machine.

  10. To test the rhel-vm1 virtual machine, power it on by clicking the Run button. In some cases the Run button may be accessible before the virtual machines has fully shut down. If clicking the Run button results in an error, simply wait a few seconds and then try again.

  11. Once available, open the console by clicking the Console button.

  12. When you hover over the console window, you are prompted to either deny or allow the Remote Viewer to inhibit shortcuts. Click the Allow button.

  13. After the virtual machine starts, log in as the root user with a password of redhat.

  14. In the following steps, you install the qemu-guest-agent package inside the virtual machine. The host name displayed in the example prompts is likely different than what you see on your screen.

    1. To install the necessary software packages on your rhel-vm1 virtual machine, ensure that the system is registered with Red Hat Subscription Manager and has the correct entitlements and Yum repositories enabled.

      In the classroom environment, this step is different because the classroom does not have access to the Content Distribution Network or a Red Hat Satellite server. Instead, local Yum repositories have been provided, which contain the correct packages.

      Download the rhel_dvd.repo file from http://materials.example.com/yum.repos.d/rhel_dvd.repo, and place it in the /etc/yum.repos.d/ directory to enable those repositories.

      [root@rhel-vm1 ~]# curl http://materials.example.com/yum.repos.d/rhel_dvd.repo \
       -o /etc/yum.repos.d/rhel_dvd.repo
    2. Check to see if the qemu-guest-agent package is already installed.

      [root@rhel-vm1 ~]# rpm -q qemu-guest-agent
      qemu-guest-agent-2.12.0-2.el7.x86_64
    3. If the qemu-guest-agent package is not already installed, install it, and its dependencies, using the yum command.

      [root@rhel-vm1 ~]# yum -y install qemu-guest-agent
    4. Start and enable the qemu guest agent by issuing the systemctl enable --now qemu-guest-agent command.

      [root@rhel-vm1 ~]# systemctl enable --now qemu-guest-agent
  15. Close the console, but leave the virtual machine running. Return to the Compute >> Virtual Machines page and wait until the information from the agent reaches RHV-M. After some time, the columns for IP Address and FQDN will display information for the rhel-vm1 virtual machine.

Finish

On workstation, run the lab vms-install finish script to complete this exercise.

[student@workstation ~]$ lab vms-install finish

This concludes the guided exercise.

Revision: rh318-4.3-c05018e