Chapter 3 Quick Start

To get you started with Oracle Linux Virtualization Manager, the following example scenario walks you through the procedures for adding hosts, adding storage, setting up a network, creating virtual machines, and backing up and restoring the Manager.

3.1 Before You Begin

Before you begin the quick start tasks, you should be familiar with the concepts that are presented in the Oracle Linux Virtualization Manager: Architecture and Planning Guide and ensure the following prerequisites are met.

  • The procedures in this section assume that you have installed and configured Oracle Linux Virtualization Manager in your environment. For more information, refer to Chapter 2, Installation and Configuration.

  • For tasks that must be completed in the Manager, the procedures in this guide assume that you are logged in to the Administration Portal.

  • Oracle Linux Virtualization Manager creates a default data center and cluster during installation. For the purpose of this example scenario, the default data center and cluster are used. For the procedures to create new data centers or a new clusters, refer to Clusters in the Oracle Linux Virtualization Manager: Administration Guide.

  • For Section 3.2, “Adding a KVM Host to the Manager”, you must have access to a host that you can add to your virtualization environment.

  • For Section 3.3, “Adding Storage”, an Internet Small Computer System Interface (iSCSI) storage device is used for the example scenario. If you do not have access to an iSCSI device, refer to Storage in the Oracle Linux Virtualization Manager: Administration Guide for the procedures for adding other storage types to your virtualization environment.

  • For Section 3.3.2, “Uploading Images to the Data Domain”, the ovirt-engine certificate must be registered as a valid CA in the browser to connect to the ovirt-imageio-proxy service.

  • In Section 3.5, “Creating a New Virtual Machine”:

    • The procedures for creating Oracle Linux and Microsoft Windows virtual machines assume that you have added the ISO images to the data domain on the storage device used in Section 3.3, “Adding Storage”.

    • To use the console to access a virtual machine, you must install the Remote Viewer application on the client from which you want to access. This application provides users with a graphical console for connecting to virtual machines.

      1. Install the virt-viewer package.

        # yum install virt-viewer
      2. Restart your browser for the changes to effect in the Oracle Linux Virtualization Manager.

3.2 Adding a KVM Host to the Manager

To add a KVM host to the Manager:

  1. Go to Compute and then click Hosts.

  2. On the Hosts pane, click New.

    The New Host dialog box opens with the General tab selected on the sidebar.

  3. From the Host Cluster drop-down list, select Default.

    For this example scenario, you use the default data center and cluster. If you want to create a new data center or a new cluster, refer to the Data Centers or Clusters tasks in the Oracle Linux Virtualization Manager: Administration Guide.

  4. For the Name field, enter a name for the new host.

  5. For the Hostname field, enter the host name for the new host. You must use the DNS host name for the host.

  6. For the SSH Port field, the standard SSH port, port 22, is auto-filled.

  7. Under Authentication, select the authentication method to use.

    Oracle recommends that you select SSH PublicKey authentication. If you select this option, copy the key displayed in the SSH PublicKey field to the /root/.ssh/authorized_keys file on the host.

    Otherwise, enter the root user's password to use password authentication.

  8. (Optional) Configure other settings for the new host from the other tabs on the New Host sidebar.

    Note

    If you do not want to set any other configuration options now, you can always make changes later by selecting a host from the Hosts pane and clicking Edit.

  9. Click OK to add the host to the data center.

    The host is added to the list of hosts in the Manager. While the Manager is installing the host agent (VDSM) and other required packages on the host, the status of the host is shown as Installing. You can view the progress of the installation in the details pane. When the host is added to the Manager, the host status changes to Up.

3.3 Adding Storage

For this example scenario, you attach an iSCSI storage to your virtualization environment and then upload an ISO image to the data domain. If you do not have access to an iSCSI device, refer to Storage in the Oracle Linux Virtualization Manager: Administration Guide for the procedures for adding other storage types to your virtualization environment.

3.3.1 Attaching an iSCSI Data Domain

For iSCSI storage, a storage domain is created from a volume group that is composed of pre-existing LUNs.

To attach an iSCSI data domain to your virtualization environment:

  1. Go to Storage and then click Domains.

    The Storage Domains pane opens.

  2. Click New Domain.

    The New Domain dialog box opens.

  3. For the Name field, enter a name for the data domain.

  4. From the Data Center drop-down list, select the Data Center for which to attach the data domain.

    By default, the Default option is selected in the drop-down list.

    For this step, leave Default selected from the drop-down list because the default data center and cluster are used for the example scenario.

    For the procedures to create new data centers or a new clusters, refer to Data Centers or Clusters tasks in the Oracle Linux Virtualization Manager: Administration Guide.

  5. From the Domain Function drop-down list, select the domain function. By default, the Data option is selected in the drop-down list.

    For this step, leave Data as the domain function because you are creating a data domain in this example.

  6. From the Storage Type drop-down list, select iSCSI.

  7. For the Host to Use drop-down list, select the host for which to attach the data domain.

    For this example scenario, select the host added in Section 3.2, “Adding a KVM Host to the Manager”.

  8. When iSCSI is selected for the Storage Type, the Discover Targets dialog box opens and the New Domain dialog box automatically displays the known targets with unused LUNs under the Target Name column.

    If the Discover Targets dialog box is not visible in the New Domain dialog box, make sure that you have selected the Target > LUNS view on the left-side of the column.

    If the target from which you are adding storage is not listed, complete the following fields in the Discover Targets dialog box:

    1. For the Address field, enter fully qualified domain name or IP address of the iSCSI host on the storage array.

    2. For the Port field, enter the port to connect to on the host when browsing for targets. By default, this field is automatically populated with the default iSCSI Port, 3260.

    After completing these fields, click Discover.

    The Target Name column updates to list all the available targets discovered on the storage array.

  9. Under the Target Name column, select the desired target and select the black right-directional arrow to log in to the target.

    The Storage Domains pane refreshes to list only the targets for which you logged in.

  10. Click + to expand the desired target.

    The target expands to display all the unused LUNS.

  11. Click Add for each LUN ID that is to connect to the target.

  12. (Optional) Configure the advanced parameters.

    If you are using ZFS storage, you must uncheck the Discard after Delete option.

  13. Click OK.

    You can click Tasks to monitor the various processing steps that are completed to attach the iSCSI data domain to the data center.

    After the iSCSI data domain has been added to your virtualization environment, you can then upload the ISO images that are used for creating virtual machines in Section 3.5, “Creating a New Virtual Machine”.

