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.
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.
Follow this link to configure IMS with VirtualBox.
For information concerning integration with OVM please see the internal GlassFish OVM overview page
To run services directly on your local machine without an hypervisor, you need to follow those steps.
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
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).
Look at Templating page for information on how to build a template.
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.
A template can have a specific user (defaulted to the server pool user's if absent). To install the template user's information :
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.
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
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 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.
Say you just want to use a KVM machine with a static IP, do :
Resulting configuration known to work :
Lots of them obviously
- User credential seems to be very unix centric, needs to be revisited.
- Error cases not handled well.