Lab: How To Migrate to Oracle VM and Oracle Linux from VMware and Red Hat Enterprise Linux 6

by Simon Coter with contributions from Christophe Pauliat, Olivier Canonge, and Doan Nguyen
Published December 2013

This hands-on lab takes you through the best practices for migrating an existing Oracle Database workload from VMware to Oracle VM. It also walks you through how to migrate to Oracle Linux a Red Hat Enterprise Linux 6 guest exported from VMware by downloading Oracle's Unbreakable Enterprise Kernel from Oracle's public yum server.

Introduction

This document details all actions that were done during Oracle OpenWorld 2013 session Hands-On Lab 9981.

This hands-on lab takes you through the best practices for migrating an existing Oracle Database workload from VMware to Oracle VM. It also walks you through how to migrate to Oracle Linux a Red Hat Enterprise Linux 6 guest exported from VMware by downloading Oracle's Unbreakable Enterprise Kernel from Oracle's public yum server.

Oracle VM is a free-license product, and it's the only virtualization x86 software solution certified for all Oracle products.

This lab showcases the https://en.wikipedia.org/wiki/Open_Virtualization_Format (OVA) format, a free-of-charge service supplied by Oracle's public yum server with which Oracle Linux and Oracle VM can be maintained without a subscription. By performing the steps in this lab, you will obtain a fully supported and certified configuration for Oracle Database (whereas on VMware, Oracle Database is only supported, not certified).

During this lab at Oracle OpenWorld, we used a demo environment built on a single x86 laptop (using Oracle VM VirtualBox), which contained two virtual servers and one Oracle VM Server guest:

  • Oracle VM Server
  • Oracle VM Manager
  • Oracle VM guest imported as an assembly

Note: You can also run this lab at your home or office on an x86 server, desktop, or laptop.

Preparation (Done Before the Lab)

To save time and fit in the one-hour slot of Oracle OpenWorld labs, the following actions were performed before the actual lab.

  • Install Oracle Linux 6.4 (64 bits) on all the laptops.
  • Install Oracle VM VirtualBox 4.2.16 plus extensions on all the laptops.
  • Disable the Oracle VM VirtualBox DHCP server (the default is for it to be enabled).
  • Install the Java runtime environment (JRE 7 update 25) on all the laptops. (This is needed to launch a VM console from Oracle VM Manager.)
  • Install and configure an Oracle VM Manager 3.2.4 server in an Oracle VM VirtualBox virtual machine.
  • Install and configure an Oracle VM Server 3.2.4 server in an Oracle VM VirtualBox virtual machine.
  • Configure the network and VNICs (Virtual Network Interface Cards).
  • Create an Oracle VM repository based on the assembly size.
  • Export from a third-party virtualization solution (such as VMware) a guest in OVA format (that is, as an assembly).
  • Configure the default HTTP server on Oracle VM Manager (port 80).
  • Prepare an Oracle yum server based on http://public-yum.oracle.com.

Note: To run this lab from your home or office, perform the tasks in Appendix A first to prepare your environment before you run the lab.

Summary of the Lab Steps

In this lab, you will execute the following steps in Oracle Enterprise Manager Cloud Control 12c:

  1. Start the two servers (Oracle VM Server and Oracle VM Manager).
  2. Connect to Oracle VM Manager and become familiar with the product.
  3. Verify that the Oracle VM environment started correctly.
  4. Import an assembly that has Oracle Database on top and was exported from VMware.
  5. Create an Oracle VM Template based on the VMware assembly.
  6. Edit the Oracle VM Template that was created.
  7. Create a guest based on the Oracle VM Template that was created.
  8. Verify and then start the Oracle VM guest that was created.
  9. Manually modify the guest configuration and remove VMware tools.
  10. Switch from the Red Hat kernel to Oracle's Unbreakable Enterprise Kernel for free.
  11. Transform the guest into a usable Oracle VM Template ("gold image").

Note: The migration approach followed by this lab is not the only one; other valid migration methods are based on official Oracle VM Templates such as Oracle VM Templates for Oracle Database.

Global Picture

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

Diagram of all the components and their configuration.

Figure 1. Diagram of all the components and their configuration.

Detailed Instructions for the Lab

Start the Two Servers

As previously explained, we will use Oracle VM VirtualBox to host the two servers (Oracle VM Server and Oracle VM Manager) on a single x86 physical machine.

  1. If it has not been started yet, start the Oracle VM VirtualBox console by clicking Cube.

    In the console, you should see the two VMs we will use in this lab.

    Oracle VM VirtualBox console.

    Figure 2. Oracle VM VirtualBox console.

  2. Select the VM called hol9981_ovm_mgr and Click r-arrow to start it.
  3. Select the VM called hol9981_ovm_srv and Click r-arrow to start it.
  4. Wait for the two VMs to be ready:
    • Wait for the desktop started prompt on the hol9981_ovm_mgr VM console.
    • When this prompt is displayed, all VMs are ready (since Oracle VM Manager takes the longest to start).

Connect to the Oracle VM Manager 3.2.4 Console

  1. On your x86 physical machine, open a Firefox browser and connect to the Oracle VM Manager 3.2.4 console using URL https://192.168.56.100:7002/ovm/console.

    Note: Firefox might raise a security warning (for example, This Connection is Untrusted) since the SSL certificates are self-signed. If so, ignore the warning (expand I understand the Risks, then click Add Exception, and then click Confirm Security Exception).

    You should get the login window shown in Figure 3:

    Login window.

    Figure 3. Login window.

  2. Log in using the following credentials:
    • Login: admin (default Oracle VM Manager administrator)
    • Password: Welcome1 (W is uppercase)