3.3.2 Uploading Images to the Data Domain

Before using the Manager to upload images to the data domain, you must perform the following steps to ensure that the prerequisites for uploading images have been met on the Manager and KVM hosts.

3.3.2.1 Before You Begin

To ensure that the prerequisites for uploading images to the data domain have been met:

  1. On the engine host, verify that the ovirt-image-proxy service has been configured and is running.

    # systemctl status ovirt-imageio-proxy.service

    When the service is running, the output displays as follows.

    # systemctl status ovirt-imageio-proxy.service
      ovirt-imageio-proxy.service - oVirt ImageIO Proxy
       Loaded: loaded (/usr/lib/systemd/system/ovirt-imageio-proxy.service; enabled; 
       vendor preset: disabled)
       Active: active (running) since Mon 2019-03-25 13:12:29 PDT; 2 weeks 0 days ago
     Main PID: 28708 (ovirt-imageio-p)
       CGroup: /system.slice/ovirt-imageio-proxy.service
               └─28708 /usr/bin/python2 /usr/bin/ovirt-imageio-proxy
    ...

    This service is automatically configured and is started when you run the engine-setup command during the installation of the Manager.

  2. On the engine host, copy the ovirt-engine certificate as a trusted certificate to the /etc/pki/ca-trust/source/anchors/ovirt.ca.pem file, or use the correct path of the file:

    # scp /etc/pki/ovirt-engine/ca.pem \
    root@image-proxy-address:/etc/pki/ca-trust/source/anchors/ovirt.ca.pem

    You can obtain the address to enter for the image-proxy-address variable by entering the engine-config --get ImageProxyAddress command.

  3. On the KVM host, verify that the ovirt-image-proxy service has been configured and is running. For example:

    # systemctl status ovirt-imageio-daemon
      ovirt-imageio-daemon.service - oVirt ImageIO Daemon
       Loaded: loaded (/usr/lib/systemd/system/ovirt-imageio-daemon.service; disabled; 
       vendor preset: disabled)
       Active: active (running) since Wed 2019-03-27 18:38:36 EDT; 3 weeks 4 days ago
     Main PID: 366 (ovirt-imageio-d)
        Tasks: 4
       CGroup: /system.slice/ovirt-imageio-daemon.service
               └─366 /usr/bin/python /usr/bin/ovirt-imageio-daemon
    
    Mar 27 18:38:36 myserver systemd[1]: Starting oVirt ImageIO Daemon...
    Mar 27 18:38:36 myserver systemd[1]: Started oVirt ImageIO Daemon.
    
  4. On the KVM host, ensure the ovirt-image-proxy is properly linked by creating a directory for the certificate and then creating a symbolic link to the certificate.

    # mkdir /etc/pki/ovirt-engine/
    # ln -s /etc/pki/ca-trust/source/anchors/ovirt.ca.pem /etc/pki/ovirt-engine/ca.pem
  5. Verify that the certificate authority has been imported into the web browser used to access the Manager by browsing to the following URL and enabling the trust settings: https://engine_address/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA

  6. Verify that you are using a browser that meets the browser requirement to access the Administration Portal.

    For more information, refer to the Section 2.1.3, “Logging in to the Administration Portal”.

  7. Proceed to Section 3.3.2.2, “Uploading an ISO Image to the Data Domain”.

3.3.2.2 Uploading an ISO Image to the Data Domain

To upload an ISO image to data domain using the Manager:

  1. Download or copy an ISO image file that you want to upload into your environment to a location on your desktop, laptop, or a system where the Manager is accessible from a Web browser.

  2. Go to Storage and then click Disks.

    The Disks pane opens.

  3. Click Upload and then select Start from the drop-down list.

    The Upload Image dialog box opens.

  4. Click Choose File and navigate to the location where you saved the ISO image.

  5. Complete the Disk Options section of the dialog box.

  6. Ensure that the prerequisites have been met by clicking Test Connection.

    If the test returns a warning or error message, refer to Section 3.3.2.1, “Before You Begin” to review the prerequisites.

  7. Click OK to start uploading the ISO image.

    The status field on the Disks pane tracks the progress of the upload.

    After the ISO image upload is completed successfully, you can attach the image to virtual machines as CDROMs or use the image to boot virtual machines.

3.4 Creating a Logical Network

For this example scenario, you create a virtual machine network that you then assign to the KVM host added in Section 3.2, “Adding a KVM Host to the Manager”. This network is used as the virtual machine network for the virtual machines created in Section 3.5, “Creating a New Virtual Machine”.

3.4.1 Creating a Virtual Machine Network

