by Yuli Vasiliev
Published June 2012
This article describes how to prepare an Oracle VM environment to use Oracle VM Templates, how to obtain a template, and how to deploy the template to your Oracle VM environment. It also describes how to create a virtual machine based on that template and how you can clone the template and change the clone's configuration. As an example, the article uses a template for Oracle Database that contains two disk images: an Oracle Linux system image and an Oracle Database image.
Virtualization technology offers many benefits, including higher utilization of the CPU and other hardware resources, easy software deployments, and simplified systems management. To make software management and deployment even easier, Oracle introduced Oracle VM Templates: prebuilt, preconfigured virtual machines (VMs) that are fully ready for deployment to a virtualized environment. A typical template includes a guest operating system and application software, along with configuration information needed for the VM deployment.
The main attraction for using Oracle VM Templates is to make deploying and managing VMs easier. Oracle offers a large number of VM templates for most popular Oracle products, including Oracle Database, Oracle Business Intelligence Enterprise Edition, Oracle WebLogic Server, Oracle Linux, and MySQL Database, to name a few.
Before you can make use of a template, you must first install Oracle VM, which requires installing at least one Oracle VM Server plus Oracle VM Manager.
To install Oracle VM Server, you'll need a clean machine. Oracle VM Server provides a hypervisor and a privileged domain (Dom0) to install directly on a bare metal server that does not require a host operating system.
Oracle VM Server takes over the entire hard drive, thus requiring a dedicated machine. If you just want to play a little with it and cannot provide a dedicated machine for it, a simple workaround might be to temporarily use another hard drive, such as a removable hard drive. There are motherboards that let you connect such external devices through the back panel of the computer as a SATA device. If that is not possible, you should be able to connect it through a USB port. Then, be sure to set it as the first boot device in the BIOS. To be on the safe side, you should temporarily unplug your regular hard drive. This approach allows you to easily revert back to your regular configuration later on.
After installing Oracle VM Server, you need to install Oracle VM Manager, which will be used to manage the virtualization environment created during the server installation. Oracle VM Manager does not require a dedicated machine. However, Oracle recommends that Oracle VM Server and Oracle VM Manager be installed on separate machines (installing both on the same machine is tricky and unsupported). In other words, you'll need another machine. As of Oracle VM Manager 3.0, you can install Oracle VM Manager on a computer running Oracle Linux 5 Update 5 (64-bit) or later.
To learn about the software and hardware requirements for a specific release of Oracle VM, refer to the appropriate Oracle VM installation guide.
During the simple installation of Oracle VM Manager 3.0, the following software components are installed:
Note: Oracle Database, Express Edition 11g is bundled with Oracle VM Manager 3 for customer-evaluation purposes, but Oracle Database, Standard Edition or Oracle Database, Enterprise Edition is required for production support as the management repository. All necessary licenses, including licenses for Oracle WebLogic Server and Oracle Database (Standard Edition or Enterprise Edition) are included at no additional charge. For more details, refer to My Oracle Support Doc ID 1356588.1: Oracle VM 3.0 WebLogic and Oracle Database Product Licensing and Support Policy (requires login).
After you have installed Oracle VM Server and Oracle VM Manager, the next task is to see whether the machine hosting Oracle VM Server is pingable from the Oracle VM Manager's host. If it is, you can proceed to set up your Oracle VM environment with the help of Oracle VM Manager.
To start working with Oracle VM Manager, point your browser to this address:
Alternatively, you can use Secure Sockets Layer (SSL) by pointing your browser here:
You'll be routed to the Login page of Oracle VM Manager, where you need to enter the administration username and password you specified during the Oracle VM Manager installation.
After a successful login, complete the following tasks, which prepare your environment for using Oracle VM Templates:
Note: This step is not required if you are using the local storage on your Oracle VM Server. The storage options are discussed later.
To complete the task of discovering your Oracle VM Server, perform the following steps:
Figure 1 shows what the Hardware view of Oracle VM Manager might look like after your Oracle VM Server has been discovered:
Figure 1. The Hardware View of Oracle VM Manager
Now that your Oracle VM Server has been discovered, you can create a server pool, which is a required step when setting up an Oracle VM environment. To do this, follow these steps:
You can now add your Oracle VM Server to the newly created server pool by performing the following steps:
The next required step is to create a storage repository for storing your Oracle VM resources, including Oracle VM Templates. Here, you have several options. In the simplest case, you can take advantage of an NFS share. The other options include local storage, iSCSI SAN, and Fibre Channel SAN.
Although it's more reliable to use a separate location (such as an NFS share) for a storage repository, you can use a local disk of your Oracle VM Server instead, thus taking advantage of the local storage option. Beware, though: Oracle VM Server 3.0 doesn't allow you to utilize the unused space on the physical disk it's installed on. For local storage, you'll need at least one more physical disk. In other words, you'll need a total of two disks at minimum on your Oracle VM Server host if you want to use local storage. In practice, though, local storage is not a primary use case. The major downside to this approach is that local storage, by definition, cannot be shared between different servers.
For the NFS share option, an NFS file server can be set up easily on the majority of operating systems being used today. The ability to expose a file system to a network so that remote hosts can mount it as if it is mounted locally provides interesting storage opportunities. For example, you might readily turn a host running Microsoft Windows into a file server that will host a storage repository in your Oracle VM environment. For further details on setting up an NFS server, you can check the vendor documentation.
The next step is to register a file server or a storage array, depending on what you're going to use. As mentioned, this step is not required if you are using the local storage on your Oracle VM Server. In the case of the NFS share option, you'll need to register a file server. The following steps describe how you might do this, assuming you already have an NFS file server running in your network:
After completing the file server registration, Oracle VM Manager automatically starts a discovery job for the server's file systems. So, you should have a file system that can be used to create a storage repository for your server pool. That file system should appear under the File Servers->your_file_server node on the Storage tab of the Hardware view.
As a result of the previous steps, the newly created repository should appear in the table on the Repositories tab. Now you need to present the repository to your Oracle VM Server so the server can use it. To do this, follow these steps:
After successfully completing the previous steps, you're ready to start working with Oracle VM Templates. The first step will be to obtain a template from the Oracle Software Delivery Cloud (requires login).
You'll be directed to the Media Pack Search screen.
If you're using Oracle VM Manager 3.0 or later, you must select x86 64 bit.
Figure 2 shows what the Search page might look like after you've conducted a search for Oracle VM Templates on the x86 64-bit platform.
Figure 2. Results of the Search
As a result, you'll be taken to the chosen template's download page, on which you might find more than one template download link. For example, at the time of this writing, the Oracle VM Templates for Oracle Database Media Pack for x86_64(64 bit) page offers two templates: one for Oracle Database 10g Release 2 and the other for Oracle Database 11g Release 1.
Also, on the download page, you can find the readme file accompanying the template. Read it carefully to learn the following:
After downloading the template archive to your system, move it to a directory where it will be available through FTP, HTTP, or HTTPS. (The template importing mechanism used in Oracle VM Manager is limited to those protocols only.)
The following steps describe how you can import a template into your Oracle VM environment through Oracle VM Manager:
If the importing process fails at the very beginning, the first thing to check is the firewall. In particular, you might need to disable the firewall on the host running Oracle VM Manager (the firewall is disabled on Oracle VM Server by default).
During importing, the template archive will be downloaded and then unpacked in the specified repository. Then the repository will be automatically refreshed so that Oracle VM Manager can reflect the changes made in its content tabs. Figure 3 illustrates what the Oracle VM Manager window might look like after the importing process has been completed successfully.
Figure 3. Templates Tab After an Importing a Template into the Oracle VM Environment
To view the template's configuration and network and storage information, select the template in the Templates table and then click an appropriate tab.
After you have successfully imported a template into your Oracle VM environment, you might want to create a virtual machine from it. Before you can do that, though, you need to perform some networking tasks in Oracle VM Manager. In particular, you need to create a virtual machine network and generate a set of Virtual Network Interface Cards (VNICs) that will be assigned to virtual machines as network cards.
To create a virtual machine network, follow the steps below:
If you have a single Oracle VM Server, you can select the Create a logical network on a single server option. In that case, the wizard will present only two more screens.
Figure 4. Clone Virtual Machine Template Dialog Box
As a result of the above steps, a virtual machine will be created and deployed to the server pool in a stopped state.
As a result, the virtual machine's console should appear, reflecting the virtual machine's load process. On the first load, you'll be asked several questions to configure the virtual machine. In particular, you'll be asked whether you're going to obtain an IP address for the virtual machine via DHCP or use a static IP address.
Figure 5 illustrates what the console might look like at this stage:
Figure 5. Virtual Machine Console During the First Start of a Virtual Machine
The preinstalled applications might also require some configuration during the first load of a virtual machine. For example, when first loading a virtual machine with a preinstalled Oracle Database, you'll be prompted to enter the TCP/IP port for the Oracle Net listener as well as the password for system accounts and other things that are needed to set the initial configuration parameters of the database. You will also be asked whether you want the database to be started on boot.
After this initial configuration, you'll be prompted to log in to the guest operating system. You can login as
root using the password
ovsroot (which is the case for all Oracle VM templates). If a template contains an Oracle database, as in our example, you can use the database account
oracle with the password
oracle to connect to the database.
As you probably realize, the cloning mechanism we touched on in the preceding section is not limited only to creating a virtual machine from a template. In fact, cloning also allows you to create new templates from existing ones and even create new templates and virtual machines from existing virtual machines.
Turning back to our example, let's clone the virtual machine created from a template in the preceding section to create a new template. The reasoning here is to create a template that might be used to generate virtual machines that do not require initial configuration, which could shorten the time it takes to get those virtual machines ready for use. With this approach, some parameters might be configured later, if needed, of course.
The following steps describe how you might create a new template from a virtual machine:
In the preceding steps, you performed a clone operation known as a cold clone, because a clone was created from a stopped virtual machine. Alternatively, you might perform a hot clone by dealing with a running virtual machine. Be warned, though: A hot clone produces a clone with inconsistent disk status, which makes it suitable only for use as a snapshot or a backup copy.
After completing the preceding steps, you should have a new template you can use to create virtual machines that do not require initial configuration. However, there are at least two parameters you most likely will want to change when a new virtual machine is created from this template:
It seems reasonable to do that, unless you want to have more than virtual machine sharing the same host name and IP address in your network.
If you want to change these parameters at the first start of the virtual machine, perform the following steps:
root(using the password
vitext editor to edit the following configuration files, changing the IP address and the host name to the new values:
As you might guess, the example discussed here is rather unlikely. It's hard to believe that someone would choose to do manual configuration in place of answering some questions on the first boot of a virtual machine. However, there might be situations where you have a need to create a template from a virtual machine. For example, after creating some objects (such as tables, views, indexes, and stored procedures) in a virtual machine that is running an Oracle database, you might want to create a template from that virtual machine.
So far, we have looked at a simple clone created with the same configuration as the item from which it was cloned. In practice, though, you might need to create a clone with different configuration and deployment options. This is where you can take advantage of the advanced clone option.
To perform an advanced cloning of a template, you invoke the clone operation for that template and then select Advanced Clone for the clone type. Then, the wizard will walk you through the process of reconfiguring the template.
Moreover, you can edit a template, changing its network settings, amount of memory, virtual CPU number, and so on.
To invoke the Edit Template wizard, follow these steps:
The first screen of the Edit Template wizard is shown in Figure 6.
Figure 6. First Screen of the Edit Template Wizard
When you complete the steps in the wizard, you should have a template with the configuration differing from the initial configuration.
As you learned in this article, Oracle VM Templates provide a good way to distribute Oracle technologies to an Oracle VM environment, making it easy for you to get up and running quickly.
This article described a simple example of the Oracle VM Templates technology in action. The template containing Oracle Database running on Oracle Linux was downloaded and then imported into an Oracle VM environment. Then, the article described how you might clone the template to create a new virtual machine or a new template with different configuration.
For more information, see the Oracle VM Templates Website: http://www.oracle.com/technetwork/server-storage/vm/templates-101937.html.
Yuli Vasiliev is a software developer, freelance author, and consultant currently specializing in open source development, Java technologies, business intelligence, databases, service-oriented architecture (SOA), and, more recently, virtualization. He is the author of a series of books on Oracle technology; the most recent one is Oracle Business Intelligence: An Introduction to Business Analysis and Reporting (Packt, 2010).
|Revision 1.0, 06/06/2012|