Deploying an IaaS Environment with Oracle VM

Hands-On Labs of the System Admin and Developer Community of OTN

by Christophe Pauliat and Olivier Canonge

This hands-on lab takes you through the planning and deployment of an infrastructure as a service (IaaS) environment using Oracle VM as the foundation.


Published February 2013

Prerequisites
Summary of Exercises
Notes on Paravirtualized VMs, Hardware Virtualized VMs, and Templates
Exercise 1: Install Oracle VM Server
Exercise 2: Install Oracle VM Manager
Exercise 3: Configure Oracle VM Manager
Conclusion
See Also
About the Authors
Acknowledgments

Want technical articles like this one delivered to your inbox?  Subscribe to the Systems Community Newsletter—only technical content for sysadmins and developers.

This lab is Part 1 of a three-part series that covers a range of topics from storage capacity planning, LUN creation, and network bandwidth planning, to best practices for designing and streamlining an Oracle VM environment that's easy to manage.

This lab uses Oracle VM VirtualBox as your virtual platform. You will install a basic Oracle VM Server for x86 Release 3.1.1 environment (one Oracle VM Manager and one Oracle VM Server) as an image in Oracle VM VirtualBox and then perform some basic operations, such as creating an Oracle VM virtual machine from a template that contains Oracle Linux 5.

We use Oracle VirtualBox as a virtual platform because it lets you host Oracle VM Manager and Oracle VM Server on any x86 machine (a laptop, a desktop, or a server) with any OS (Linux, Oracle Solaris, Microsoft Windows, or Mac OS) without interfering with the existing OS and data on the machine.

Part 2 of this series is "How to Virtualize and Deploy Oracle Applications in Minutes with Oracle VM" and Part 3 is "Deploying a Cloud Infrastructure with Oracle VM 3.x and the Sun ZFS Storage Appliance."

Prerequisites

In this lab, we will use Oracle VM VirtualBox to create two virtual machines that will later be used by Oracle VM Server for x86 and Oracle VM Manager, so that we can install all software components on a single physical machine.

Oracle VM VirtualBox is a free and widely used desktop virtualization tool. It is installed on an x86 operating system (OS) and is available on all the major x86 operating systems, for example, Windows XP, Windows 7, many Linux distributions, Apple Mac OS, Oracle Solaris 10, and Oracle Solaris 11. Therefore, the native operating system on the laptop, desktop, server machine used for this lab can be any of these operating systems.

Note: All operations for this lab were tested only on Oracle Linux 6 update 3 (64 bit) with Unbreakable Enterprise Kernel.

On Linux, Oracle Solaris, and Mac OS machines, you will use ssh and scp to connect and to transfer files. On Windows machines, you will need additional tools such as PuTTY and WinSCP.

In this lab, two layers of virtualization are used to limit the number of physical machines to one:

  • Oracle VM VirtualBox
  • Oracle VM Server for x86

In addition, two kinds of templates are used, so pay close attention to the instructions to ensure you use the right templates:

  • Oracle VM VirtualBox templates
  • Oracle VM Templates

Ensure You Have the Minimal Required Configuration

The minimal configuration needed for your laptop, desktop, or server is as follows:

  • 8 GB of memory
  • Intel or AMD x86 quad-thread processor (quad-core or dual-core dual-thread)
  • 15 GB of disk space to store the files needed to start the lab
  • 15 GB of disk space to store the files that will be created during the lab

Download the Required Products

Download the following products:

Install the Primary OS and Oracle VM VirtualBox

  1. Install on your system a 64-bit OS (mandatory for managing more than 4 GB of RAM) that is supported by Oracle VM VirtualBox.
  2. Install Oracle VM VirtualBox.
  3. Install the Oracle VM VirtualBox extension pack:

    1. Run Oracle VM VirtualBox.
    2. Then select File-> Preferences-> Extensions, and click icon.
  4. In Oracle VM VirtualBox, configure a host-only network:

    1. Select File-> Preferences-> Network.
    2. Specify the following:

      Network address: 192.168.56.0
      Physical machine's IP address: 192.168.56.1
      Netmask: 255.255.255.0

    3. Disable the DHCP server since we will not use it.
    4. Open a terminal window on your physical machine.
  5. Install the JRE on your physical machine. For example, on a Linux machine, run the following command:

    $ su -
    # rpm -ivh jre-7u4-linux-x64.rpm
    
  6. Restart your Web browser.

Summary of the Exercises

In this lab, you will execute the following steps:

  • Exercise 1: Install Oracle VM Server 3.1.1 in an Oracle VM VirtualBox virtual machine from an Oracle VM VirtualBox template (.ova file).
  • Exercise 2: Install Oracle VM Manager 3.1.1 in an Oracle VM VirtualBox virtual machine from an Oracle VM VirtualBox template.
  • Exercise 3: Configure Oracle VM Manager:

    • Create a Server Pool and Storage Repository
    • Set Up an HTTP Web Server
    • Import the Oracle Linux 5 Update 7 PVM Template
    • Create a VM Based on the Imported Template
    • Start the Guest-VM Virtual Machine

Figure 1 shows an example of all the installed components (Oracle VM VirtualBox virtual machines and Oracle VM virtual machines) with their names and configuration (memory, IP address, and so on).

Figure 1

Figure 1

At the beginning of this lab, only the physical machine is installed with Oracle Linux 6 update 3, Oracle VM VirtualBox, and the JRE (the blue rectangle in Figure 1).

You will create the Oracle VM VirtualBox and Oracle VM virtual machines during the lab exercises.

At the end of this lab, you will have a complete running testing platform for Oracle VM. 

Notes on Paravirtualized VMs, Hardware Virtualized VMs, and Templates

There are three types of virtual machines:

  • Hardware virtualized VM (HVM). An unmodified guest operating system executes in complete isolation. Instructions are trapped and emulated at the hardware level (Intel VT-x/VT-i and AMD-V), allowing excellent performance thanks to limited overhead for guest modifications.
  • Paravirtualized VM (PVM). A software interface similar but not identical to the underlying hardware is presented to the guest operating system. Paravirtualization provides hooks for guest instructions so that complicated tasks can be performed by the host instead of the virtual machine, where performance is worse. Paravirtualization requires that the guest kernel is ported to be made aware of the virtual environment.
  • Hardware virtualized VM with paravirtualized drivers (PVHVM). Similar to HVM but with additional paravirtualized drivers to offload more processes to the host and increase VM performance. This type is typically used to run Microsoft Windows guests with a limited performance penalty.

When installing Oracle VM servers in Oracle VM VirtualBox, only PVMs can be created in Oracle VM servers.

Notes on templates:

  • An Oracle VM Template is a prebuilt "VM image" that can be imported into Oracle VM and be used to easily and quickly create VMs identical to the template.
  • A template contains an OS image and generally contains databases and applications already installed and configured.
  • You can download many Oracle VM Templates built by Oracle at https://edelivery.oracle.com/oraclevm (requires login).
  • Templates provided by Oracle have an Oracle OS (Oracle Linux or Oracle Solaris).
  • You can also create your own templates using the OS and applications you want.
  • Here, because of time constraints, we will use a very simple template, containing only the Oracle Linux 5 update 7 OS.

Exercise 1: Install Oracle VM Server

In this exercise, you create a VM by importing the Oracle VM VirtualBox template for Oracle VM Server, and then you start and configure the VM for Oracle VM Server.

Create a VM by Importing the Oracle VM VirtualBox Template for Oracle VM Server

During this step, you create the first Oracle VM VirtualBox virtual machine by importing the pre-existing Oracle VM VirtualBox template OracleVMServer3.1.1build365.ova.