To create a virtual machine network:

  1. Go to Network and then click Networks.

  2. On the Networks pane, click New.

    The New Logical Network dialog box opens with the General tab selected on the sidebar.

  3. From the Data Center drop-down list, select the Data Center for the network.

    By default, the Default option is selected in the drop-down list.

    For this step, leave Default selected from the drop-down list because the default data center and cluster are used in this example scenario.

    For the procedures to create new data centers or a new clusters, refer to Data Centers or Clusters tasks in the Oracle Linux Virtualization Manager: Administration Guide.

  4. For the Name field, enter a name for the new network.

  5. Leave the VM Network check box selected.

    Under the Network Parameters section, the VM Network check box is selected by default, which is left selected because a virtual machine network is being created in this example.

  6. (Optional) Configure other settings for the new logical network from the other tabs on the New Logical Network sidebar.

    The default settings are used for this example scenario.

  7. Click OK to create the network.

    The following screenshot shows the General tab of the New Logical Network dialog box completed for the new logical network that is being created in this example:

    • From the Data Center drop-down list, the Default option is selected.

    • For the Name field, vm_pub is entered.

    • Under the Network Parameters section, the VM Network check box is selected.

    Figure 3.1 New Logical Network Dialog Box: General Tab
    The General tab of the New Logical Network dialog box, as described in the preceding text.

3.4.2 Assigning the Virtual Machine Network to a KVM Host

To assign the virtual machine network to a KVM host:

  1. Go to Compute and then click Hosts.

    The Hosts pane opens.

  2. Under the Name column, click the name of the host for which to add the network.

    The following screenshot shows the Hosts pane with the name of the host highlighted in a red rectangular box to emphasize where you need to click to set up a network on a host.

    Figure 3.2 Hosts Pane
    The Hosts pane, as described in the preceding text.

    After clicking the name of the host, the General tab opens with details about the host.

  3. Click the Network Interfaces tab on the horizontal menu.

    The Network Interfaces tab opens with details about the network interfaces on the available host.

  4. Highlight the network interface that you want to use for the network being added by clicking the row for the respective interface.

  5. Click Setup Host Networks.

    The Setup Host Networks dialog box opens for the host. The physical interfaces on the host are listed under the Interfaces column and any logical networks assigned to the interface are displayed under the Assigned Logical Networks column. Unassigned logical networks are displayed under the Unassigned Logical Networks column.

    As shown in the following screenshot, the logical network created in Section 3.4, “Creating a Logical Network” named vm_pub is displayed under the Unassigned Logical Networks column. In the next step, you assign this network to the network interface named eno2, which currently has no network assigned to it.

    Figure 3.3 Setup Host Dialog Box: Unassigned Logical Networks
    The Setup Host Networks dialog box for an example host, as described in the preceding text.

  6. Select the network you want to add from the Unassigned Logical Networks column by left-clicking the network and, while holding down the mouse, drag the network over to the box to the right of the available network interface where you want to add the network.

    Alternatively, you can right-click the network and select the available interface from a drop-down list.

    For this example, the logical network named vm_pub is assigned to the available network interface named eno2. As shown in the following screenshot, after dragging the network from Unassigned Logical Networks over to this interface, the network named vm_pub appears under the Assigned Logical Networks column as assigned to the network interface named eno2.

    Figure 3.4 Setup Host Dialog Box: Assigned Logical Networks
    The Setup Host Networks dialog box after the example logical network has been assigned to a network interface, as described in the preceding text.

  7. After editing the network settings, click OK to save the settings.

  8. Click OK to add the network.

3.5 Creating a New Virtual Machine

Before creating new virtual machines for use in your virtualization environment, refer to Section 3.1, “Before You Begin” for more information about the prerequisites for this example scenario.

Note

In addition to creating virtual machines, you can import an Open Virtual Appliance (OVA) file into your environment from any host in the data center. For more information, see oVirt Virtual Machine Management Guide in oVirt Documentation.

3.5.1 Installing Remote Viewer on Client Machine

A console is a UI that allows you to view and interact with a virtual machine similar to a physical machine. The default console is Remove Viewer application that provides users with a UI for connecting to virtual machines.

To install Remote Viewer on Linux:

  1. Install the virt-viewer package.

    # yum install virt-viewer
  2. Restart your browser for the changes to effect in the Oracle Linux Virtualization Manager.

You can now connect to your virtual machines using the VNC protocol.

To install Remote Viewer on Windows:

  1. Open a browser and download either the 32-bit or 64-bit installer depending on the architecture of your system.

    • 32-bit Windows:

                                
                                  https://manager-fdqn/ovirt-engine/services/files/spice/virt-viewer-x86.msi
                                
                              
    • 64-bit Windows:

                                
                                  https://manager-fdqn/ovirt-engine/services/files/spice/virt-viewer-x64.msi
                                
                              
  2. Go to the folder where you saved the file and double-click the file.

  3. If prompted with a security warning, click Run.

  4. If prompted by User Account Control, click Yes.

Once installed, you can access Remote Viewer in the VirtViewer folder of All Programs from the Start menu.

3.5.2 Creating a New Oracle Linux Virtual Machine

For the example scenario, you create a new Oracle Linux virtual machine, install the Oracle Linux guest OS, and install the Linux guest agent for this Oracle Linux virtual machine.

