Creating a New Virtual Machine

Before creating new virtual machines for use in your virtualization environment, refer to 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.

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 5 New Virtual Disk Dialog Box


  7. Connect the virtual machine to a network by adding a network interface. To do that, select the vNIC profile created in 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 6 New Virtual Machine Dialog Box


  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 7 New Virtual Machines Dialog Box: Boot Options Tab


    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 Installing the Oracle Linux Guest OS.

  11. Click OK to create the virtual machine.

  12. Proceed to Installing the Oracle Linux Guest OS.

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 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 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 Use of a Proxy Server in the Oracle® Linux 7: Administrator's 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 Installing the Linux Guest Agent.

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:

    # yum install qemu-guest-agent

    For Oracle Linux 7 guests:

    # yum install http://yum.oracle.com/repo/OracleLinux/OL7/ovirt43/x86_64/getPackage/ovirt-guest-agent-common-1.0.16-1.el7.noarch.rpm

    For Oracle Linux 6 guests:

    # yum install http://yum.oracle.com/repo/OracleLinux/OL7/ovirt43/x86_64/getPackage/ovirt-guest-agent-1.0.13-2.el6.noarch.rpm

    For Oracle Linux 5 guests:

    # yum install http://yum.oracle.com/repo/OracleLinux/OL7/ovirt43/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 guests:

    # systemctl start qemu-guest-agent.service

    For Oracle Linux 7 guests:

    # systemctl start ovirt-guest-agent.service

    For Oracle Linux 6 and Oracle Linux 5 guests:

    # 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 guests:

    # systemctl enable qemu-guest-agent.service

    For Oracle Linux 7 guests:

    # systemctl enable ovirt-guest-agent.service

    For Oracle Linux 6 and Oracle Linux 5 guests:

    # chkconfig ovirt-guest-agent on

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.

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

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 8 New Virtual Disk Dialog Box


  7. Connect the virtual machine to a network by selecting the vNIC profile created in 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 9 New Virtual Machine Dialog Box


  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 10 New Virtual Machine Dialog Box: System Tab


  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 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 11 New Virtual Machines Dialog Box: Boot Options Tab


  10. Click OK to create the virtual machine.

  11. Proceed to Installing the Oracle Linux Guest OS.

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 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 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 Installing the Microsoft Windows Guest Agent and VirtIO Drivers.

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