Technical Article
Deploying an IaaS Environment with Oracle VM
by Christophe Pauliat and Olivier Canonge
Published February 2013
Hands-On Labs of the System Admin and Developer Community of OTN
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.
Table of Contents
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:
- Latest version of Oracle VM VirtualBox (4.1.18 at the time of writing) for your OS, which is about 90 MB. Also download the extension pack, which is very small and common to all platforms.
- Oracle VM VirtualBox template for Oracle VM Manager 3.1.1 build 365 (3.15 GB).
- Oracle VM VirtualBox template for Oracle VM Server 3.1.1 build 365 (209 MB).
- Oracle VM Template for Oracle Linux 5 Update 7 (Paravirtualized) from the Oracle Software Delivery Cloud (login required),
OVM_OL5U7_X86_64_PVM_10GB.tgz
(815 GB). Gunzip the file to save time during the lab (new size: 2.44 GB). - The Java runtime environment (JRE) for that is appropriate for your native operating system; for example, for Linux RPM X64 (64-bit version) it would be
jre-7u4-linux-x64.rpm
(20 MB).
Install the Primary OS and Oracle VM VirtualBox
- Install on your system a 64-bit OS (mandatory for managing more than 4 GB of RAM) that is supported by Oracle VM VirtualBox.
- Install Oracle VM VirtualBox.
- Install the Oracle VM VirtualBox extension pack:
- Run Oracle VM VirtualBox.
- Then select File-> Preferences-> Extensions, and click
.
- In Oracle VM VirtualBox, configure a host-only network:
- Select File-> Preferences-> Network.
- Specify the following:
- Disable the DHCP server since we will not use it.
- Open a terminal window on your physical machine.
Network address: 192.168.56.0
Physical machine's IP address: 192.168.56.1
Netmask: 255.255.255.0 - 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
- 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
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.
- In Oracle VM VirtualBox, select File-> Import Appliance and then select the file
OracleVMServer3.1.1build365.ova
. - In the Appliance Import Settings screen, do the following:
- Double-click OracleVMServer3.1.1 and change the name to HOL9558_ovm-srv.
- Change CPU to 3 (needed for the Part 2 lab, How to Virtualize and Deploy Oracle Applications in Minutes with Oracle VM).
- If you have 16 GB of RAM, change RAM to 5120 MB (also needed for the Part 2 lab).
- If you have 8 GB of RAM, change RAM to 2048 MB.
- Click Import.
- Accept the license agreement.
- Wait for the import to complete (about two minutes).
- Modify the storage settings:
- Select the VM HOL9558_vm-srv and click Settings.
- Go to Storage and remove the disk2 entry under SATA Controller by clicking
, as shown in Figure 2.
Figure 2
- Add a new 100 GB hard drive (we will use this drive later as a repository) by selecting SATA Controller and clicking
. Select VDI as the file type, choose Dynamically allocated, specify the name repo, and specify a size of 100 GB.
- Modify the network settings, as shown in Figure 3:
- Go to Network, and click the Adapter 1 tab.
- From the Attached to list, select Host-only Adapter.
- Expand the Advanced section.
- 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
- Repeat these actions for the Adapter 2 tab.
- Click OK to exit the settings.
Start and Configure the VM for Oracle VM Server
- In the Oracle VM VirtualBox admin console, select the HOL9558_ovm-srv VM and click Start.
- Look at the VM console and wait for the message
Enter static IP address
, which is shown in Figure 4.Figure 4
- Enter the following information:
- For the static IP address, enter 192.168.56.2.
- For the netmask, enter 255.255.255.0 (the default).
- For the gateway, enter 192.168.56.1.
- For the DNS, enter 192.168.56.1.
- 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.)
- Your Oracle VM Server is now ready and you should see something similar to Figure 5 on the console:
Figure 5
Note: The root password for this VM is
ovsroot
. - To gain access to the mouse, press the rightmost CTRL key on your keyboard and minimize the ovm-srv window.
- 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.
- In Oracle VM VirtualBox, select File-> Import Appliance and then select the file
OracleVMManager3.1.1build365.ova
. - In the Appliance Import Settings screen, do the following:
- Double-click OracleVMManager3.1.1build365 and change the name to HOL9558_ovm-mgr.
- Click Import.
Note: There is no need to change the RAM (4096 MB) or the CPU (1 vcpu) settings.
- Accept the license agreement.
- Wait for the import to complete (about three minutes).
- Modify the network settings:
- Select the VM ovm-mgr and click Settings.
- Go to Network and click the Adapter 1 tab.
- 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
- In the Oracle VM VirtualBox admin console, select the HOL9558_ovm-mgr VM and click Start.
- Look at the VM console and wait for the message
New Unix Passwd
. - Enter the following information:
- 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.
- For the static IP address, enter 192.168.56.3.
- For the netmask, enter 255.255.255.0 (the default).
- For the gateway, enter 192.168.56.1.
- For the DNS server, enter 192.168.56.1.
- For the host name, enter ovm-mgr.oow.com.
- Wait for the VM to be ready (when the GNOME desktop is displayed), which takes about two minutes.
- To gain access to the mouse, press the rightmost CTRL key on your keyboard and minimize the ovm-mgr window.
- 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
- Connect to the Oracle VM Manager Web console:
- 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
. - Log in using user
admin
and passwordWelcome1
. You should now see the Oracle VM Manager console shown in Figure 6.Figure 6
- On your physical machine, open a browser and connect to the Oracle VM Manager console using the URL
- Discover Oracle VM Server:
- Click
.
- Leave 8899 for the Oracle VM Agent Port.
- Enter ovsroot for the Oracle VM Agent Password.
- Enter 192.168.56.2 for the IP Address.
- Click OK to launch the discovery.
- Wait a few seconds. You should now see the server, named ovm-srv.oow.com, in Unassigned Servers.
- Click the server to see server information (CPU, memory, and so on).
Figure 7
- Click
- 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.
- Click the Networking tab.
- Select network 192.168.56.0 and click
to edit the network properties.
- In the Network Channels list, select the checkboxes Virtual Machine and Storage.
Figure 8
- Leave all other parameters as the default values by clicking Next-> Next-> Next-> Finish.
- 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.
- In the Networking tab, click Virtual NICs.
- 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
- 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).
- In Oracle VM Manager, go back to the Servers and VMs tab.
- Click the third icon from the left (
) to create a new server pool, as shown in Figure 10.
Figure 10
- For Server Pool Name, select mypool, as shown in Figure 11.
- For Virtual IP Address for the Pool, select 192.168.56.4.
- 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.
- Click Next.
Figure 11
- In the next window, click
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.
- Click
to expand it.
Figure 12
- 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.
- Click the Repositories tab.
- Click
to create a new storage repository.
- 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
to select the local HDD (100 GB).
Note: Only unused and unpartitioned local HDDs can be used.
Figure 13
- Click Next.
- Click
to present this repository to all servers (here, there is only one).
- Click Finish.
- 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.
- You should now see the new repository. Click
to expand it.
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.
- 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
andscp
(PuTTY and WinSCP, for instance). - 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
- 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. - Keep the browser open, because you will need it later.
Import the Oracle Linux 5 Update 7 PVM Template
- Go to the Repositories tab.
- Expand Repositories and myrepo, as shown in Figure 15.
- Click VM Templates.
- Click
.
Figure 15
- Enter the URL of the file to be imported:
http://192.168.56.3/files/OVM_OL5U7_X86_64_PVM_10GB.tgz
.Figure 16
- 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
- Edit the template by clicking
.
- For Memory, replace 2048 MB with 1024 MB.
- For Max. Processors, replace 2 with 1.
Figure 18
- 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
Create a VM Based on the Imported Template
- Before going on, check that the template import is finished and make sure that all template modifications (CPU, memory, and network) are done.
- In the Oracle VM Manager Web console, go to the Servers and VMs tab.
- Expand the server pool and right-click the server ovm-srv.oow.com.
- Click Create Virtual Machine.
- Select Clone from an existing VM Template, as shown in Figure 20, and enter the following information:
- Select myrepo as the repository.
- Select OVM_OL5U7_X86_64_PVM_10GB.tgz as the VM template.
- Enter guest-vm for the VM name.
- Select mypool as the server pool.
Figure 20
- 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.
- The guest-vm VM's status should now be shown as Stopped, as shown in Figure 21.
Figure 21
Start the Guest-VM Virtual Machine
- Select the guest-vm VM and start the VM by clicking
.
- Click
to launch the VM console.
- If needed, allow pop-ups in your Web browser.
- 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
- Allow the VM to boot in the console and then enter the following information when asked:
Note: Ignore the warning about a bad password.
- For New Unix root Password, enter ovsroot.
- For Enable DHCP, enter n.
- For IP address, enter 192.168.56.11.
- For IP netmask, enter 255.255.255.0.
- For IP gateway, enter 192.168.56.1.
- For IP address for DNS server, enter 192.168.56.1.
- For Hostname.domainname, enter guest-vm.oow.com.
- 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
- 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:
- In Part 2 of this series, "How to Virtualize and Deploy Oracle Applications in Minutes with Oracle VM," we will create Oracle VM virtual machines from a more-complex Oracle VM Template containing Oracle Database 11g Release 2 with Oracle Real Application Clusters (Oracle RAC).
- In Part 3 of this series, "Deploying a Cloud Infrastructure with Oracle VM 3.x and the Sun ZFS Storage Appliance," we will repeat all operations of Part 1 using Oracle's Sun ZFS Storage Appliance Simulator (shared storage system) and also Oracle VM's Storage Connect feature (which enables the storage system to be managed directly from the Oracle VM Manager).
See Also
- Oracle VM documentation
- "Oracle Optimized Solution for Enterprise Cloud Infrastructure — Implementation Guide (x86-Linux)" white paper [PDF]
- "Oracle Storage Connect Plug-in for Sun ZFS Storage Appliance Administration Guide" (download the plug-in and extract all
.zip
files to get the white paper) - Oracle VM home page, which has several very good white papers, for example:
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