To create a new Oracle Linux virtual machine:

  1. Go to Compute and then click Virtual Machines.

    The Virtual Machines pane opens with the list of virtual machines that have been created.

  2. Click New.

    The New Virtual Machine dialog box opens with the General tab selected on the sidebar.

  3. From the Cluster drop-down list, select the data center and host cluster for the new host.

    By default, the Default option is selected in the drop-down list.

    For this step, leave Default selected from the drop-down list because the default data center and cluster are used in this example scenario. For the procedures to create new data centers or a new clusters, refer to Data Centers or Clusters tasks in the Oracle Linux Virtualization Manager: Administration Guide.

  4. From the Operating System drop-down list, select the operating system for the virtual machine.

  5. For the Name field, enter a name for the new virtual machine.

  6. Under Instance Images, add storage to the virtual machine by either using an existing virtual disk or creating a new virtual desk.

    • To use an existing virtual disk, click Attach and select the virtual disk to use for the virtual machine storage. Then click OK.

    • To create a new virtual disk, click Create and update the fields for the virtual machine storage or accept the default settings. Then click OK.

    For the example scenario, all of the default settings are accepted for the new virtual disk that is being created, except the Size (GiB) field, which is set to 4. The following screenshot shows the New Virtual Disk dialog box for the Oracle Linux virtual machine being created in this example scenario.

    Figure 3.5 New Virtual Disk Dialog Box
    The New Virtual Disk dialog box completed for a new Oracle Linux virtual machine, as described in the preceding text.

  7. Connect the virtual machine to a network by adding a network interface. To do that, select the vNIC profile created in Section 3.4, “Creating a Logical Network” from the nic1 drop-down list.

    For information about customizing vNICs, refer to Customizing vNIC Profiles for Virtual Machines in the Oracle Linux Virtualization Manager: Administration Guide.

    The following screenshot shows the General tab open on the New Virtual Machine dialog box for the new Oracle Linux virtual machine being created in this example scenario. In the dialog box, the following key fields are completed:

    • From the Cluster drop-down list, the Default option is selected.

    • For the Operating System drop-down list, Oracle Linux 7.x x64 is selected.

    • For the Name field, ol7-vm1 is entered.

    • Under Instance Images, a virtual disk named ol7-vm1_Disk1 is being created, which has been set to a size of 4GB.

    • From the nic1 drop-down list, the logical network named vm_pub is selected.

    Figure 3.6 New Virtual Machine Dialog Box
    The General tab of the New Virtual Machine dialog box completed for a new virtual machine, as described in the preceding text.

  8. Click Show Advanced Options to display additional configuration options available for the new virtual machine.

  9. (Optional) Click the System tab on the sidebar to adjust the CPU and memory size for the virtual machine from the defaults.

    For this example scenario the default values are used:

    • For Memory Size field, the default value of 1024 MB is used.

    • For the Maximum memory field, the default value of 4096 MB is used.

    • For the Total Virtual CPUs field, the default value of 1 is used.

  10. Click the Boot Options tab on the sidebar to specify the boot sequence for the virtual device and then select the device from the First Device drop-down list.

    In the following screenshot, CD-ROM is selected from the First Device drop-down list. The Attach CD check box is also selected with the appropriate ISO file chosen from the drop-down list. For this example scenario, OracleLinux-R7-U6-Server-x86_64-dvd.iso is selected.

    Figure 3.7 New Virtual Machines Dialog Box: Boot Options Tab
    The Boot Options tab selected on the New Virtual Machines dialog box, as described in the preceding text.

    After you install the Oracle Linux guest OS, change the First Device from CD-ROM to Hard Disk from the drop-down list. For more information, refer to Section 3.5.2.1, “Installing the Oracle Linux Guest OS”.

  11. Click OK to create the virtual machine.

  12. Proceed to Section 3.5.2.1, “Installing the Oracle Linux Guest OS”.

3.5.2.1 Installing the Oracle Linux Guest OS

To install the Oracle Linux guest OS:

  1. Go to Compute and then click Virtual Machines.

    The Virtual Machines pane opens with the list of virtual machines that have been created.

  2. Select the virtual machine created in Section 3.5.2, “Creating a New Oracle Linux Virtual Machine” and click Run.

  3. Click Console to open a console to the virtual machine.

    If you have not installed the Remote Viewer application, refer to Section 3.1, “Before You Begin”.

  4. Install the Oracle Linux guest OS.

    Refer to the Oracle® Linux 7: Installation Guide for more information on how to install Oracle Linux.

  5. After you finish installing the Oracle Linux guest OS, return to the Virtual Machines pane, highlight the row for this virtual machine, and click Edit.

    The Edit Virtual Machines dialog box opens.

  6. Click the Boot Options tab on the sidebar of the dialog box to specify the boot sequence for the virtual device and then change CD-ROM to Hard Disk from the First Device drop-down list.

  7. Click OK to save the changes to the virtual machine configuration.

    The Oracle Linux virtual machine now boots from the virtual disk where the operating system is installed.

  8. (Optional) If you use a proxy server for Internet access, configure Yum with the proxy server settings. For more information, see Configuring Packet-filtering Firewalls in the Oracle® Linux 7: Security Guide.

  9. (Optional) If you are using yum to update the host, make sure the host is using the modular yum repository configuration. For more information, see Getting Started with Oracle Linux Yum Server.

  10. Proceed to Section 3.5.2.2, “Installing the Linux Guest Agent”.

3.5.2.2 Installing the Linux Guest Agent

To install the Linux guest agent:

  1. Open a console session for the Oracle Linux guest and log in to the terminal.

  2. Install the latest guest agent package.

    For Oracle Linux 8 guests:

    # dnf install dnf-utils -y
    # yum-config-manager --enable ol8_appstream
    # dnf install qemu-guest-agent

    For Oracle Linux 7 guests:

    # yum install yum-utils -y
    # yum-config-manager --enable ol7_latest
    # yum install qemu-guest-agent

    For Oracle Linux 6 guests:

    # yum install yum-utils -y
    # yum-config-manager --enable ol6_latest
    # yum install qemu-guest-agent

    For Oracle Linux 5 guests:

    # yum install yum-utils -y
    # yum-config-manager --enable ovirt42
    # yum install http://yum.oracle.com/repo/OracleLinux/OL7/ovirt42/x86_64/getPackage/ \
      ovirt-guest-agent-1.0.13-2.el5.noarch.rpm

  3. Start the guest agent service for the Oracle Linux guest.

    For Oracle Linux 8 and Oracle Linux 7 guests:

    # systemctl start qemu-guest-agent.service

    For Oracle Linux 6 and Oracle Linux 5 guests:

    # service ovirt-guest-agent enable
    # service ovirt-guest-agent start

  4. (Optional) Enable an automatic restart of the guest agent service when the virtual machine is rebooted.

    For Oracle Linux 8 and Oracle Linux 7 guests:

    # systemctl enable qemu-guest-agent.service

    For Oracle Linux 6 and Oracle Linux 5 guests:

    # chkconfig qemu-guest-agent on