This VM will be our Oracle VM Server. The normal way of installing Oracle VM Server is to boot from an ISO file or CD-ROM, but here we use the template to save time.

  1. In Oracle VM VirtualBox, select File-> Import Appliance and then select the file OracleVMServer3.1.1build365.ova.
  2. In the Appliance Import Settings screen, do the following:

    1. Double-click OracleVMServer3.1.1 and change the name to HOL9558_ovm-srv.
    2. Change CPU to 3 (needed for the Part 2 lab, How to Virtualize and Deploy Oracle Applications in Minutes with Oracle VM).
    3. If you have 16 GB of RAM, change RAM to 5120 MB (also needed for the Part 2 lab).
    4. If you have 8 GB of RAM, change RAM to 2048 MB.
    5. Click Import.
  3. Accept the license agreement.
  4. Wait for the import to complete (about two minutes).
  5. Modify the storage settings:

    1. Select the VM HOL9558_vm-srv and click Settings.
    2. Go to Storage and remove the disk2 entry under SATA Controller by clicking icon, as shown in Figure 2.

      Figure 2

      Figure 2

    3. Add a new 100 GB hard drive (we will use this drive later as a repository) by selecting SATA Controller and clicking icon. Select VDI as the file type, choose Dynamically allocated, specify the name repo, and specify a size of 100 GB.
  6. Modify the network settings, as shown in Figure 3:

    1. Go to Network, and click the Adapter 1 tab.
    2. From the Attached to list, select Host-only Adapter.
    3. Expand the Advanced section.
    4. For Promiscuous Mode, select Allow All.

      Make sure you enable the promiscuous mode on the network interface. If you do not, your Oracle VM virtual machine will not be accessible from your host machine.

      Figure 3

      Figure 3

    5. Repeat these actions for the Adapter 2 tab.
    6. Click OK to exit the settings.

Start and Configure the VM for Oracle VM Server

  1. In the Oracle VM VirtualBox admin console, select the HOL9558_ovm-srv VM and click Start.
  2. Look at the VM console and wait for the message Enter static IP address, which is shown in Figure 4.

    Figure 4

    Figure 4

  3. Enter the following information:

    1. For the static IP address, enter 192.168.56.2.
    2. For the netmask, enter 255.255.255.0 (the default).
    3. For the gateway, enter 192.168.56.1.
    4. For the DNS, enter 192.168.56.1.
    5. For the host name, enter ovm-srv.oow.com.

      Notes:

      • We don't have a DNS server and DNS domain in place (and we don't need to), but when using the Oracle VM VirtualBox template for Oracle VM Server, we need to enter an IP address for a server. (You can enter any IP address since it will be ignored.)
      • We don't need a network gateway since we used only the Oracle VM VirtualBox internal network, but the template for Oracle VM Server will ask for a gateway IP address. (You can enter any IP address since it will be ignored.)
  4. Your Oracle VM Server is now ready and you should see something similar to Figure 5 on the console:

    Figure 5

    Figure 5

    Note: The root password for this VM is ovsroot.

  5. To gain access to the mouse, press the rightmost CTRL key on your keyboard and minimize the ovm-srv window.
  6. Important: On your physical machine's native OS, open a new terminal window by selecting Applications-> System Tools-> Terminal) and run ping 192.168.56.2 to check that the Oracle VM VirtualBox virtual machine is OK.

Exercise 2: Install Oracle VM Manager

In this exercise, you create a VM by importing the Oracle VM VirtualBox template for Oracle VM Manager, and then you start and configure the VM for Oracle VM Manager.

Create a VM by Importing the Oracle VM VirtualBox Template for Oracle VM Manager

During this step, you create a second Oracle VM VirtualBox virtual machine by importing the pre-existing Oracle VM VirtualBox template OracleVMManager3.1.1build365.ova.

