- Template-repository, OVF and Abiquo
- Installing and Deploying template-repository
- Installation Guidelines
- Full Installation of template-repository
- Module Deployment with a Web Application Server
- Create the Main Folder
- Configuring template-repository
- Configure the Firewall for Access to the Application
- Testing the template-repository Installation
- Production Configuration
- Using template-repository
|Work In Progress|
We are currently working to improve this documentation
The template-repository application is a side-project developed to work with Abiquo. It provides a user-friendly interface for creating and managing a template repository. A template repository contains different virtual machine template definitions ready for users to download into the Abiquo appliance library. A template repository can be shared by multiple Abiquo datacenters, allowing convenient centralized template management.
The template-repository application is implemented with version 1.2.4 of the Play! Framework, a lightweight Java Web framework. You can install it with the Play! Framework or download the .war file and install it with a Tomcat or other web application server.
Template-repository, OVF and Abiquo
The template-repository application makes it easier to work with virtual machine templates in Abiquo. It is easy to upload a virtual machine template disk file to the template-repository. The template repository automatically detects the disk format and size. Your virtual machine template is now ready for Abiquo users to download directly from the repository.
The template repository application creates an Abiquo .ovf file as described in this table.
Abiquo OVF Section
Abiquo Usage and Notes
Details displayed in the Abiquo Appliance Library
Used to provision the virtual machine. The Ethernet Driver is written to the .ovf file but Abiquo currently uses E1000 only on all hypervisors except ESX/ESXi
Virtual Disk File
DiskSection and fileRef to disk file
Used to provision the virtual machine. You should not change these values.
For more information see OVF Reference
To download the .ovf file for a template in template-repository, click the Download OVF button on the Edit screen.
Installing and Deploying template-repository
To install template-repository you can perform one of these installs:
- full installation and deployment with the Play framework
- module installation and deployment with a Tomcat server or other web application server
- Abiquo recommends that you install the template-repository on CentOS 6
- Abiquo recommends Oracle Java
- You should not install the template-repository on the Abiquo Tomcat server
- You can install the template-repository on a virtual machine, including one deployed with Abiquo
- The template-repository will require enough hard disk space to hold all the uploaded virtual disk files (but not linked virtual disk files)
- The Play! Framework should only be used within a secure environment. Do not allow access from the Internet.
Full Installation of template-repository
Install template-repository Prerequisites
A full installation requires the following dependencies:
- Java runtime environment, required by Play Framework.
- Play Framework 1.2.4. Download and unzip it because you will need the binaries to run the template-repository application.
- A MySQL database, used to store the repository data (optional)
- Git, to download the code from the repository.
The following instructions are for Unix operating systems, but the Play Framework can also be installed on Windows.
Installation of Prerequisites on Abiquo Linux
- Install Abiquo Linux with no Abiquo components selected
- Install the latest version of the Java SDK from Oracle
- Download Oracle Java SE Development Kit 7 - Linux x64 (64-bit) RPM
- Copy the RPM file to the server in the /tmp directory
- Install the file using the package manager
- Check the java version
- Download Oracle Java SE Development Kit 7 - Linux x64 (64-bit) RPM
- Install Play! Framework 1.2.4
- Download, for example, while logged in to the server
- Install unzip and unzip Play! Framework
- Export Play! Framework path
- Test play is installed correctly
- Add a repo for yum install of git
- Create a repo file. Edit /etc/yum.repos.d/epel.repo and copy and paste the following
- Add the key for the repo
- Install git using yum
Download the Code from Github
After you install the dependencies, open a shell and go to the directory where you unzipped play framework. Download the code for the template-repository using the following command:
Starting the Webapp on the Play Framework
Go to the directory where you installed the Play Framework and execute the following command:
This will run the application in the background and generate a .pid file.
Managing the .pid File
You must manage the .pid file carefully because if the machine shuts down ungracefully, the .pid file will still exist when it restarts. This will mean that the application will not be able to start up again, even if it is currently stopped, because a .pid file exists. To delete the .pid file, run the following command:
Then the application will be able to start again.
Module Deployment with a Web Application Server
You can deploy the template repository with a web application server. Abiquo recommends Apache Tomcat.
For example, to use a Tomcat server to deploy the template-repository:
- Install and configure Tomcat if necessary (do not use the Abiquo Tomcat server)
- Download the .war file
- Put the .war file in the appropriate directory (e.g. webapps)
- It is not necessary to restart the Tomcat server
Create the Main Folder
Create the repository main folder. To create the default main folder (/opt/template_repository) use the following command.
You can configure the main folder in the application.conf file. See #Configuring the main folder
By default the configuration is stored in the template-repository/conf/application.conf file. This file contains more information about the configuration options.
See also the Play! Framework configuration documentation.
Configuring the main folder
Use a directory on the filesystem instead of MySQL
Use a different port
Use Open-ID Authentication
To use Open-ID authentication, edit the application.conf file in the directory /template-repository/conf. Find the line containing the text "organization.domain". Remove the "#" character to uncomment this line and set the value of the organization.domain. For example, for abiquo.com, this section of the file would look like this.
Configure the Firewall for Access to the Application
Allow access to the port configured to access the application in your firewall. By default this is port 9000 but you can configure a different port.
Example firewall configuration using iptables
|Unsupported Example for Guidance Only|
This information is provided for guidance only. Firewall configuration should be performed by a security expert.
Run this command as root to list the firewall rules
Modify the rules to allow tcp access to port 9000 (or replace 9000 with your chosen port) and save the configuration
Check the access using the command
Look for the port that you have configured for template-repository and check that it will accept connections
Testing the template-repository Installation
To test the repository in your browser, go to the address http://my.repository.URL:myPORT/.
To test the repository in Abiquo, add the repository to the Appliance Library and check that you can see the appliances.
After testing your template-repository deployment, change the following configuration options before going into production. By default the configuration is stored in the template-repository/conf/application.conf file.
Set template-repository to production mode
Change the appplication.mode parameter from dev (development) to prod (production).
Use a new secret key
To improve security, use a new secret key. Generate one using the play framework (./play secret template-repository) or use another means to generate a new random string of the same length as the one in application.conf.
Other security considerations
- Do not open the Play! Framework port of the template-repository to the Internet
- See http://www.playframework.org/documentation/1.2.4/secure for more security information
If the template-repository has been configured to use OpenID, log in using your google login.
The main screen of the template-repository contains a menu for access to template-repository functions and lists the available templates. Click to enlarge the image below.
The top menu provides the following functions.
On the left side of the screen:
- Title - a link to the /ovfindex.xml, the file containing an index of all the OVF packages added
- List - returns to the list of packages
- New - add a new virtual machine template definition to the template repository
- Search - search for a template definition using the text entered in the search box
If using OpenID, on the right side of the screen:
- Logout - log out of the template repository
The Package list is a list of all templates with the following information:
- Package name - a link to the package edit screen
- Disk file format - one of the Abiquo formats
- Category - classification, e.g. OS.
- Icon URL - link to icon image file on the Internet in jpeg, png or gif format
Ordering the Package List
Click any of the headings of the columns of the package list to order by that column. Click again to change between ascending and descending order.
Adding a New Template
Click New in the main menu to add a new package.
The following dialog will appear:
Select the disk file to upload or enter the URL for the disk file.
The following screen with the Product Description and System Requirements panels will appear. Enter the details in the Product Description and System Requirements panels for the fields as described in the tables below.
After completing these forms, click "Create Template".
Template-repository will use diskid to determine the virtual disk file size.
DiskId is accessed at a IP public address http://diskid.frameos.org/?format=json
If the template repository cannot access this service, follow the instructions in the git rubiojr/diskid repository to start the webservice (based on qemu_img).
A new Virtual Disk File panel will appear at the bottom of the screen for you to confirm the virtual disk file details.
Virtual Disk File
Confirm the virtual disk file details.
Save or Delete a Template
Editing a Template
To edit a template, click the template name in the template list.
The edit screen will appear with three edit panels.
These edit panels are the same as those for adding a template: Product Description, System Requirements, Virtual Disk File. The buttons also work in the same way.
The fields and buttons are the same as the ones described above
Downloading a Virtual Disk File
From the Edit screen, go to the Virtual Disk File panel and click the blue Download button beside the Path field to download the virtual disk file to your system.
Downloading a .ovf File
On the Edit screen, go to the Virtual Disk File panel and click the Download OVF button near the Path field to download the virtual disk file to your system.
Searching for a Template
Enter text in the search box to find templates with that text in the template details fields.
For example, the image below shows a search for "win". The result includes several Windows templates and a template without Windows in the name but included in the category Windows.