3.5.3 Creating a New Microsoft Windows Virtual Machine

For the example scenario, you create a new Microsoft Windows virtual machine, install the Microsoft Windows guest OS, and install the Microsoft Windows guest agent and VirtIO drivers for this virtual machine.

3.5.3.1 Before You Begin

Before creating Microsoft Windows virtual machines, ensure the following prerequisites are met.

  1. Install the ovirt-guest-tools-iso package on the Manager:

    # yum install ovirt-guest-tools-iso
  2. Verify the package installation:

    # rpm -ql ovirt-guest-tools-iso

3.5.3.2 Creating a New Microsoft Windows Virtual Machine

To create a new Microsoft Windows virtual machine:

  1. Go to Compute and then click Virtual Machines.

    The Virtual Machines pane opens with the list of virtual machines that have been created.

  2. Click New.

    The New Virtual Machine dialog box opens with the General tab selected on the sidebar.

  3. From the Cluster drop-down list, select the data center and host cluster for the new host.

    By default, the Default option is selected in the drop-down list.

    For this step, leave Default selected from the drop-down list because the default data center and cluster are used in this example scenario. For the procedures to create new data centers or a new clusters, refer to Data Centers or Clusters tasks in the Oracle Linux Virtualization Manager: Administration Guide.

  4. From the Operating System drop-down list, select the appropriate Microsoft Windows operating system for the virtual machine.

  5. For the Name field, enter a name for the new virtual machine.

  6. Under Instance Images, add storage to the virtual machine by either using an existing virtual disk or creating a new virtual desk.

    • To use an existing virtual disk, click Attach and select the virtual disk to use for the virtual machine storage. Then click OK.

    • To create a new virtual disk, click Create and update the fields for the virtual machine storage or accept the default settings. Then click OK.

    The following screenshot shows the New Virtual Disk dialog box for the Oracle Linux virtual machine being created in this example scenario. In the dialog box, the following key fields are completed:

    • For the Size (GiB) field, a value of 12 is entered.

    • From the Interface drop-down list, IDE is selected.

    • From the Allocation Policy drop-down list, Thin Provision is selected.

    Figure 3.8 New Virtual Disk Dialog Box
    The New Virtual Disk dialog box completed for a new Microsoft Windows virtual machine, as described in the preceding text.

  7. Connect the virtual machine to a network by selecting the vNIC profile created in Section 3.4, “Creating a Logical Network” from the nic1 drop-down list.

    For information about customizing vNICs, refer to Customizing vNIC Profiles for Virtual Machines in the Oracle Linux Virtualization Manager: Administration Guide.

    The following screenshot shows the General tab on New Virtual Machine dialog box for the new Microsoft Windows virtual machine that is being created in this example scenario. In the dialog box, the following key fields are completed:

    • From the Cluster drop-down list, the Default option is selected.

    • For the Operating System drop-down list, Windows 10 x64 is selected.

    • For the Name field, windows-10-vm is entered.

    • Under Instance Images, a virtual disk named windows-10-vm_Disk1 is being created, which has been set to a size of 12GB.

    • From the nic1 drop-down list, the logical network named vm_pub is selected.

    Figure 3.9 New Virtual Machine Dialog Box
    The General tab of the New Virtual Machine dialog box completed for a new Microsoft Windows virtual machine, as described in the preceding text.

  8. Click the System tab on the sidebar to adjust the memory size for the virtual machine from the defaults.

    In this example, change the Memory Size field to 4096 MB and the Total Virtual CPUs field to 4.

    The following screenshot shows the System tab on New Virtual Machine dialog box for the new Microsoft Windows virtual machine that is being created in this example scenario. In the dialog box, the following key fields are completed:

    • The Memory Size field is changed to 4096 MB.

    • The Maximum memory field automatically updates to 16384 MB when the Memory Size field is changed to 4096 MB.

    • The Total Virtual CPUs field is changed to 4.

    Figure 3.10 New Virtual Machine Dialog Box: System Tab
    The System tab of the New Virtual Machine dialog box completed for a new Microsoft Windows virtual machine, as described in the preceding text.

  9. Click the Boot Options tab on the sidebar of the dialog box to specify the boot sequence for the virtual device.

    1. From the First Device drop-down list select CD-ROM.

    2. Select the Attach CD checkbox and choose the appropriate ISO image from the drop-down list.

      After you install the Microsoft Windows guest OS, change the First Device drop-down list from CD-ROM to Hard Disk from the drop-down list. For more information, refer to Section 3.5.3.4, “Installing the Microsoft Windows Guest Agent and VirtIO Drivers”.

    In the following screenshot, CD-ROM is selected from the First Device drop-down list. The Attach CD check box is also selected with the en_windows_10_enterprise_1511_x64_dvd.iso ISO file chosen from the drop-down list.

    Figure 3.11 New Virtual Machines Dialog Box: Boot Options Tab
    The Boot Options tab selected on the New Virtual Machines dialog box, as described in the preceding text.

  10. Click OK to create the virtual machine.

  11. Proceed to Section 3.5.2.1, “Installing the Oracle Linux Guest OS”.

3.5.3.3 Installing the Microsoft Windows Guest OS

To install the Microsoft Windows guest OS:

  1. Go to Compute and then click Virtual Machines.

    The Virtual Machines pane opens with the list of virtual machines that have been created.

  2. Select the Microsoft Windows virtual machine created in Section 3.5.3, “Creating a New Microsoft Windows Virtual Machine” and click Run.

  3. Click Console to open a console to the virtual machine.

    If you have not installed the Remote Viewer application, refer to Section 3.1, “Before You Begin”.

  4. Install the Microsoft Windows guest OS.

    Refer to the applicable Microsoft Windows documentation for instructions on how to install the operating system.

  5. Proceed to Section 3.5.3.4, “Installing the Microsoft Windows Guest Agent and VirtIO Drivers”.

