...
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 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
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 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
Note | ||
---|---|---|
| ||
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. |
...
Info |
---|
This page describes how to import templates into the Abiquo catalogue using a manual upload. To use easier methods, such as OVA upload in the UI, see Add VM templates to the catalogue. For API download, see Appliance manager template API upload and download. |
...
Manually upload VM template files
In a manual upload, you copy the template files directly to the NFS repository. You can unzip an OVA file to obtain the template files, which are virtual disk file(s) and an OVF definition. See Export an OVA from ESXi vSphere 7 with OVF tool.
Info |
---|
Manual upload requires access to the NFS file system. |
Abiquo reads the OVF to obtain the template details, such as operating system, disk capacity, and the name and description (from the product section of the OVF). See OVF reference and Guest operating system definition for VMware.
To upload VM templates to the Abiquo Platform, the manual process consists of do these steps:.
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. |
VM Template files must be copied to the Abiquo NFS repository.
Copy the file(s) to the Abiquo NFS repository
...
Go the
/opt/vm_repository
folder. Here there should be folders for each enterprise in AbiquoOpen the folder for your enterprise ID. See How to find the enterprise that owns a template
Create a separate directory for each OVF Package
...
.
...
Copy the disk files (e.g.
.vmdk
,.vdi
...) and the
...
OVF descriptor document (
.ovf
)
...
. We recommend that you use the same base name for the system disk and the OVF file. For example:
Code Block /opt/vm_repository/{
...
ID_ENTERPRISE}/{
...
MY_FOLDER}/myVMTemplate.vmdk /opt/vm_repository/{
...
ID_ENTERPRISE}/{
...
MY_FOLDER}/myVMTemplate_HardDisk.vhd /opt/vm_repository/{
...
ID_ENTERPRISE}/{
...
MY_FOLDER}/myVMTemplate.ovf
...
In Abiquo, go to the Catalogue view for Private cloud, and click the round-arrow refresh button next to your datacenter name.
When you refresh the Catalogue, Abiquo will detect the disk files in the NFS repository folders and match them with the OVF description.
Info |
---|
Abiquo will convert valid disks to compatible formats for all the installed hypervisors. If there are no hypervisors, the platform will convert the disks to all formats. |
The templates will appear in the Catalogue view and as soon the conversion files are ready, they will be ready to deploy.
...
Manual upload example
In this example we will upload images to the default enterprise repository for Abiquo.
Copy the files to the NFS repository
Go to
/opt/vm_repository
The
Abiquo
...
enterprise ID is
1
, so
...
we will open the folder
1
, which is/opt/vm_repository/1
.Create a separate directory for
...
class | verysmallcode widecode |
---|
...
the template, which in this case is
ubuntu_server
Code Block $ mkdir ubuntu-server $ cd ubuntu-server
...
Copy the system disk file, an extra disk, and the OVF descriptor
Code Block $ 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.
...
class | verysmallcode widecode |
---|
...
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.
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.
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:
Code Block |
---|
# mkdir /opt/abiquo/tomcat/webapps/icons
# service abiquo-tomcat restart
|
Upload icons from your local machine to the Abiquo Server
Info |
---|
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:
Code Block |
---|
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:
Div | ||
---|---|---|
| ||
|
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 |
---|
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:
Code Block |
---|
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.
...
Log in to Abiquo and refresh the Catalogue for your datacenter.
Your VM template should now be available in the Catalogue.
...
Manually upload an extra disk to an existing template
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.
...
Create an OVF descriptor if necessary
Abiquo recommends that you always use an automatically generated OVF descriptor, and it is easy to export one from vCenter, for example. See Export an OVA from ESXi vSphere 7 with OVF tool
However, if you are feeling lucky, you can create one following these instructions.
Copy a sample Abiquo OVF file, such as the Example OVF Descriptor in OVF referenceor copy one from a valid template. Save the OVF file with the image file name and
.ovf
extension.Edit the OVF file according to the guidelines in the OVF for Abiquo section of OVF reference.
Remember that you must enter the disk size. See Determine the size of a VM disk file
...
Related links
For details of how to use the Appliance manager to download a template from your filesystem to the Abiquo catalogue, see Appliance manager template API upload and download.
For details of how to replace a template disk, see https://abiquo.atlassian.net/wiki/spaces/doc/pages/311378488/Modify+VM+template+disks#Replace-a-template-disk,
...