Sunday, December 16, 2012

Oracle VM Templates Model


Oracle VM Template Model
In an Oracle (private) cloud administrators and/or users can create Guest VMs based on Templates. These templates are basically guest OSes with often some pre-installed software, which takes the user through basic configuration steps at first boot (such as network settings etc). You can download these Templates from Oracle’s eDelivery cloud, but you can also create them yourself using Oracle VM Template Builder. (Note that there is also an Oracle VM Template Builder template on the eDelivery site).
A Template is built using an Oracle JeOS image  (Just enough OS), and then extending it with virtual disks, packages from Oracle’s public YUM reposities, and your own packages and scripts (if any). Let’s say you want to create a Oracle Enterprise Linux 5 update 8 Template.
Press the “New Template Project” from the main Template screen:
Creating a new Template using Oracle VM Template BuilderCreating a new Template using Oracle VM Template Builder

You can then name your Template, and choose the JeOS image it has to be based on. Note that the JeOS image defines whether the Template will be a HVM (Hardware Virtualized Machine) or PVM (Para Virtualized Machine).
Describe your TemplateDescribe your Template

Next is defining the (virtual) hardware. If you choose to keep the system disk small, you can add extra disks to the Template when needed.
Choose the hardware for the TemplateChoose the hardware for the Template

Now we will specify a YUM repository for the packages that will be installed in the Template. This needs to be a compatible repository with the chosen JeOS image: if the JeOS is OEL5u8, then take the OEL5 latest (8+) for example.
Specify the YUM repository to useSpecify the YUM repository to use

Defining which packages from the YUM repository have to be installed into the Template has to be done in the following step. It will resolve the dependencies automatically. What to chose here depends on the usages of the Template. If you are creating a Template for a SOA Suite installation for example, you can select all required packages.
Choose OS packagesChoose OS packages

The next step is to define additional packages (from outside the YUM repository) that will be part of the Template.  You can for example add the Oracle JDK7 RPM as part of the Template:
Upload / add additional packagesUpload / add additional packages

Note that the URL can also be a local (to the) Oracle VM Template Builder machine. Every build project creates a /opt/ovmtb/uploads/<random string> directory. In you place your RPMs in that directory, you can refer to them using file://<etc> . You can also use HTTP of FTP of course.
JDK as additional packageJDK as additional package

The last page is the confirmation with the overview of the Template to be created.
Template overviewTemplate overview
By pressing “Save and Build” the Template will be build by the OVM TB daemon.
The result is a tarball with the Template:
Completed buildsCompleted builds

The link to the “tarball” can be imported in Oracle VM Manager to add the Template to the Repository. In Oracle VM Manager you can then create a Guest VM from it. Even cooler: you can add this template to your Software Library in Oracle Enterprise Manager 12c Cloud Control. Self Service users can then utilize the template.
The Template has some cool first boot scripts build in. Wim Coekaerts has written a great post on that. Check it out.
Extra
If you use the Oracle VM Template Builder Oracle VM Template, it doesn’t come with the OEL 5u8 JeOS image. You can download these images from the eDelivery cloud. Copy the JeOS RPM to the Template builder machine, together with the RPMs that come with the “JeOS Base x86 and x86_64″ download from eDelivery.
As root on the machine:
1rpm -Uvh ovm-modify-jeos-1.1.0-16.el5.noarch.rpm
2rpm -ivh ovm-el5u8-xvm-jeos-1.1.0-2.el5.x86_64.rpm
3
4service ovmtb stop
5service httpd stop
6service ovmtb restart
7service httpd restart
Adding YUM repositories to the Template builder is simple: just open the repo file (e.g. http://public-yum.oracle.com/public-yum-el5.repo) in your browser and add the baseurl of the version you want  as YUM repsository (replace the $basearch by “x86_64″ for example). For example: http://public-yum.oracle.com/repo/OracleLinux/OL5/latest/x86_64/ for x86 64bits.


Using Oracle VM Template Builder to create your Guest VMs3.5 out of 5 based on 4 ratings

No comments:

Post a Comment