3.5.3.4 Installing the Microsoft Windows Guest Agent and VirtIO Drivers

To install the Microsoft Windows guest agent and VirtIO drivers:

  1. After you finish installing the Microsoft Windows guest OS, return to the Virtual Machines pane, highlight the row for this virtual machine, and click Edit.

    The Edit Virtual Machines dialog box opens.

  2. Click the Boot Options tab on the sidebar of the dialog box to specify the boot sequence for the virtual device.

    1. From the First Device drop-down list, change CD-ROM to Hard Disk.

    2. From the Second Device drop-down list, select CD-ROM.

    3. Select the Attach CD checkbox and choose ovirt-tools-setup.iso from the drop-down list.

  3. Click OK to save the changes to the virtual machine configuration.

  4. Click OK when the Pending Virtual Machine changes dialog box appears.

  5. From the Virtual Machines pane, reboot the virtual machine.

  6. Click Console to open a console to the virtual machine and navigate to the CDROM.

  7. Double-click ovirt-guest-tools-setup to install the Microsoft Windows guest agent.

  8. Double-click the virtio folder and then click Setup to start the Oracle VirtIO Drivers for Microsoft Windows installer.

    The installer window is displayed.

  9. Click Install to start the Oracle VirtIO Drivers for Microsoft Windows installer.

    The installer copies the Oracle VirtIO Drivers for Microsoft Windows installer files and then installs the drivers on the Microsoft Microsoft Windows guest OS.

  10. Click Yes, I want to restart my computer now and click Finish.

    The virtual machine is restarted.

  11. Stop the virtual machine.

  12. Go to Compute and then click Virtual Machines.

    The Virtual Machines pane opens with the list of virtual machines that have been created.

  13. Select the Microsoft Windows virtual machine created in Section 3.5.3, “Creating a New Microsoft Windows Virtual Machine” and click Edit.

  14. Edit the virtual disk. From the Interface drop-down list, change IDE to VirtIO-SCSI .

  15. Click the Boot Options tab on the sidebar.

    1. Do not make any changes to the First Device drop-down list. The Hard Disk option is selected from a previous step.

    2. From the Second Device drop-down list, select None.

    3. Deselect the Attach CD checkbox.

  16. Click OK to save the changes to the virtual machine configuration.

  17. Run the Microsoft Windows virtual machine.

For more information, see the Oracle® Linux: KVM User's Guide

3.6 Creating a Template

For this example scenario, you seal the Oracle Linux virtual machine created in Section 3.5, “Creating a New Virtual Machine” and then you create an Oracle Linux template based on that virtual machine. You then use that template as the basis for a Cloud-Init enabled template to automate the initial setup of a virtual machine.

A template is a copy of a virtual machine that you can use to simplify the subsequent, repeated creation of similar virtual machines. Templates capture the configuration of software, the configuration of hardware, and the software installed on the virtual machine on which the template is based, which is known as the source virtual machine.

Virtual machines that are created based on a template use the same NIC type and driver as the original virtual machine but are assigned separate, unique MAC addresses.

3.6.1 Sealing an Oracle Linux Virtual Machine for Use as a Template

Sealing is the process of removing all system-specific details from a virtual machine before creating a template based on that virtual machine. Sealing is necessary to prevent the same details from appearing on multiple virtual machines that are created based on the same template. It is also necessary to ensure the functionality of other features, such as predictable vNIC order.

To seal an Oracle Linux virtual machine for use as a template:

  1. Log in to the Oracle Linux virtual machine as the root user.

  2. Flag the system for reconfiguration.

     # touch /.unconfigured
  3. Remove the SSH host keys.

    # rm -rf /etc/ssh/ssh_host_*
  4. Set the host name value of the HOSTNAME=localhost.localdomain in the /etc/sysconfig/network file for Oracle Linux 6 or the /etc/hostname file for Oracle Linux 7.

  5. Remove /etc/udev/rules.d/70-*.

                        
                          rm -rf /etc/udev/rules.d/70-*
                        
                      
  6. Remove the HWADDR and UUID lines in the /etc/sysconfig/network-scripts/ifcfg-eth* file.

  7. (Optional) Delete all the logs from /var/log and build logs from /root.

  8. Cleanup the command history.

    # history -c
  9. Shutdown the virtual machine.

    # poweroff

    The Oracle Linux virtual machine is now sealed and ready to be made into a template.

3.6.2 Creating an Oracle Linux Template

When you create a template based on a virtual machine, a read-only copy of the virtual machine's disk is created. This read-only disk becomes the base disk image of the new template, and of any virtual machines that are created based on the template. As such, the template cannot be deleted while any virtual machines based on that template exist in the virtualization environment.

To create an Oracle Linux template:

  1. Go to Compute, and then click Virtual Machines.

    The Virtual Machines pane opens with the list of virtual machines that have been created.

  2. Click More Actions to expand the drop-down list and select Make Template from the drop-down list.

    The following screenshot shows the More Actions drop-down list expanded to display the Make Template option. The Make Template option is highlighted with a red rectangular box for emphasis.

    Figure 3.12 Make Template Option
    The More Actions drop-down list expanded to display the Make Template option, as described in the preceding text.

  3. For the Name field, enter a name for the new virtual machine template.

  4. In the Disc Allocation: section under the Alias column, rename the disk alias to be the same as the template name entered for the Name field.

  5. Click the Seal Template (Linux only) checkbox.

    The following screenshot shows the New Template dialog box completed for the new template named ol7-vm-template, which is being created in this example scenario. In the dialog box, the disk alias has been renamed to ol7-vm-template and the Seal Template (Linux only) checkbox is selected.

    Figure 3.13 New Template Dialog Box
    The New Template dialog box completed for a new template, as described in the preceding text.

  6. Click the OK button to create the template.

    The virtual machine displays a status of image Locked while the template is being created. The time it takes for the template to be created depends on the size of the virtual disk and the capabilities of your storage hardware. When the template creation process completes, the template is added to the list of templates displayed on the Templates pane.

    You can now create new Oracle Linux virtual machines that are based on this template.

