BasicConfiguration

Skip to end of metadata
Go to start of metadata

Operating Systems installations

Before being able to run virtual machines, you need to configure the dom0 so it can create virtual machines. I will add more information on various O.S. as I gather it.

Operating Systems installations

Add basic configuration

KVM

To ensure your host machine is capable of running successfully virtual machines, you should create a virtual machine.
Example of doing so is located at this page

Follow this link to configure IMS with KVM.

VirtualBox

Follow this link to configure IMS with VirtualBox.

OVM

For information concerning integration with OVM please see the internal GlassFish OVM overview page

Native

To run services directly on your local machine without an hypervisor, you need to follow those steps.

Template

In order to allocate virtual machines, you need to create a virtual machine template. Such template comes from creating a VM like showed earlier and saving the associated disk image (in my example, called ubuntu.img). Such images are usually stored in /var/lib/libvirt/images on ubuntu

Generic template

I have also provided templates information that can be retrieve from the ftp server :
ftp 10.132.178.154 and use (cloud/cloud) as username/password. then retrieve the ubuntu.xml and ubuntu.img
(this is outdated, for now build it yourself).

Template Building

Look at Templating page for information on how to build a template.

Template Installation

To install a template in the DAS, you need to use the create-template admin command

You should run this command each time the original template files are changed as glassfish is making a copy of the files in its cache, you will need to do a delete-template first.

Template User

A template can have a specific user (defaulted to the server pool user's if absent). To install the template user's information :

Template Indexes

Templates are installed using indexes that can be used in queries. So far we support two types of indexes, first is the Service Type which represents the service a template will provided. So far, a template can only provided one service type (to be extended). Second index is the virtualization technology the template supports (again, only one at this point). Such indexes must be declared when the template is registered so the system can look them up when deployment and services requests are being resolved.

The template registration below registers a template for Java EE service type running in a libvirt environment.

Template replication

The templates will be replicated to all the machines configured in the group (in ~/virt/templates by default). This replication can take time so as soon as you have added a template restart the DAS and go to the target machines to see the progress. The DAS will print those messages. Do not do anything with the DAS and virtualization until you are sure all the templates have been copied successfully on the remote machines (this is a need to be improved area obviously).

[#|2011-02-22T12:33:27.317-0800|INFO|glassfish3.1|null|_ThreadID=16;_ThreadName=pool-3-thread-2;|Copying template ubuntu on cloud-2|#]

[#|2011-02-22T12:51:01.888-0800|INFO|glassfish3.1|null|_ThreadID=16;_ThreadName=pool-3-thread-2;|Finished copying template ubuntu on cloud-2|full details at : https://help.ubuntu.com/community/KVM/Installation

Virtual Clusters and deployment

Virtual Clusters

You are now ready to create a virtual cluster of Java EE service types :

This will create 2 virtual machines (round-robin on all your configured machines), where disks are installed in ~/virt/disks by default.

To delete an existing virtual cluster

deployment

Deployment is like any deployment to a cluster, use --target option.

You can use a cloud.xml (will be replaced with a glassfish-services.xml at some point, to automatically create a virtual cluster of JavaEE services (Database too) before deploying the application to the cluster. The name of the cluster will be defaulted to the appName, and the cluster (all services) will be deleted upon undeployement.

In the example below, located in the META-INF/cloud.xml, a cluster of 3 Java EE instances and 1 Database intense will be created.

Quick tutorial

Say you just want to use a KVM machine with a static IP, do :

Resulting configuration known to work :

Open Issues

Lots of them obviously

  • simplification
  • User credential seems to be very unix centric, needs to be revisited.
  • Error cases not handled well.
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jul 12, 2012

    Hello there!

    First of all, I would like to express my deepest gratitude for this tutorial and all of the support you guys give us to aid our cause. Glassfish in my opinion is one of the most well-written application I ever had pleasure to work with. After all I didn't picked it as one of technologies involved in my master degree project for no reason.

    After following steps from this tutorial I got stuck on deployment of my app. I verified logs and traced problem in code. It turns out that virtual cluster is not a proper target to deploy applications... so I guess this tutorial is a bit out-dated. Could you confirm that deployment to virtual cluster is not permitted? If so than how apps should be deployed so they have load balancer and elasticity container provisioned?

  2. Jul 13, 2012

    Hello Piotr,

    Yes, these instructions are outdated. In the most basic form, you would need to do this:

    1. asadmin create-ims-config-native
    2. asadmin register-service-provisioning-engine --defaultservice=true --type Database org.glassfish.paas.javadbplugin.DerbyPlugin
    3. asadmin register-service-provisioning-engine --defaultservice=true --type JavaEE org.glassfish.paas.gfplugin.GlassFishPlugin
    4. cadmin deploy <app>.war (assuming app is PaaS enabled)

    Please refer to https://wikis.oracle.com/display/GlassFish/LBTemplating for instructions on configuring and using a load balancer.

    HTH,
    -Yamini

    1. Jul 13, 2012

      thank you Yamini for throwing some light on this. If it comes to load balancer site I have already seen it, thanks for it. It was extremely helpful. If it comes to those register commands I will investigate them later... Two things that riveted my attention:

      1. in 4'th point - you wrote cadmin on purpose? Didn't you mean asadmin? I have not seen script with name like this so far...

      2. What do you mean by PaaS enablement? Could you explain me what it is or point me a place where I can read about it?

      and one last thing... do you plan to fix paas console so that it will work under secure-admin enabled?

      thank you for your reply,

      P

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Oracle community and they might not be employed or in any way formally affiliated with Oracle. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Oracle nor any other party necessarily agrees with them.