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
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...
Use the RHV-M Administration Portal to upload the RHEL 7.6 boot ISO file.
On workstation, open Firefox and navigate to https://rhvm.lab.example.com.
Click the Administration Portal link, and log in using admin as the username, redhat as the password, and internal as the profile.
View existing disks by clicking in the menu, and then selecting .
Open the Upload Image wizard by clicking in the upper-right corner, and then selecting .
Select the RHEL 7.6 boot ISO by clicking the button.
In the File Upload window, click 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.
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.
In a previous guided exercise, you should have downloaded the ovirt-engine certificate. Click the button to verify this. If clicking the button returns a green success box, then you are ready to upload. If clicking the 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 button. Next, click the button again. It should return a green success box.
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:
Open Preferences for Firefox, and then select in the left menu.
Scroll down to the Security section and click the button.
In the Certificate Manager window, scroll down to lab.example.com, click rhvm.lab.example.com.34088 to highlight it, and then click the button.
Back on the Preferences tab for Privacy & Security, scroll up to the Cookies and Site Data section, and then click the button.
Accept the default selections and click the button. Confirm your choice by clicking the button in the new window that displays.
Click the button to start the upload process.
Verify that the ISO uploaded successfully.
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.
Navigate to in the menu bar, and then select to see a list of existing virtual machines.
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.
On the Compute >> Virtual Machines page, click the button. In the New Virtual Machine window that opens, select the following settings:
In the Cluster section, choose the cluster.
As the Operating System, select .
Click the drop-down list and choose .
Click the drop-down list and choose . Note that the Instance Type previously selected changes from to .
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.
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.
In the New Virtual Machine window, configure a disk for the new VM.
On the Instance Images line, click the button.
Specify the Size of the image as 3 GB.
Leave all other options with their default values and confirm by clicking the 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.
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.
Click the 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.
To confirm the creation of this virtual machine, click the button.
Notice that on the list of available virtual machines, the new rhel-vm1 virtual machine is displayed.
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.
Click the name of the rhel-vm1 virtual machine.
In the drop-down list, select Run Once.
Click the + icon next to Boot Options to open the Boot Options window.
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.
In the Predefined Boot Sequence list, choose the by clicking on it. With the CD-ROM highlighted, click the button once, to bring the CD-ROM drive to the top of the Boot Sequence list.
Click the button to confirm your changes and to boot the virtual machine from the Red Hat Enterprise Linux boot ISO.
Open the virtual machine console, and begin a Kickstart installation of the virtual machine.
Once the virtual machine has started, and the console button becomes available, click the button to start the Red Hat Enterprise Linux installation.
Open the console.vv file using Remote Viewer by clicking the button.
When you hover over the console window, a prompt displays to either deny or allow the Remote Viewer to inhibit shortcuts. Click the button.
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.
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.
Press Enter to start the Kickstart installation of the virtual machine.
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.
Close the console and then power off the virtual machine by clicking the drop-down menu and then selecting . Click the button to confirm that you want to power off the machine.
To test the rhel-vm1 virtual machine, power it on by clicking the button.
In some cases the button may be accessible before the virtual machines has fully shut down.
If clicking the button results in an error, simply wait a few seconds and then try again.
Once available, open the console by clicking the button.
When you hover over the console window, you are prompted to either deny or allow the Remote Viewer to inhibit shortcuts. Click the button.
After the virtual machine starts, log in as the root user with a password of redhat.
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.
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
Check to see if the qemu-guest-agent package is already installed.
[root@rhel-vm1 ~]#rpm -q qemu-guest-agentqemu-guest-agent-2.12.0-2.el7.x86_64
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
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
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.
This concludes the guided exercise.