3.6.3 Creating a Cloud-Init Enabled Template

For Oracle Linux 7 and later virtual machines, you can use the Cloud-Init tool to automate the initial setup of virtual machines. Common tasks, such as configuring host names, network interfaces, and authorized keys, can be automated by using this tool. When provisioning virtual machines that have been deployed based on a template, the Cloud-Init tool can be used to prevent conflicts on the network.

3.6.3.1 Before You Begin

Before you create Cloud-Init enabled templates, ensure the following prerequisites are met:

  • To use Cloud-Init, the cloud-init package must first be installed on the virtual machine. Once installed, the Cloud-Init service starts during the boot process and searches for instructions on what to configure. You can use options in the Run Once window to provide these instructions on a one-time only basis, or use the options in the New Virtual Machine, Edit Virtual Machine, and Edit Template dialog boxes to provide these instructions every time the virtual machine starts.

  • You must have seal an Oracle Linux for use as a template. For more information, refer to Section 3.6.1, “Sealing an Oracle Linux Virtual Machine for Use as a Template”.

  • You must create a template. For more information, refer to Section 3.6.2, “Creating an Oracle Linux Template”.

  1. Log in to a Oracle Linux virtual machine.

  2. List the cloud-init package.

    # yum list cloud-init
  3. Install the cloud-init package.

    # yum install cloud-init
  4. Run the following command to enable the cloud-init service.

    # systemctl enable cloud-init
  5. Run the following command to start the cloud-init service.

    # systemctl start cloud-init

3.6.3.2 Using Cloud-Init to Automate the Initial Setup of a Virtual Machine

To use Cloud-Init to automate the initial setup of a virtual machine:

  1. Go to Compute and then click Templates.

    The Templates pane opens with the list of templates that have been created.

  2. Select a template and click the Edit button.

  3. Click Show Advanced Options.

  4. Click the Initial Run tab and select the Use Cloud-Init/Sysprep check box.

  5. Enter a host name in the VM Hostname text field.

  6. Select the Configure Time Zone check box and select a time zone from the Time Zone drop-down list.

  7. Expand the Authentication section.

    • Select the Use already configured password check box to use the existing credentials, or clear that check box and enter a root password in the Password and Verify Password text fields to specify a new root password.

    • Enter any SSH keys to be added to the authorized hosts file on the virtual machine in the SSH Authorized Keys text area.

    • Select the Regenerate SSH Keys check box to regenerate SSH keys for the virtual machine.

  8. Expand the Networks section.

    • Enter any DNS servers in the DNS Servers text field.

    • Enter any DNS search domains in the DNS Search Domains text field.

    • Select the In-guest Network Interface check box and use the + Add new and - Remove selected buttons to add or remove network interfaces to or from the virtual machine.

      Important

      You must specify the correct network interface name and number (for example, eth0, eno3, enp0s); otherwise, the virtual machine’s interface connection will be up but will not have the Cloud-Init network configuration.

  9. Expand the Custom Script section and enter any custom scripts in the Custom Script text area.

3.7 Creating a Virtual Machine from a Template

For this example scenario, you create an Oracle Linux virtual machine from the template created in Section 3.6, “Creating a Template”.

3.7.1 Creating an Oracle Linux Virtual Machine from a Template

To create an Oracle Linux virtual machine from a template:

  1. Go to Compute and then click Templates.

    The Templates pane opens with the list of templates that have been created.

  2. On the far right corner of the Templates pane, click New VM.

    The New Virtual Machine dialog box opens for the template.

  3. On the Cluster drop-down list, select the data center and host cluster for the new host.

    By default, the Default option is selected in the drop-down list.

    For this step, leave Default selected from the drop-down list because the default data center and cluster are used in this example scenario.

    For the procedures to create new data centers or a new clusters, refer to Data Centers or Clusters tasks in the Oracle Linux Virtualization Manager: Administration Guide.

  4. For the Template drop-down list, select the desired template from the drop-down list.

    For this example scenario, select the template created in Section 3.6.2, “Creating an Oracle Linux Template”.

  5. For the Operating System drop-down list, select the operating system from the drop-down list.

  6. For the Name field, enter a name for the virtual machine.

    The following screenshot shows the New Virtual Machine dialog box for the new Oracle Linux virtual machine that is being created based on the template that was created in Section 3.6.2, “Creating an Oracle Linux Template”. In the dialog box, the following key fields are completed:

    • From the Cluster drop-down list, the Default option is selected.

    • From the Template drop-down list, the template named ol7-vm-template is selected.

    • For the Operating System drop-down list, Oracle Linux 7.x x64 is selected.

    • For the Name field, ol7-vm2 is entered.

    • From the nic1 drop-down list, the logical network named vm_pub is selected.

    Figure 3.14 New Virtual Machine Dialog Box for a Template - General Tab
    The General tab of the New Virtual Machine dialog box completed for a new virtual machine that is being created from a template, as described in the preceding text.

  7. Click the Boot Options tab and ensure that the First Device is set to Hard Disk.

    The following screenshot shows the New Virtual Machines dialog box with the Boot Options tab options selected for the new Oracle Linux virtual machine named ol7-vm4 that is being created from the template named ol7-vm-template in this example. The First Device is set to Hard Disk.

    Figure 3.15 New Virtual Machine Dialog Box for a Template - Boot Options Tab
    New Virtual Machine dialog box for a template, as described in the preceding text.

  8. Click OK to create the virtual machine from the template.

    The new virtual machine appears on the Virtual Machines pane.

  9. Highlight the virtual machine that you created from the template and then click Run to boot the virtual machine.

    The red down arrow icon to the left of the virtual machine turns green and the Status column displays Up when the virtual machine is up and running on the network.

