Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

How to Import Templates into the Appliance Library

The options for importing templates are described below. They are:

  • Use GUI upload
  • Use Abiquo API download
  • Manually upload the virtual disk and OVF file
  • Use template-repository

Use the UI to Upload an OVA in the Abiquo Apps Library

Abiquo supports OVA upload for templates that are compatible with Abiquo. The OVA should have a single virtual system but can contain multiple disks.

See Add VM Templates to the Apps Library in the User's Guide.

Use the UI to Upload a VM Disk File into the Abiquo Appliance Library

The template UI upload process only supports a single disk per upload. To upload a template with multiple disks, first upload the system disk (or if it is not available, one of the other disks). Then edit the template and upload the remaining disks, checking that the template disks are in the correct sequence, with the system disk in position 0. 

For smaller VM disk files, using the GUI upload is recommended. Abiquo will generate the OVF descriptor for the disk file.

The browser performs a multi-part upload, but the HTTP protocol is still used, so there is no recovery of partially uploaded files.

See Add VM Templates to the Apps Library in the User's Guide.

Manually Upload a VM Template to the NFS Repository

Use manual upload for larger VM templates.

Manual Upload Prerequisites

Adding templates to the NFS Repository requires access to the NFS repository file system, so a system administrator should be responsible for this task.

You should be familiar with Appliance Library and VM Template Concepts

Abiquo VM Templates are OVF Packages and they consist of disk files and ovf descriptors.

You can use external tools to generate an OVF Package to be imported into Abiquo as a VM template. These tools include recent versions of VirtualBox and VMware vShpere.

Current OVF Package restrictions are:

  • Abiquo supports multiple disks in the OVF descriptions
  • Abiquo only supports a single system in the OVF descriptions

Templates exported from VirtualBox with command line export

VirtualBox export from the command line does not generate an OVF document compliant to the OVF xsd. The ''size'' attribute of all the File elements in the References section is missing, so you should add it to virtual machine templates exported with VBoxManage command line utility. The VirtualBox GUI correctly generates the ''size'' attribute.

Manual Upload Process

To upload VM templates to the Abiquo Platform, the manual process consists of these steps:

  1. Copy the file(s) to the Abiquo NFS repository
  2. Upload or create the OVF file that describes the uploaded VM template disk file(s)
  3. Refresh the Appliance Library view of the repository

You can manually upload a new disk to add to an existing template, but you must also add the disk to the OVF file for that template. When the appliance manager checks the file system, it will detect the new disk, but it will only add the disk to the Abiquo template if the disk is defined in the OVF file.

Copy the file(s) to the repository

VM Templates and Directories

Each VM template must have its own directory. The directory name is not important, but a directory must be created for each VM template.

VM Template files must be copied to the Abiquo NFS repository.

  • Create a separate directory for each OVF Package on the repository file system under the directory for your enterprise ID.
    The first level of directories in the repository matches the Enterprise ID. The default enterprise is Abiquo and the default enterprise ID is 1. For other enterprises, you
    can determine your enterprise id using the API.
  • Copy the disk files (e.g. .vmdk, .vdi ...) and the ovf descriptor document (.ovf) if you have one; otherwise you must create the OVF descriptor document.

The general format is:

/opt/vm_repository/{idEnterprise}/{myFolder}/myVMTemplate.vmdk
/opt/vm_repository/{idEnterprise}/{myFolder}/myVMTemplate_HardDisk.vhd
/opt/vm_repository/{idEnterprise}/{myFolder}/myVMTemplate.ovf  

We recommend that you name the system disk and the OVF file with the same base name. In the above example, this base name is "myVMTemplate"

In this example we will upload images to the default enterprise repository. The Abiquo default enterprise ID is 1, so the working directory will be: /opt/vm_repository/1.
Create a separate directory for each template to be uploaded and copy it in (using SCP, for example). Here we copy the system disk file and an extra disk.

$ cd /opt/vm_repository/1/
$ mkdir ubuntu-server
$ cd ubuntu-server
$ scp username@10.10.10.10:/home/username/ubuntu_vxxx.vmdk /opt/vm_repository/1/ubuntu-server/

$ scp username@10.10.10.10:/home/username/ubuntu_vxxx_extra_disk.vmdk /opt/vm_repository/1/ubuntu-server/

If you have an OVF descriptor, copy it too.

$ scp username@10.10.10.10:/home/username/ubuntu_vxxx.ovf /opt/vm_repository/1/ubuntu-server/

Create the OVF descriptor if necessary

If you use the Template-Repository to upload your template, then the OVF Descriptor will be created automatically.

If you uploaded only the template disk file(s) directly to the repository, you must create the OVF file to describe the disk file(s). Otherwise, you can skip this step.

Create an OVF file with the image file name and .ovf extension.

$ touch ubuntu-910-server-X86_64-vmdk5.ovf
$ ls -lh
total 198M
-rw-r--r-- 1 root root 4.4K Aug 19 05:23 ubuntu-910-server-x86_64-vmdk5.ovf
-rwxr-xr-x 1 root root 198M Aug 19 05:27 ubuntu-910-server-x86_64-vmdk5.vmdk