This VM will be our Oracle VM Manager. The normal way of installing Oracle VM Manager is to install a Linux Server (Oracle Linux or Red Hat Linux) and then install Oracle VM Manager from an ISO file or CD-ROM, but here we use the template to save time.

  1. In Oracle VM VirtualBox, select File-> Import Appliance and then select the file OracleVMManager3.1.1build365.ova.
  2. In the Appliance Import Settings screen, do the following:

    1. Double-click OracleVMManager3.1.1build365 and change the name to HOL9558_ovm-mgr.
    2. Click Import.

      Note: There is no need to change the RAM (4096 MB) or the CPU (1 vcpu) settings.

  3. Accept the license agreement.
  4. Wait for the import to complete (about three minutes).
  5. Modify the network settings:

    1. Select the VM ovm-mgr and click Settings.
    2. Go to Network and click the Adapter 1 tab.
    3. From the Attached to list, select Host-only Adapter.

      Note: There is no need to set promiscuous mode to "Allow all" for the network interface because no VM will run on the manager.

Start and Configure the VM for Oracle VM Manager

  1. In the Oracle VM VirtualBox admin console, select the HOL9558_ovm-mgr VM and click Start.
  2. Look at the VM console and wait for the message New Unix Passwd.
  3. Enter the following information:

    1. For the password, enter ovsroot twice (same as the Oracle VM Server password). Ignore the warning about a bad password, which is shown because the password is not secure.
    2. For the static IP address, enter 192.168.56.3.
    3. For the netmask, enter 255.255.255.0 (the default).
    4. For the gateway, enter 192.168.56.1.
    5. For the DNS server, enter 192.168.56.1.
    6. For the host name, enter ovm-mgr.oow.com.
  4. Wait for the VM to be ready (when the GNOME desktop is displayed), which takes about two minutes.
  5. To gain access to the mouse, press the rightmost CTRL key on your keyboard and minimize the ovm-mgr window.
  6. On your machine, open a new terminal window by selecting Applications-> Systems Tools-> Terminal and run ping 192.168.56.3 to check that the Oracle VM VirtualBox virtual machine is OK.

Exercise 3: Configure Oracle VM Manager

In this exercise, you perform several steps that configure Oracle VM Manager.