3.8 Backing Up and Restoring the Manager

For this example scenario, you backup and restore the Oracle Linux Virtualization Manager by using the engine-backup command utility.

3.8.1 Backing Up the Manager

To backup the Manager:

  1. Log in to the host that is running the Manager.

  2. Create a full backup of the Manager.

    # engine-backup --mode=backup --scope=all --file=path --log=path

    The following example shows how to use the engine-backup command to create a full backup of the Manager. A backup file and log file for the Manager backup is created in the path specified.

    # engine-backup --mode=backup --scope=all --file=backup/file/ovirt-engine-backup --log=backup/log/ovirt-engine-backup.log
    Backing up:
    Notifying engine
    - Files
    - Engine database 'engine'
    - DWH database 'ovirt_engine_history'
    Packing into file 'backup/file/ovirt-engine-backup'
    Notifying engine
    Done.
    
  3. (Optional) Set up a cron job to take regular backups.

    By default, the Manager does not take automatic backups. Oracle recommends that you take you regular backups of the Manager.

    The following example shows a sample cron job defined in a crontab-format file.

    today=`date +'%Y%m%d-%H%M'`
    engine-backup --mode=backup --scope=all --file=/backup/file/ovirt-engine-backup-${today} 
    --log=/backup/log/ovirt-engine-backup-${today}.log

3.8.2 Restoring a Full Backup of the Manager

To restore a full backup of the Manager:

  1. Log in to the host that is running the Manager.

  2. Clean up the objects associated with the Manager.

    # engine-cleanup

    This engine-cleanup command removes the configuration files and cleans the database associated with the Manager.

    The following example shows output from the engine-cleanup command.

    # engine-cleanup
    [ INFO  ] Stage: Initializing
    [ INFO  ] Stage: Environment setup
              Configuration files: ...
              Log file: ...
              Version: otopi-1.7.8 (otopi-1.7.8-1.el7)
    [ INFO  ] Stage: Environment packages setup
    [ INFO  ] Stage: Programs detection
    [ INFO  ] Stage: Environment customization
              Do you want to remove all components? (Yes, No) [Yes]: Yes
              The following files were changed since setup:
              /etc/ovirt-engine/engine.conf.d/11-setup-sso.conf
              Remove them anyway? (Yes, No) [Yes]: Yes
    
              --== PRODUCT OPTIONS ==--
    
    [ INFO  ] Stage: Setup validation
              During execution engine service will be stopped (OK, Cancel) [OK]: OK
              All the installed ovirt components are about to be removed ...(OK, Cancel) 
              [Cancel]: OK
    [ INFO  ] Stage: Transaction setup
    [ INFO  ] Stopping engine service
    [ INFO  ] Stopping ovirt-fence-kdump-listener service
    [ INFO  ] Stopping dwh service
    [ INFO  ] Stopping Image I/O Proxy service
    [ INFO  ] Stopping vmconsole-proxy service
    [ INFO  ] Stopping websocket-proxy service
    [ INFO  ] Stage: Misc configuration
    [ INFO  ] Stage: Package installation
    [ INFO  ] Stage: Misc configuration
    [ INFO  ] Backing up PKI configuration and keys
    ...
    [ INFO  ] Clearing Engine database engine
    ...
    [ INFO  ] Clearing DWH database ovirt_engine_history
    [ INFO  ] Removing files
    [ INFO  ] Reverting changes to files
    ...
    [ INFO  ] Stage: Transaction commit
    [ INFO  ] Stage: Closing up
    
              --== SUMMARY ==--
    
              Engine setup successfully cleaned up
              A backup of PKI configuration and keys is available at ...
              ovirt-engine has been removed
              A backup of the Engine database is available at ...
              A backup of the DWH database is available at ...
    
              --== END OF SUMMARY ==--
    
    [ INFO  ] Stage: Clean up
              Log file is located at ...
    [ INFO  ] Generating answer file ...
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
    [ INFO  ] Execution of cleanup completed successfully
    
  3. Restore a full backup of the Manager.

    The following form of the engine-backup command is used to a restore a full backup of the Manager.

    engine-backup --mode=restore --scope=all --file=path --log=path --restore-permissions

    The following example shows how to use the engine-backup command to restore a full backup of the Manager.

    # engine-backup --mode=restore --scope=all --file=backup/file/ovirt-engine-backup --log=backup/log/ovirt-engine-backup.log --restore-permissions
    Preparing to restore:
    - Unpacking file 'backup/file/ovirt-engine-backup'
    Restoring:
    - Files
    - Engine database 'engine'
      - Cleaning up temporary tables in engine database 'engine'
      - Updating DbJustRestored VdcOption in engine database
      - Resetting DwhCurrentlyRunning in dwh_history_timekeeping in engine database
      - Resetting HA VM status
    ------------------------------------------------------------------------------
    Please note:
    
    The engine database was backed up at 2019-03-25 12:48:02.000000000 -0700 .
    
    Objects that were added, removed or changed after this date, such as virtual
    machines, disks, etc., are missing in the engine, and will probably require
    recovery or recreation.
    ------------------------------------------------------------------------------
    - DWH database 'ovirt_engine_history'
    You should now run engine-setup.
    Done.
  4. Run the engine-setup command to complete the setup of the restored Manager.

    # engine-setup

    This command reconfigures the firewall and ensures that the Manager service is correctly configured.

  5. Log in to the Manager and verify that the Manager has been restored to the backup.