Verify that the Oracle VM Environment Correctly Started

  1. Once you are logged in to the Oracle VM Manager console, go to the Servers and VMs tab and verify the status of the Oracle VM pool and server; everything should look like Figure 4.

    Status of the Oracle VM pool and server in the Servers and VMs tab.

    Figure 4. Status of the Oracle VM pool and server in the Servers and VMs tab.

  2. Click the Networking tab and verify that the existing network is usable by guests. You should see a checkmark under Virtual Machines, as shown in Figure 5.

    Networking tab.

    Figure 5. Networking tab.

  3. Click the Virtual NICs hyperlink (at the top of the Networking tab), and then click Auto Fill and Create to create new VNICs.

    Newly created VNICs.

    Figure 6. Newly created VNICs.

  4. Click Servers and VMs, expand the pool named ovm-pool.oow.local, click the server named ovm-srv.oow.local, and select the Physical Disks perspective in the right pane.

    Displaying the physical disks.

    Figure 7. Displaying the physical disks.

  5. Select the physical disk named SATA_VBOX_HARDDISK and click Refresh Physical Disk.

    Selecting a physical disk.

    Figure 8. Selecting a physical disk.

  6. Confirm the refresh of the physical disk by clicking OK.
  7. Click the Repositories tab and select Show all repositories.

    Showing all repositories.

    Figure 9. Showing all repositories.

  8. Expand Repositories, click the repository named repo01, and click the Edit Selected Repository icon.

    Editing a repository.

    Figure 10. Editing a repository.

  9. In the new window that appears, click Take ownership and click OK.

    Selecting the Taken Ownership option.

    Figure 11. Selecting the Taken Ownership option.

  10. Re-select Repositories, expand it, and select repo01, and then click the Present/Unpresent icon.

    Selecting the Present/Unpresent icon.

    Figure 12. Selecting the Present/Unpresent icon.

  11. In the new window named "Present this repository to server(s)," move to the right the server pool named ovm-pool.oow.local and click OK.

    Presenting the repository to the server pool.

    Figure 13. Presenting the repository to the server pool.

  12. Select the repo01 repository and click the Refresh Selected Repository icon.

    Refreshing the repository.

    Figure 14. Refreshing the repository.

  13. Click the Assemblies folder, select the assembly named repo01_<code>, and click the Refresh selected VM Assembly icon.

    Refreshing the VM assembly.

    Figure 15. Refreshing the VM assembly.

Import the Assembly Exported from VMware

The purpose of this section is to show how to import into Oracle VM an assembly that was exported from VMware as described in Appendix A. An assembly can be described as a template of a group of virtual machines or a collection of multiple VM templates.

Note for importing assemblies or templates into Oracle VM: Oracle VM assemblies or templates can be imported from an HTTP or FTP server. An HTTP server is shown in the following example.

  1. Click the Repositories tab, expand the repo01 repository, and select the Assemblies directory; after that, Click D-arrow to proceed with the assembly import.

    Preparing to import an assembly.

    Figure 16. Preparing to import an assembly.

  2. In the Import VM Assembly window shown in Figure 17, enter into the "VM Assembly download location" field a URL that specifies the download location of the assembly .ova file you exported from VMware earlier:

    Example URL for a .ova file stored on your own web server:
    http://apachehost/path/file.ova

    Example URL for a .ova file stored on the Oracle VM Manager server:
    http://192.168.56.100/ovas/rhel-64-oracle-rdbms.ova

    Example of specifying the assembly location.

    Figure 17. Example of specifying the assembly location.

  3. In the same window, click OK and, after that, follow the job progression in the Job Summary window.

    Following the progress of the import.

    Figure 18. Following the progress of the import.

    At the end of the job, your assembly will be shown in the Repositories tab with the same name as the .ova file that was imported:

    The imported assembly.

    Figure 19. The imported assembly.

Create an Oracle VM Template Starting from an Assembly

The purpose of this section is to show how-to create an Oracle VM Template starting from an assembly.

In Oracle VM Manager, templates and assemblies appear in different folders of the storage repository, but their VM configuration files and disk images are stored in the same location as those of other virtual machines and templates.

The procedure to obtain a new virtual guest starting from an assembly is:
Assembly =>Template =>New Guest(s)

To create the template based on the rhel-64-oracle-rdbms.ova assembly exported from VMware, proceed with the following steps:

  1. Click the Repositories tab, expand the repo01 repository, and select the Assemblies directory; after that, click the assembly row and click (Add).

    Preparing to create a template.

    Figure 20. Preparing to create a template.

  2. Enter the following details in the new window:
    1. In the VM Template Name field, enter the name of your template.
    2. In the Description field, enter a description of the template that will be created.

      In our example, we use the following:

      VM Template Name: rhel-64-oracle-rdbms
      Description: Red Hat 6.4 x86-64 exported from VMware with Oracle Database on board

      Specifying a name and description for the template.

      Figure 21. Specifying a name and description for the template.

  3. In the same window, click OK and, after that, follow the job progression in the Job Summary window.

    Following the progress of the template creation.

    Figure 22. Following the progress of the template creation.

    Note: The creation of a VM template could take several minutes. The larger the size of the machine exported from VMware, the more time it will take to obtain the template. While waiting, read the next steps.

  4. When the job is completed, verify that the template is correctly created and ready to use:

    Click the Repositories tab, expand the repo01 repository, and select the VM Templates directory; after that, click the template and expand it.

    Expanding the template.

    Figure 23. Expanding the template.

    The Oracle VM Template configuration should look like Figure 24:

    Checking the template configuration.

    Figure 24. Checking the template configuration.

Edit the Oracle VM Template

The template, which was derived from an assembly exported from VMware, needs correct sizing and network configuration; so this section shows how to edit an Oracle VM Template.

  1. Click the Repositories tab, expand the repo01 repository and select the VM Templates directory; after that, click the template created before (in our example, it is named rhel-64-oracle-rdbms) and Click Pencil.

    Preparing to edit the template.

    Figure 25. Preparing to edit the template.

  2. In the window that appears, enter the following details:

    In the Configuration tab:
    Operating System: Red Hat Enterprise Linux 6
    Domain Type: Xen PVM
    Max. Memory (MB): 2048
    Memory (MB): 2048

    Specifying the template configuration.

    Figure 26. Specifying the template configuration.

    In the Networks tab:
    Select 192.168.56.0 and move it to the Selected Ethernet Networks panel on the right using r-arrow2.

    Selecting a network.

    Figure 27. Selecting a network.

    No changes need to be made in the Disks and Boot Order tabs, so click OK.

    The result of this configuration is shown in Figure 28 and Figure 29:

    Template configuration.

    Figure 28. Template configuration.

    Network selection.

    Figure 29. Network selection.