-rwxr-xr-x 1 root root 128M Aug 19 05:29 ubuntu-910-server-x86_64-extra_disk-vmdk5.vmdk

Edit the OVF file according to the guidelines in OVF Reference#OVF for Abiquo.

Enter the deployed file size for each disk file

It is important you properly identify the deployed disk file size as the ovf:capacity in the OVF envelope.

    <Info>List of the virtual disks used in the package</Info>
    <Disk ovf:capacity="734003200" ovf:diskId="vmdisk1" ovf:fileRef="file1" ...

The ovf:capacity can be obtained using "VBoxManage showhdinfo" or using "diskid". See below - Importing Templates into the Appliance Library. You should enter the provisioned size.

Determining the Size of a VM Disk File

When working with virtual machine templates, it is important to know the correct size of every virtual machine disk file (both the system disk and auxiliary disks).

In Abiquo it is important you properly identify the ovf:capacity in the OVF envelope.

    <Info>List of the virtual disks used in the package</Info>
    <Disk ovf:capacity="734003200" ovf:diskId="vmdisk1" ovf:fileRef="file1" ...

This value will be used in the BPM conversion and persistent image creation process, so it would be best to set it to the right value.
If that is not possible, it can be updated later from the Appliance Library view by editing the template, selecting and editing the disk, and entering the Capacity. It is important to enter the correct value, because otherwise your virtual machine deploy might fail.

Use VBoxManage

The ovf:capacity can be obtained using the command

VBoxManage showhdinfo <disk file>

This will output most of the disk image data. We will retrieve the Logical Size field value.

For example, for CentOS

[root@localhost]# VBoxManage showhdinfo /root/VMs/CentOS-5-5-w-LAMP.vmdk 

UUID:                 0147718f-d8b4-4c53-8c82-877ce76f1d93
Accessible:           yes
Description:
Logical size:         51200 MBytes
Current size on disk: 2881 MBytes
Type:                 normal (base)
Storage format:       VMDK
Location:             /root/VMs/CentOS-5-5-w-LAMP.vmdk 
[root@localhost]#

Image formats

Remember that not all image formats are supported using this method.

Use diskid

Click here to download the diskid utility. diskid uses qemu-img to provide information about the hard disk file.
Follow the instructions in the disk id documentation to install the utility.

Example of using diskid to identify a disk file. When uploading the virtual machine template to Abiquo, enter the virtual_size in the Hard disk field of the upload form.

user@localhost:~/Downloads$ diskid Sugar_CRM-disk1.vmdk

file_name: Sugar_CRM-disk1.vmdk
format: vmdk
disk_size: 304M
variant: streamOptimized
virtual_size: 17G

Refresh the Repository in the Appliance Library view

In Appliance Library view, click the refresh button next to the name of your repository in the repository list.

When you refresh the Appliance Library, the vm_repository contents will be detected (and matched with the OVF description). Valid disks will be converted to compatible formats for all the installed hypervisors. If there are no hypervisors installed, they will be converted to all formats. These images will appear in the Appliance Library view and as soon the conversion files are ready, they will be ready for deployment.

How to Upload VM Template Icons

This guide will explain the steps to upload icons to your Abiquo Server and use them in the Appliance Library instead of using the ones from the remote repository.

Prerequisites

You will require root access to the Abiquo Server and the "Manage virtual machine templates from the appliance library" privilege in Abiquo. The Cloud Admin and Enterprise Admins have this privilege by default.

Create icons directory

On the Abiquo Server, create a new directory under webapps and restart tomcat:

# mkdir /opt/abiquo/tomcat/webapps/icons
# service abiquo-tomcat restart

Upload icons from your local machine to the Abiquo Server

Abiquo recommends that you use square icon images with a size of 128x128 pixels. A transparent background also makes icons look better. The compatible image formats are PNG, JPG and GIF.

Place your icons in the directory you created on the Abiquo Server. To upload them from your local machine, run the following command:

user@mymachine:~$ scp <filename> root@<abiquo-server-ip>:/opt/abiquo/tomcat/webapps/icons/

In this example, we will use a GRML icon called "grmllogo.png" and the Abiquo Server has the IP address of 10.10.10.1, so the command will look as follows:

user@mymachine:~$ scp grmllogo.png root@10.10.10.1:/opt/abiquo/tomcat/webapps/icons/

You can check if your icon is available by going to its web address in your browser. In our example, this will be:

http://10.10.10.1/icons/grmllogo.png

Add the icon to the VM template in the appliance library

Now log in to Abiquo and go to the Appliance Library. In our example, the GRML_test virtual machine template has the Abiquo default icon. 

Select the virtual machine template that you want to change the icon of. Click edit. In our example, we have edited the GRML_test template.

Enter the URL of the template icon in the format "http://<abiquo-server-ip>/icons/<filename>". In our example this is:

http://10.10.10.1/icons/grmllogo.png

Then click Validate. You should now see the new image beneath the URL.

Click Accept to save the new icon. 

You're done. Now your virtual machine template has a new look!

  • No labels