Create a Server Pool and Storage Repository

  1. Connect to the Oracle VM Manager Web console:

    1. On your physical machine, open a browser and connect to the Oracle VM Manager console using the URL http://192.168.56.3:7001/ovm/console.
    2. Log in using user admin and password Welcome1. You should now see the Oracle VM Manager console shown in Figure 6.

      Figure 6

      Figure 6

  2. Discover Oracle VM Server:

    1. Click icon.
    2. Leave 8899 for the Oracle VM Agent Port.
    3. Enter ovsroot for the Oracle VM Agent Password.
    4. Enter 192.168.56.2 for the IP Address.
    5. Click OK to launch the discovery.
    6. Wait a few seconds. You should now see the server, named ovm-srv.oow.com, in Unassigned Servers.
    7. Click the server to see server information (CPU, memory, and so on).

      Figure 7

      Figure 7

  3. Modify the network properties:

    Oracle VM has a number of network channels: Server Management, Live Migrate, Cluster Heartbeat, Virtual Machine, and Storage.

    The Server Management, Live Migrate, and Cluster Heartbeat roles are automatically assigned to the management network when you discover Oracle VM Server.

    For simplicity, we will use a single network for all roles by assigning the Virtual Machine and Storage roles to the default network.

    1. Click the Networking tab.
    2. Select network 192.168.56.0 and click icon to edit the network properties.
    3. In the Network Channels list, select the checkboxes Virtual Machine and Storage.

      Figure 8

      Figure 8

    4. Leave all other parameters as the default values by clicking Next-> Next-> Next-> Finish. 
  4. Create VNICs.

    The VNIC Manager creates VNICs, which can be used by virtual machines as network cards. You create virtual network interfaces by defining a range of MAC addresses to use for each VNIC.

    1. In the Networking tab, click Virtual NICs.
    2. Click Auto-Fill and then Create. This will create 20 VNICs.

      You should now see those VNICs listed, as shown in Figure 9.

      Figure 9

      Figure 9

  5. Create a server pool using Oracle VM Server:

    A server pool contains a group of Oracle VM Servers, which as a group perform virtual machine management tasks, such as ensuring high availability (HA), implementing resource and power management policies, and providing access to networking, storage, and repositories.

    The virtual machines running on a server can be "live migrated" to another server in the same pool. Of course, you need to have a shared storage system (NFS, iSCSI, FC) between all the servers of the pool. Such a pool is called clustered.

    Here, for simplicity, we will create a non-clustered server pool with a single server and use a local HDD (hard disk drive) (actually a file on the laptop that is seen by Oracle VM VirtualBox as an HDD).

    1. In Oracle VM Manager, go back to the Servers and VMs tab.
    2. Click the third icon from the left (icon) to create a new server pool, as shown in Figure 10.

      Figure 10

      Figure 10

    3. For Server Pool Name, select mypool, as shown in Figure 11.
    4. For Virtual IP Address for the Pool, select 192.168.56.4.
    5. Deselect Clustered Server Pool.

      Note: The Virtual IP Address of the pool is assigned to one server in the pool, called the master server. Several actions are executed by this master server. In a non-clustered pool with just one server, the server is also the master server. In a clustered pool with at least two servers, one of them is the master server. In case of failure on the master server, another server will take the master server pool and get this IP address. If you want to create a clustered server pool (not needed here), you need to have dedicated storage (NFS file system, or iSCSI LUN, or FC LUN) of at least 12 GB.

    6. Click Next.

      Figure 11

      Figure 11

    7. In the next window, click icon to add all servers (here there is only one) to the pool, and click Finish.

      You should now see the pool and our Oracle VM Server, ovm-srv, in it.

    8. Click icon to expand it.

      Figure 12

      Figure 12

  6. Create the storage repository.

    Before creating VMs hosted on the server pool, we need to create at least one storage repository to store not only the VMs' files but also ISO files, templates, and so on.

    1. Click the Repositories tab.
    2. Click icon to create a new storage repository.
    3. Enter the following information:

      • For Repository Name, enter myrepo (see Figure 13).
      • For Repository Location, select Physical Disk (used for local HDDs, iSCSI LUNs, and FC LUNs).
      • Select the right server pool (there is only one choice for mypool here).
      • Click the icon to select the local HDD (100 GB).

        Note: Only unused and unpartitioned local HDDs can be used.

        Figure 13

        Figure 13

    4. Click Next.
    5. Click icon to present this repository to all servers (here, there is only one).
    6. Click Finish.
    7. Wait a few seconds for the repository to be created.

      Note: For non-NFS storage (which is our case here), an OCFS2 (Oracle Cluster File System) is created on the repository.

    8. You should now see the new repository. Click icon to expand it.

      Figure 14

      Figure 14

Set Up an HTTP Web Server

Importing objects (templates, ISO images, and so on) into Oracle VM can be done in several ways:

  • HTTP Web server using syntax such as http://host[:port]/path/file
  • Anonymous FTP server using syntax such as ftp://host[:port]/path/file
  • Authenticated ftp server using syntax such as ftp://user:password@host[:port]/path/file

In this lab, we will use an HTTP Web server (Apache2) already running on Oracle VM Manager.

  1. From your physical machine's native OS, connect to the Oracle VM Manager as user root and run the following commands to create a directory to store the files that will be imported later:

    Note: The password is ovsroot.

    $ ssh root@192.168.56.3 
    # mkdir /var/www/html/files
    # chmod 777 /var/www/html/files
    # exit
    

    Reminder: If you are using Microsoft Windows on your physical machine, you will need tools to replace ssh and scp (PuTTY and WinSCP, for instance).

  2. From your terminal window, transfer the files that will be needed later in the lab:

    $ scp OVM_OL5U7_X86_64_PVM_10GB.tgz root@192.168.56.3:/var/www/html/files
    
  3. On your physical machine's native OS, start a Web browser and open the URL http://192.168.56.3/files to verify that the Web server is working.
  4. Keep the browser open, because you will need it later.

