...
class | tocc |
---|
Table of Contents |
---|
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 AbiquoYou can import templates into the Apps library using GUI upload, API download, manual upload of disk and OVF files, and template-repository.
GUI Upload
The easiest way to upload templates is with an OVA upload. 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
Info |
---|
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 in a compatible format (see Template Compatibility Table). Abiquo supports OVAs such as the ones exported from VMware.
If you don't have an OVA file, you can upload a single template disk (preferably the system disk) and then edit the template and add other disks. Abiquo will automatically generate the OVF descriptor for the disk file.
Abiquo will upload large files but a manual upload may be more convenient for these files. 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
...
Manual Upload
If your template files are very large, then you should use a manual upload to the VM repository filesystem. This method 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 manage it. Note that 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 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
...
title | Templates exported from VirtualBox with command line export |
---|
(Note: If using VirtualBox export from the command line
...
, check that there is a ''size'' attribute
...
for all the File elements in the References section
...
Manual Upload Process
). An OVF package should have a single virtual system but can contain multiple disks in a compatible format (see Template Compatibility Table). Abiquo recommends that you use an automatically generated OVF descriptor, but it is also possible to create one, as described here.
To upload VM templates to the Abiquo Platform, the manual process consists of do these steps:
Copy the file(s)
to the Abiquo NFS repository- Upload or create the OVF file that describes the uploaded VM template disk file(s)
- Refresh the Appliance Library view of the repository
Note |
---|
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
Note | ||
---|---|---|
| ||
Each VM template must have its own directory. The directory name is not important, but a directory must be created for each VM template. |
...
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
...
folders in the main repository
...
folder match the Enterprise
...
The general format is:
IDs from the Abiquo API. See EnterpriseResource
We recommend that you use the same base name for the system disk and the OVF file.Code Block /opt/vm_repository/{idEnterprise}/{myFolder}/myVMTemplate.vmdk /opt/vm_repository/{idEnterprise}/{myFolder}/myVMTemplate_HardDisk.vhd /opt/vm_repository/{idEnterprise}/{myFolder}/myVMTemplate.ovf
...
- Copy the
...
- disk files (e.g. .vmdk, .vdi ...) and the OVF descriptor document (.ovf)
Refresh the Appliance Library view of the repository
Expand title Click here to show/hide the screenshot In Apps library view, click the refresh button next to the name of your repository in the repository list.
When you refresh the Apps library, the platform will detect the vm_repository contents (and match them with the OVF description). The platform will convert valid disks to compatible formats for all the installed hypervisors. If there are no hypervisors installed, they will be converted to all formats. The templates will appear in the Apps library view and as soon the conversion files are ready, they will be ready to deploy.
Manually upload an extra disk
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.
Manual upload copy example
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.
...
verysmallcode widecode |
Code Block |
---|
$ 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.
...
verysmallcode widecode |
Code Block |
---|
$ scp username@10.10.10.10:/home/username/ubuntu_vxxx.ovf /opt/vm_repository/1/ubuntu-server/
|
Create
...
an 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.
...
Abiquo recommends that you always use an automatically generated OVF file but if you do no thave one, you can create one following these instructions.
- Copy the sample OVF file (OVF Reference#ExampleOVFDescriptor). Name the OVF file with the image file name and .ovf extension.
Code Block |
---|
$ 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.
Code Block |
---|
<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.
Code Block |
---|
<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
Code Block |
---|
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
Code Block |
---|
[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]#
|
Note | ||
---|---|---|
| ||
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.
Code Block |
---|
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.
- Remember that you need to enter the disk size. See Determine the size of a VM disk file
Upload VM Template Icons
This guide will explain
...
how to upload icons to your Abiquo Server and use them in the Appliance Library
...
. 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.
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:
Code Block # mkdir /opt/abiquo/tomcat/webapps/icons # service abiquo-tomcat restart
Upload icons from your local machine to the Abiquo Server
...
.
...
Place your icons in the directory you created on the Abiquo Server. To upload them from your local machine, run the following command:
Code Block user@mymachine:~$ scp <filename> root@<abiquo-server-ip>:/opt/abiquo/tomcat/webapps/icons/
Expand
...
For example,
...
using the Tux icon (By lewing@isc.tamu.edu Larry Ewing and The GIMP, Attribution, https://commons.wikimedia.org/w/index.php?curid=80930) called "Tux.png" and the Abiquo Server has the IP address of
...
"myabiquo.
...
example.com" so the command will look as follows:
...
...
Code Block user@mymachine:~$ scp
...
Tux.png
...
root@myabiquo.
...
example.
...
com:/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:
Code Block
...
https://
...
myabiquo.
...
example.
...
com/icons/
...
Tux.png
...
Add the
...
icons to the VM
...
templates. Log in to Abiquo and go to the
...
...
Apps library. Select the VM template that you want to change the icon of.
...
Select Edit.
Enter the URL of the template icon in the format "http://<abiquo-server-ip>/icons/<filename>", or the relative path. In our example this is:
Code Block
...
icons/
...
Tux.png
Then click Validate. You should now see the new image beneath the URL.
...
Click
...
Save to store the template with the new icon.
You're done. Now your virtual machine template has a new look!