Create a Guest Based on the Oracle VM Template

We will now create a guest (virtual machine) based on the template just created. This section will show how to create a guest from an Oracle VM Template (in our case, the Oracle VM Template has been derived from a virtual machine exported from VMware).

  1. Click the Servers and VMs tab and Click Create-mach.

    Preparing to create a virtual machine.

    Figure 30. Preparing to create a virtual machine.

  2. In the Create Virtual Machine window, choose the Clone from an existing VM Template option and, after that, enter the following details:

    Clone count: 1
    Repository: repo01
    VM Template: rhel-64-oracle-rdbms
    VM Name: vmdb01.oow.local
    Server Pool: ovm-pool.oow.local
    Description: first guest created from a VMware OVA

    Specifying the virtual machine configuration.

    Figure 31. Specifying the virtual machine configuration.

    Then click Finish to confirm the guest creation.

  3. Verify that the creation job completed successfully.

    Verifying that the job completed successfully.

    Figure 32. Verifying that the job completed successfully.

    Note about Immediate VM creation on Oracle Cluster File System 2: The VM creation should be almost immediate since the repository uses the Oracle Cluster File System 2 file system and the reflink feature. This avoids the need to copy all blocks of the template files, but instead uses pointers to existing blocks in the new files. (For details on the Oracle Cluster File System 2 reflink feature, see https://blogs.oracle.com/wim/entry/ocfs2_reflink.)

Verify and Start the Oracle VM Guest

Our guest is ready but, before we start it, we need to verify that everything was accomplished. This section will show how to verify a guest and start it.

  1. Click the Servers and VMs tab, expand Server Pools, and expand the pool named ovm-pool.oow.local by clicking Expand.

    Expanding the server pool.

    Figure 33. Expanding the server pool.

  2. Select the physical server (dom0) named ovm-srv.oow.local, and the guest we created will appear in the panel on the right.

    Selecting the server.

    Figure 34. Selecting the server.

  3. Select the Red Hat Enterprise Linux 6 guest named vmdb01.oow.local and Click Pencil.

    Selecting the guest.

    Figure 35. Selecting the guest.

  4. In the "Edit Virtual Machine: vmdb01.oow.local" window, verify the following details:

    In the Configuration tab:
    Name: vmdb01.oow.local
    Operating System: Red Hat Enterprise Linux 6
    Domain Type: Xen PVM
    Max. Memory (MB): 2048
    Memory (MB): 2048
    Max. Processors: 1
    Processors: 1
    Priority: 50
    Processor Cap %: 100

    Verifying the guest configuration.

    Figure 36. Verifying the guest configuration.

    In the Networks tab:
    Network: 192.168.56.0

    Verifying the network configuration.

    Figure 37. Verifying the network configuration.

    In the Disks tab:
    For Slot 0, the Disk Type is Virtual Disk (no change).
    For Slot 1, the Disk Type is Empty (changed from CD/DVD to Empty).

    Verifying the disk configuration.

    Figure 38. Verifying the disk configuration.

    Click OK.

  5. Start the vmdb01.oow.local guest by clicking Start.

    Starting the guest.

    Figure 39. Starting the guest.

    The guest will temporarily change to the "Starting" state; you can also verify that the job completed successfully. If you want, you can also click Job Details to see a detailed log of the start process.

    Getting details for the job.

    Figure 40. Getting details for the job.

  6. Verify that the job completed successfully; you can evaluate the result in the Job Summary section at the bottom of the window and also in the Status column.

    Verifying that the job completed successfully.

    Figure 41. Verifying that the job completed successfully.

Manually Modify the Guest Configuration

Obviously this guest needs some changes. First of all, the network configuration needs to be changed since the default network configuration on VMware is network 192.168.93.0/24 while the default network configuration on Oracle VM VirtualBox is 192.168.56.0/24.

Also, guest ovmdb01.oow.local is not network-reachable, so you have to connect to its console to modify the network configuration; this section will show how to open a guest console and modify a network configuration.

  1. Select the guest named vmdb01.oow.local and Click Console.

    Opening a guest console.

    Figure 42. Opening a guest console.

  2. A pop-up blocker might appear. If so, allow pop-ups for Oracle VM Manager.

    Pop-up blocker message.

    Figure 43. Pop-up blocker message.

  3. The browser will ask what to do with a file (ovm_rasproty-ws.jnlp); choose Open with and select /usr/java/latest/bin/javaws (the latest installed JRE on your machine).

    Confirming that the file should be opened.

    Figure 44. Confirming that the file should be opened.

    Telling the browser to open the file using the JRE.

    Figure 45. Telling the browser to open the file using the JRE.

    Click OK to confirm.

    The console with a boot-progress bar will appear but it will not have a login prompt:

    Console without login prompt.

    Figure 46. Console without login prompt.

  4. To obtain a login prompt, move your mouse cursor in the VNC console window, click, and press the F8 function key on your keyboard; a menu will appear and there select the ALT option.

    Selecting the ALT option.

    Figure 47. Selecting the ALT option.

    IMPORTANT: This task might not be possible from your home or office if no local VNC client is installed. If you aren't able to get the login prompt on the console, use the substeps below to determine the DHCP address assigned to the Red Hat Enterprise Linux 6 guest (vmdb01.oow.local) and then connect to the guest. If you are able to get the login prompt, proceed to Step 5.

    1. Connect to Oracle VM Manager ovm-mgr.oow.local (192.168.56.100) using ssh root@192.168.56.100 (the root password is ovsroot).
    2. Execute the command tail-50 /var/log/messages |grep DHCPACK, for example:
      
      
      [root@ovm-mgr ~]# tail -50 /var/log/messages |grep DHCPACK
      Aug 16 01:59:30 ovm-mgr dhcpd: DHCPACK on 192.168.56.254 to 00:21:f6:00:00:02 via eth0
      
    3. Connect to the Red Hat Enterprise Linux 6 guest using the DHCP address obtained above (the password is ovsroot), for example:

      ssh root@192.168.56.254

    4. Proceed to step 6.
  5. Now press the F2 function key to open Console Window number 2 and you'll see the login prompt; at this point you have to deselect the ALT option, so press F8 and then deselect the ALT option.

     Login prompt.

    Figure 48. Login prompt.

    Log in using the following:
    User: root
    Password: ovsroot

  6. Uninstall the VMware tools by executing the following command:

    #vmware-uninstall-tools.pl

    Uninstalling the VMware tools.

    Figure 49. Uninstalling the VMware tools.

  7. Verify that the removal succeeded:

    Verifying the uninstallation of the VMware tools.

    Figure 50. Verifying the uninstallation of the VMware tools.

  8. In the Oracle VM console, verify the guest IP address (from the DHCP server installed on Oracle VM Manager):

    #ifconfig eth0


    Verifying the guest IP address.

    Figure 51. Verifying the guest IP address.

  9. Open a terminal window on your machine and connect to the guest using the IP address you obtained above:

    #ssh root@<IP_address_obtained>

    Note: The guest root password is ovsroot.

    Connecting to the guest.

    Figure 52. Connecting to the guest.

  10. Verify the status of Oracle Database and Oracle Listener using the following commands:
    
    
    # service oraOOWDB status
    # ps -edaf |grep oracle
    

    The output should be similar to Figure 53:

     Verifying the status of Oracle Database and Oracle Listener.

    Figure 53. Verifying the status of Oracle Database and Oracle Listener.

Switch from Red Hat to Oracle Linux

One of the goals of this lab is to show Oracle's public yum server: http://public-yum.oracle.com.

Oracle's public yum server offers a free and convenient way to install the latest Oracle Linux packages as well as packages from the Oracle VM installation media via a yum client.

You can download the full Oracle Linux and Oracle VM installation media via Oracle Software Delivery Cloud. To stay current on errata updates, you might wish to subscribe to the Oracle Linux errata mailing list. This yum server is offered without support of any kind. If you require support, please consider purchasing Oracle Linux Support online or via your sales representative.

For this lab, we will replicate a local Oracle public yum server to speed up the switching process. The role of the local Oracle public yum server belongs to the ovm-mgr.oow.local (192.168.56.100) server.

  1. If you are not already connected, connect via a terminal window to your vmdb01.oow.local guest.
  2. Execute the following command to copy the yum configuration:

    #scp 192.168.56.100:/etc/yum.repos.d/myRepo.repo /etc/yum.repos.d/


    Note: The root password requested from ovm-mgr.oow.local is ovsroot.

    Preparing to copy the yum configuration.

    Figure 54. Preparing to copy the yum configuration.

  3. Pass the redhat-release package to oracle-release by executing the following commands:

    #yumdownloader oraclelinux-release.x86_64 oraclelinux-release-notes.x86_64


    Passing the Oracle Linux release packages.

    Figure 55. Passing the Oracle Linux release packages.

    #rpm -Uhv --force oraclelinux-release*

    Forcing the packages to upgrade.

    Figure 56. Forcing the packages to upgrade.

  4. Install the Oracle Linux distribution packages and Oracle's Unbreakable Enterprise Kernel using the following command:

    #yum install oracle-logos.noarch oracle-rdbms-server-11gR2-preinstall.x86_64 oracleasm-support.x86_64

    Note: This command will replace Red Hat logos, install the Unbreakable Enterprise Kernel (due to dependencies) and, last but not least, install Oracle software preinstallation packages such as the following:

    • oracle-rdbms-server-11GR2-preinstall
    • oracle-em-agent-12cR1-preinstall

    These preinstallation packages are available for x86_64 only. Specifically, these packages do the following:

    • Cause the download and installation of various software packages and specific versions needed for database installation, with package dependencies resolved via yum
    • Create, if needed, the user oracle and the groups oinstall and dba, which are the defaults used during database installation
    • Modify the kernel parameters in /etc/sysctl.conf to change settings for shared memory, semaphores, the maximum number of file descriptors, and so on
    • Set hard and soft shell resource limits in /etc/security/limits.conf, such as the number of open files, the number of processes, and the stack size to the minimum required based on the Oracle Database 11g Release 2 installation requirements
    • Set numa=off in the kernel boot parameters for an x86_64 machine

    These packages automate and prepare Oracle Linux to accommodate software such as Oracle Database, Oracle WebLogic, Oracle Enterprise Manager Cloud Control, Oracle E-Business Suite, and so on.

    Yum will ask for a confirmation to proceed with the install of packages; reply with Y:

    Confirming the installation of the packages.

    Figure 57. Confirming the installation of the packages.

    The installation process will complete in a few minutes as shown below:

    Completion of package installation.

    Figure 58. Completion of package installation.

  5. Verify the vmdb01.oow.local GRUB configuration to ensure that it will boot with the new Unbreakable Enterprise Kernel.

    You can verify your GRUB configuration using the command cat /boot/grub/grub.conf, for example:

    Verifying the GRUB configuration.

    Figure 59. Verifying the GRUB configuration.

    In this example, "default kernel (1)" is the old Red Hat kernel; so we have to modify the default value to 0. We would like also to see all boot steps, so, we need to remove rhgb quiet from the boot kernel command line.

    As root, open the /boot/grub/grub.conf file and change the default value from 1 to 0 and remove rhgb quiet; to accomplish this task, you can use an editor such as vi or, if you don't know this tool, execute the following commands:

    
    
    # sed -i s/default=1/default=0/ /boot/grub/grub.conf
    # sed -i s/rhgb\ quiet// /boot/grub/grub.conf
    

    After that, verify that the default value is correctly set (value is 0).

    #cat /boot/grub/grub.conf

    Verifying that the default value is correct.

    Figure 60. Verifying that the default value is correct.

  6. Disable Linux services that are not needed:

    #chkconfig rhsmcertd off

    # chkconfig rhnsd off

  7. Reboot the vmdb01.oow.local guest from Oracle VM Manager:
    1. Click the Servers and VMs tab, expand Server Pools, and expand the ovm-pool.oow.local pool using Expand.

      Expanding the pool.

      Figure 61. Expanding the pool.

    2. Select the physical server (dom0) named ovm-srv.oow.local and the running guest will appear in the panel on the right.

      Selecting the server.

      Figure 62. Selecting the server.

    3. Select the guest named vmdb01.oow.local and Click Restart.

      Restarting the guest.

      Figure 63. Restarting the guest.

    4. Confirm the reboot of the guest by clicking OK.
  8. Wait for the guest to reboot (you can follow its reboot in the console opened before). When the reboot is completed, do the following to verify the Unbreakable Enterprise Kernel and the parameters introduced by the preinstallation package oracle-rdbms-server-11GR2-preinstall:
    1. Reconnect using ssh.

      #ssh root@<IP_address_of_guest>

      Log in using the following:
      Username: root
      Password: ovsroot

      In the following figure, the IP address of the guest is 192.168.56.254.

      Connecting to the guest.

      Figure 64. Connecting to the guest.

    2. Verify that the kernel loaded:

      #uname -a

      Verifying that the kernel loaded.

      Figure 65. Verifying that the kernel loaded.

    3. Verify the kernel parameters introduced by the package:

      # cat /etc/sysctl.conf


      Verifying the kernel parameters.

      Figure 66. Verifying the kernel parameters.

    4. Verify the settings for the Linux oracle user introduced by the preinstallation package:

      # cat /etc/security/limits.conf


      Verifying the setting for the oracle user.

      Figure 67. Verifying the setting for the oracle user.

By performing the steps in this section, we obtained the following fully supported and certified configuration for Oracle Database (whereas on VMware, Oracle Database was only supported, not certified):

Oracle VM => Oracle Linux => Oracle Database 11g Release 2

We obtained this fully certified Oracle Database configuration with a cheaper virtualization solution. You can obtain further details from the following My Oracle Support note:

"Support Position for Oracle Products Running on VMWare Virtualized Environments (Doc ID 249212.1)"

The first statement in the My Oracle Support note says "Oracle has not certified any of its products on VMware virtualized environments."

Create Your Own Templates Starting from a Guest

This section will describe how to build an Oracle VM Template starting from an existing guest (in our case, a guest created by a VMware OVA).

An Oracle VM Template is a reusable guest on which we will be able to create more guests automatically.

  1. First, install the RPMs that supply Oracle VM APIs; in our example configuration, you can complete this task using the following command:

    # yum install ovm*.


    The main packages that will be installed are as follows:

    • ovm-template-config: Oracle VM Template configuration tool
    • ovmd: Oracle VM guest daemon
    • libovmapi: Oracle VM APIs

    Installing the RPMs.

    Figure 68. Installing the RPMs.

    The task will be completed in few seconds, and the result will be similar to Figure 69:

    Result of installing the RPMs.

    Figure 69. Result of installing the RPMs.

  2. Connect to the guest console using Oracle VM Manager and prepare the guest to be transformed into an Oracle VM Template:

    Once the console is open, execute the following commands:

    
    
    # ovmd -s cleanup
    # chkconfig ovmd on
    # service ovmd enable-initial-config
    # shutdown -h now
    

    Note: If you aren't able to open a guest console and obtain a login prompt, connect via ssh and execute all the steps in one command (the password is ovsroot):

    
    
    ssh root@<IP_address_obtained_earlier>
    # ovmd -s cleanup; chkconfig ovmd on; service ovmd enable-initial-config; shutdown -h now
    

    Note: If you are connected by ssh, you'll lose the connection to the guest.

    Preparing the guest.

    Figure 70. Preparing the guest.

  3. Verify that your guest is stopped and, after that, clone it to a new Oracle VM Template:
    1. Connect to Oracle VM Manager, select the Servers and VMs tab, select the pool named ovm-pool.oow.local, and select the Virtual Machines perspective.
    2. Click the vmdb01.oow.local guest and click the Clone or Move Virtual Machine icon.

       Preparing to clone the guest.

      Figure 71. Preparing to clone the guest.

  4. In the "Clone or Move Virtual Machine: vmdb01.oow.local" window, select the first option on the left and click Next.

    Specifying that the guest be cloned.

    Figure 72. Specifying that the guest be cloned.

  5. Enter the following details:

    Clone to a: Template
    Clone Count: 1
    Clone Name: Oracle Linux 6.4 - Oracle Database 11.2
    Target Server Pool: ovm-pool.oow.local
    Description: Oracle Linux Template with Oracle 11.2 Database on board

    Click OK to confirm the creation of the new Oracle VM Template.

    Cloning the guest to create a template.

    Figure 73. Cloning the guest to create a template.

  6. Verify the creation of your Oracle VM Template by clicking the Repositories tab, expanding the repo01 repository, and clicking the VM Templates folder.

    Verifying the creation of the template.

    Figure 74. Verifying the creation of the template.

  7. Select the new Oracle VM Template named Oracle Linux 6.4 - Database 11.2 and Click Pencil.

     Selecting the template.

    Figure 75. Selecting the template.

  8. Change Operating System from Red Hat Enterprise Linux 6 to Oracle Linux 6 and click OK.

    Changing the template's OS.

    Figure 76. Changing the template's OS.

  9. Create a new guest named vmdb02 from the new Oracle Linux template by selecting the new Oracle VM Template named Oracle Linux 6.4 - Database 11.2 and clicking Clone.

    Preparing to create a new guest.

    Figure 77. Preparing to create a new guest.

  10. In the "Clone or Move Template: Oracle Linux 6.4 - Database 11.2" window, select the Create a clone of this Template option.

    Specifying the clone operation.

    Figure 78. Specifying the clone operation.

  11. Enter the following details:

    Clone to a: Virtual Machine
    Clone Count: 1
    Clone Name: vmdb02.oow.local
    Target Server Pool: ovm-pool.oow.local
    Description: clone pre-configured started from Oracle VM Template

    Click OK to confirm the creation of the new Oracle VM guest.

    Confirming the creation of the new guest.

    Figure 79. Confirming the creation of the new guest.

  12. Start the new Oracle VM guest vmdb02.oow.local by selecting Servers and VMs, expanding the pool named ovm-pool.oow.local, selecting the guest named vmdb02.oow.local, and clicking Start.

    Starting the guest.

    Figure 80. Starting the guest.

  13. Open the vmdb02.oow.local console by clicking Console.

    Opening the guest's console.

    Figure 81. Opening the guest's console.

  14. One of first Oracle Linux services that you can start via the console will be "starting OVM template configure":

    Console options.

    Figure 82. Console options.

    The Oracle VM Template configuration will ask for information for the new guest vmdb02.oow.local; enter the following details:

    In the NETWORK category:
    System host name: vmdb02.oow.local
    Network device to configure: eth0
    Activate interface on system boot: yes
    Boot protocol: DHCP or static: static
    IP address of the interface: 192.168.56.199
    Netmask of the interface: 255.255.255.0
    Gateway IP address: 192.168.56.1
    DNS servers separated by comma: 192.168.56.1

    In the AUTHENTICATION category:
    System root password: <your_first_name>+<your_surname>+1

    Note: Due to security policies, we have to insert one long password that contains at least one number.

    Specifying the template's configuration.

    Figure 83. Specifying the template's configuration.

  15. Open a terminal window on your machine and connect to your new guest (IP address 192.168.56.199) using ssh.

    Commands such as hostname, ifconfig, and uname -a will show you details.

    Connecting to the new guest.

    Figure 84. Connecting to the new guest.

Summary

Congratulations! You have successfully imported a guest from VMware to Oracle VM, switched from Red Hat to Oracle Linux, and created your first Oracle VM Template using Oracle VM Template configuration scripts.

You can now master your knowledge and create your own Oracle VM Template configuration scripts by following the guide deployed by Wim Coekaerts on his Oracle blog:

https://blogs.oracle.com/wim/entry/oracle_vm_template_config_script

Appendix A: Preparing the Environment to Run the Lab from Your Home or Office

Find a Suitable Machine

This appendix explains how to prepare the environment if you want to run this lab from your home or office.

The first step is to find an x86 machine (server, desktop, or laptop) that has the required resources:

  • At least 16 GB of RAM
  • An x86 64-bit CPU (Intel or AMD) with at least four CPU threads and with virtualization extensions (Intel VT or AMD-V)—only Parallel Virtual Machine (PVM) guests are allowed on top of this architecture
  • An OS supported by Oracle VM VirtualBox (Microsoft Windows, various Linux distributions, Oracle Solaris 10 or 11, or Apple Mac OSX)
  • 100 GB of disk space

Then you download the required binaries, install Oracle VM VirtualBox on the machine, and install the following two servers (two Oracle VM VirtualBox virtual machines, in fact), as described in the next sections:

  • Oracle VM Server
  • Oracle VM Manager

Download Required Binaries

This section lists the required binaries and explains how to download them.

  1. Download the files for your x86 machine:

    Java Runtime Environment (JRE) 7 (the javaws binary is needed to get the VNC console)
    Download the version for your OS from http://java.com/en/download/manual.jsp.

    Oracle VM VirtualBox binaries (version 4.2.16 during writing of this document)
    Download the version for your OS from https://www.virtualbox.org/wiki/Downloads.
    File name:
    For Oracle Linux or Red Hat Linux 6 (64 bits): VirtualBox-4.2-4.2.16_86992_el6-1.x86_64.rpm (size 69 MB)
    For Microsoft Windows: VirtualBox-4.2.16-86992-Win.exe (size 95 MB)

    Oracle VM VirtualBox Extension Pack 4.2.x
    Download this from https://www.virtualbox.org/wiki/Downloads (the same file is used for all operating systems).

    File name: Oracle_VM_VirtualBox_Extension_Pack-4.2.16-86992.vbox-extpack (size 11 MB)

  2. Download the file for Oracle VM Server:

    VirtualBox template for Oracle VM Server 3.2.4
    Download this from http://www.oracle.com/virtualization/technologies/vm/downloads/template-downloads.html
    File name: OracleVMServer.3.2.4-b525.ova (size 249 MB)

  3. Download the file for Oracle VM Manager:

    VirtualBox template for Oracle VM Manager 3.2.4
    Download this from http://www.oracle.com/virtualization/technologies/vm/downloads/template-downloads.html
    File name: OracleVMManager.3.2.4-b524.ova (size 2.75 GB)

Install Oracle VM VirtualBox

  1. On your chosen x86 machine, install the JRE you downloaded.
  2. Install the Oracle VM VirtualBox 4.2.x binaries on your x86 machine.
  3. Start the Oracle VM VirtualBox console.
  4. If it has not already been created, go to File-> Preferences-> Network and create a host-only network in Oracle VM VirtualBox using the default IP information (IPv4 address 192.168.56.1 and netmask 255.255.255.0 for your x86 machine). Also disable the default Oracle VM VirtualBox DHCP server. After these changes, reboot your x86 machine.
  5. Go to File-> Preferences-> General-> Default Machine Folder and choose the folder you want to use to store the virtual machines files.
  6. Go to File-> Preferences-> Extensions and install the Oracle VM VirtualBox Extension Pack you downloaded.

Install Oracle VM Server

  1. In the Oracle VM VirtualBox console, import the VM from the Oracle VM Server template:
    1. Select File-> Import Appliance.
    2. Select the OracleVMServer.3.2.4-b525.ova file you downloaded.
    3. Click Next.
    4. Change the name of Virtual System 1 from Oracle VM Server 3.2.4-b525 to hol9981_ovm_srv.
    5. Click Import.
  2. Modify the settings of the virtual machine hol9981_ovm_srv:
    1. Set Amount of Memory to 6144MB (System).
    2. Configure the network by going to Network and clicking the Adapter 1 tab. From the Attached to list, select Host-only Adapter.
    3. Configure storage by removing the second 20 GB disk and adding a new 60 GB disk (or a bigger disk, based on the size of the guest you will export from VMware).
  3. Start the virtual machine hol9981_ovm_srv.
  4. Configure the virtual machine (in the VM console):
    1. Configure the network:

      IP address: 192.168.56.101
      Netmask: 255.255.255.0
      Gateway: 192.168.56.1
      DNS server: 192.168.56.1 (we will not use DNS, but we have to give an IP address here)
      Hostname: ovm-srv.oow.local

    2. Wait for the boot to complete.
  5. If your x86 machine runs a UNIX or Linux OS, open a terminal window and connect to the VM using ssh. If your machine runs Microsoft Windows, use PuTTY instead.

    Note: The password is ovsroot.

    $ ssh root@192.168.56.101

  6. Add the following lines to the /etc/hosts file:
    
    
    192.168.56.100    ovm-mgr.oow.local    ovm-mgr
    192.168.56.101    ovm-srv.oow.local    ovm-srv
    192.168.56.199    vmdb02.oow.local     vmdb02
    

Export the VMware Guest in OVA Format

In this lab, we create more than one guest and an Oracle VM Template starting from a Red Hat Enterprise Linux 6 guest exported from VMware.

The guest exported for this lab during Oracle OpenWorld was as follows:

  • OS: Red Hat Enterprise Linux 6.4 x86-64
  • vCPUs: Two
  • vRAM: 8192 MB
  • Disks: One disk of 30 GB
  • Applications: Oracle Database Enterprise Edition 11.2.0.3

There is more than one method for exporting a guest into OVA format. The method used in this lab is text mode using a tool named OVF Tool.

To export your own Red Hat Linux guest using OVF Tool, use syntax such as the following:

# ovftool /app/vmware/RH_Linux_6_x86-64/rhel_6_64-bit.vmx /app/rhel-64-oracle-rdbms.ova

You can put the .ova file on the Oracle VM Manager server at the following path:

/var/www/html/ovas

For example:

scp /app/rhel-64-oracle-rdbms.ova 192.168.56.100:/var/www/html/ovas

Alternatively, you can put the .ova file on your own web server; be sure to note the path where you put the file, because you will need this information during the lab.

Export methods using other VMware products are reported at these public links:

Note: If you are instead going to export a Microsoft Windows guest from VMware, you could encounter a known problem: the BSOD (blue screen of death) on the first run of your guest on Oracle VM. To sort out this problem, you have two options you can follow before exporting the guest:

  • Connect to your Windows guest and extract driver .cab files already present in the Microsoft Windows distribution.
  • Install Oracle VM paravirtual (PV) drivers for Microsoft Windows. Download Oracle VM PV drivers for Microsoft Windows from the Oracle Software Delivery Cloud.

Reference: Oracle VM Windows PV Drivers for Microsoft Windows Guests (XP/Vista/7/2003/2008/2008 R2) 3.0.1 - 32-bit/64-bit (signed by Microsoft for the Windows Logo Program for Windows 2008, Windows 2008 R2, Windows 2003 and Windows 7)

Install Oracle VM Manager

  1. In the Oracle VM VirtualBox console, import the VM from the Oracle VM Manager template:
    1. Select File-> Import Appliance.
    2. Select the OracleVMManager.3.2.4-b524.ova file you downloaded.
    3. Click Next.
    4. Change the name of Virtual System 1 from Oracle VM Manager 3.2.4-b524 to hol9981_ovm_mgr.
    5. Click Import.
  2. Modify the settings of the virtual machine hol9981_ovm_mgr:
    1. Configure the network by going to Network and clicking the Adapter 1 tab.
    2. From the Attached to list, select Host-only Adapter.
  3. Start the virtual machine hol9981_ovm_mgr.
  4. Configure the virtual machine (in the VM console):
    1. Set the root password to ovsroot.
    2. Configure the network:

      IP address: 192.168.56.100
      Netmask: 255.255.255.0
      Gateway: 192.168.56.1
      DNS server: 192.168.56.1 (we will not use DNS, but we have to give an IP address here)
      Hostname: ovm-mgr.oow.local

    3. Wait for the boot to complete.
  5. If your x86 machine runs a UNIX or Linux OS, open a terminal window and connect to the VM using ssh. If your machine runs Microsoft Windows, use PuTTY instead.

    Note: The password is ovsroot.

    $ ssh root@192.168.56.100

  6. Add the following lines to the /etc/hosts file:
    
    
    192.168.56.100    ovm-mgr.oow.local    ovm-mgr
    192.168.56.101    ovm-srv.oow.local    ovm-srv
    192.168.56.100    vmdb02.oow.local     vmdb02
    
  7. Enable the Apache httpd daemon on the manager (which will be used to upload templates):
    
    
    # service httpd start
    # chkconfig httpd on
    
  8. Configure directories that will support the httpd daemon used for .ova files and the yum server.
    
    
    # mkdir -p /web/ovas
    # mkdir -p /web/yum
    # cd /var/www/html; ln -s /web/ovas .; ln -s /web/yum .
    
  9. Copy the .ova file you exported from VMware to the new directory created in the previous step. You should then obtain output similar to this if you list the contents of the directory:
    
    
    [root@ovm-mgr]# ls -l
    -rwxr-xr-x 1 ovmovm 9900220416 Aug 19 13:02 rhel-64-oracle-rdbms.ova
    [root@ovm-mgr]# pwd
    /web/ovas
    
  10. Prepare a yum repository for Oracle Linux 6 based on http://public-yum.oracle.com. (The Oracle VM Manager guest will need internet access, so you have to temporarily modify your network connection.)
    1. Download the public yum repository file to install new packages:
      
      
      # cd /etc/yum.repos.d
      # wget https://public-yum.oracle.com/public-yum-el5.repo
      
    2. Install the tools needed to build your local yum repository:

      # yum install yum-utils createrepo

    3. Download the public yum repository file for Oracle Linux 6 (the target release of our guest on top of Oracle VM in this lab) and remove the Oracle Linux 5 repo file (which was used to install the packages above).
      
      
      # rm -f /etc/yum.repos.d/public-yum-el5.repo
      # cd /etc/yum.repos.d
      # wget https://public-yum.oracle.com/public-yum-ol6.repo
      
    4. Create the local repository on the Oracle VM Manager machine.

      Note: It might take many hours, depending on your internet connection, because it will download about 27 GB; if you don't have much time, see the alternative option below.

      
      
      # /usr/bin/reposync --repoid=ol6_latest --repoid=ol6_UEK_latest -repoid=ol6_addons -p /web/yum
      # /usr/bin/createrepo /web/yum/ol6_latest/getPackage/
      # /usr/bin/createrepo /web/yum/ol6_UEK_latest/getPackage/
      # /usr/bin/createrepo /web/yum/ol6_addons/getPackage/
      

      An alternative option is to directly use http://public-yum.oracle.com in this lab; to implement this alternative, you will need to have internet access and, at the same time, configure your Oracle VM Manager guest to reach external sites.

    5. Prepare the .repo file to use on your future Oracle VM guest (with Oracle Linux 6 x86-64):
      
      
      [local_ol6_latest]
      name=Oracle Linux $releasever Latest ($basearch)
      baseurl=http://192.168.56.100/yum/OracleLinux/OL6/latest/$basearch/
      gpgkey=http://192.168.56.100/RPM-GPG-KEY-oracle-ol6
      gpgcheck=0
      enabled=1
      
      [local_ol6_UEK_latest]
      name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
      baseurl=http://192.168.56.100/yum/OracleLinux/OL6/UEK/latest/$basearch/
      gpgkey=http://192.168.56.100/RPM-GPG-KEY-oracle-ol6
      gpgcheck=0
      enabled=1
      
  11. Install and implement a DHCP server on Oracle VM Manager; we need this function to supply IP addresses on the guest that will be created on our Oracle VM Server:

    #wget http://public-yum.oracle.com/repo/OracleLinux/OL5/9/base/x86_64/dhcp-3.0.5-31.el5_8.1.x86_64.rpm

    
    
    # chkconfig dhcpd on
    # service dhcpd start
    

    Here is an example of a dhcpd.conf file you can implement (/etc/dhcpd.conf):

    
    
    # DHCP Server Configuration file.
    #   see /usr/share/doc/dhcp*/dhcpd.conf.sample
    #
    ddns-update-style interim;
    ignore client-updates;
    subnet 192.168.56.0 netmask 255.255.255.0 {
    
            option routers                  192.168.56.1;
            option subnet-mask              255.255.255.0;
            option nis-domain               "oow.local";
            option domain-name              "oow.local";
            option domain-name-servers      192.168.56.1;
            range dynamic-bootp 192.168.56.250 192.168.56.254;
            default-lease-time 86400;
            max-lease-time 86400;
    }
    

Configure the Oracle VM Environment

  1. Connect to the Oracle VM Manager web console:
    1. On your x86 physical machine, open a Firefox browser and connect to the Oracle VM Manager console using URL https://192.168.56.100:7002/ovm/console.
       
    2. Log in using user admin and password Welcome1.

      You should now see the Oracle VM Manager console:

      Oracle VM console.

      Figure 85. Oracle VM console.

  2. Discover the Oracle VM Server:
    1. Click Discover.
    2. Leave 8899 for the Oracle VM Agent port.
    3. Enter ovsroot for the Oracle VM Agent password.
    4. Enter 192.168.56.101 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.local, under Unassigned Servers.

    7. Under Unassigned Servers, click the server to see server information (CPU, memory, and so on).
  3. Modify the network configuration:

    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 Pencil to edit its properties.
    3. In the network channels list, select the checkboxes Virtual Machine and Storage.

      Assigning roles to the default network.

      Figure 86. Assigning roles to the default network.

    4. Leave all other parameters as the default values by clicking Next three times. Then click Finish. 
  4. Create VNICs (Virtual Network Interface Cards):

    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:

      List of VNICs that were created.

      Figure 87. List of VNICs that were created.

  5. Create a server pool using the Oracle VM server:

    Note: A server pool contains a group of Oracle VM servers, which as a group perform virtual machine management tasks, such as providing 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, or FC) between all the servers of the pool. The pool is called clustered in this case.

    Here, for simplicity, we will create a non-clustered server pool with a single server and will use a local hard disk drive (HDD). (Actually, it is a file on the machine 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 ( Create-server-pool) to create a new server pool:

      Preparing to create a server pool.

      Figure 88. Preparing to create a server pool.

    3. Enter the following information:

      Server pool name: ovm-pool.oow.local
      Virtual IP address for the pool: 192.168.56.200

      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.

    4. Deselect Clustered Server Pool.
    5. Click Next.

      Creating the server pool.

      Figure 89. Creating the server pool.

    6. In the next window, Click Double-arrow to add all servers (here, only one server) to the pool, and finally click Finish.
    7. Once the pool is created, you should see the pool and our Oracle VM server, ovm-srv, in it. Click Expand-2 to expand.

      The created server pool and server.

      Figure 90. The created server pool and server.

  6. Create the storage repository:

    Before creating VMs hosted on the server pool, we need to create at least one storage repository in which to store the VMs' files.

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

    1. Click the Repositories tab.
    2. Click Add to create a new storage repository.
    3. For Repository Name, enter repo01.
    4. For Repository Location, select Physical Disk (this is used for local HDDs, iSCSI, and FC LUNs).
    5. Select the right server pool (there is only one choice for mypool here).
    6. Click Mag to select the local HDD.

      Creating the storage repository.

      Figure 91. Creating the storage repository.

    7. Click Next.
    8. Click Double-arrow to present this repository to all servers (here, there is only one), and finally, click Finish.
    9. 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 2) file system is created on the repository.

    10. You should now see the new repository. Click Expand-2 to expand it.

      The newly created repository.

      Figure 92. The newly created repository.

See Also

Oracle VM documentation

In addition, this hands-on-lab document is available at the following site: https://blogs.oracle.com/scoter/entry/oracle_openworld_2013_hands_on

About the Author

Simon Coter is a technical expert in core technology for Oracle in Italy.

Acknowledgments

Special thanks to Christophe Pauliat, Olivier Canonge, and Doan Nguyen for their contributions.

Revision 1.0, 12/20/2013