Import the Oracle Linux 5 Update 7 PVM Template

  1. Go to the Repositories tab.
  2. Expand Repositories and myrepo, as shown in Figure 15.
  3. Click VM Templates.
  4. Click icon.

    Figure 15

    Figure 15

  5. Enter the URL of the file to be imported: http://192.168.56.3/files/OVM_OL5U7_X86_64_PVM_10GB.tgz.

    Figure 16

    Figure 16

  6. Click OK to start the import.

    The import should take about three minutes and consists of two steps: downloading and unpacking.

    You can follow the progress in the Job summary panel. Once the import is finished, you should see the template in VM Templates, as shown in Figure 17.

    Figure 17

    Figure 17

  7. Edit the template by clicking icon.

    1. For Memory, replace 2048 MB with 1024 MB.
    2. For Max. Processors, replace 2 with 1.
    Figure 18

    Figure 18

  8. In the Networks tab, add network 192.168.56.0 to the Selected Ethernet Networks panel, as shown in Figure 19, and click OK.

    Figure 19

    Figure 19

Create a VM Based on the Imported Template

  1. Before going on, check that the template import is finished and make sure that all template modifications (CPU, memory, and network) are done.
  2. In the Oracle VM Manager Web console, go to the Servers and VMs tab.
  3. Expand the server pool and right-click the server ovm-srv.oow.com.
  4. Click Create Virtual Machine.
  5. Select Clone from an existing VM Template, as shown in Figure 20, and enter the following information:

    1. Select myrepo as the repository.
    2. Select OVM_OL5U7_X86_64_PVM_10GB.tgz as the VM template.
    3. Enter guest-vm for the VM name.
    4. Select mypool as the server pool.

      Figure 20

      Figure 20

  6. Click Finish to start VM creation.

    Note: The VM creation should be almost immediate since the repository uses the OCFS2 file system and the reflink feature. This avoids copying all blocks of the template files, and instead uses pointers to existing blocks in the new files.

  7. The guest-vm VM's status should now be shown as Stopped, as shown in Figure 21.

    Figure 21

    Figure 21

Start the Guest-VM Virtual Machine

  1. Select the guest-vm VM and start the VM by clicking icon.
  2. Click icon to launch the VM console.
  3. If needed, allow pop-ups in your Web browser.
  4. Tell the browser to use /usr/java/jre1.7.0_04/bin/javaws (installed with the JRE) to open .jnlp files (necessary only the first time you open a VM console), as shown in Figure 22.

    Figure 22

    Figure 22

  5. Allow the VM to boot in the console and then enter the following information when asked:

    Note: Ignore the warning about a bad password.

    1. For New Unix root Password, enter ovsroot.
    2. For Enable DHCP, enter n.
    3. For IP address, enter 192.168.56.11.
    4. For IP netmask, enter 255.255.255.0.
    5. For IP gateway, enter 192.168.56.1.
    6. For IP address for DNS server, enter 192.168.56.1.
    7. For Hostname.domainname, enter guest-vm.oow.com.
  6. Now, you can log on to this VM from a terminal window, for example, by running the following command for Linux machines:

    $ ssh root@192.168.56.11
    
  7. When ready, shut down the VM (to save resources):

    [root@guest-vm ]# halt
    

Conclusion

This concludes this hands-on lab. If you want to go further, see the following labs:

See Also

About the Authors

Christophe Pauliat and Olivier Canonge are Systems Sales Consultants for Oracle in France.

Acknowledgments

Special thanks to Kris Bakke, Doan Nguyen, Honglin Su, Simon Coter, Eric Bezille, Michel Kintz, and Greg King for their contributions.

Revision 1.0, 02/03/2013

facebook banner twitter banner