Image Definition Template¶
This page describes how to define a new image template. An image template follows the same syntax as the VM template.
If you want to learn more about the image repository, you can do so here.
There are some template attributes that can compromise the security of the system or the security of other VMs, and can be used only by users in the oneadmin group. These attributes can be configured in oned.conf, the default ones are labeled with
* in the following tables. See the complete list in the Restricted Attributes section.
The following attributes can be defined in the template.
|NAME||Mandatory||Mandatory||Any string||Name that the Image will get. Every image must have a unique name.|
|DESCRIPTION||Optional||Optional||Any string||Human readable description of the image for other users.|
||Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).|
||Persistence of the image. If omitted, the default value is
||An special persistent image, that will not be modified. This attribute should only be used for special storage configurations.|
|DEV_PREFIX||Optional||Optional||Any string e.g sd, hd||Prefix for the emulated device this image will be mounted at. For instance,
|TARGET||Optional||-||Any string||Target for the emulated device this image will be mounted at. For instance,
||Specific image mapping driver.|
|PATH||Mandatory (if no SOURCE)||Mandatory (if no SOURCE)||Any string||Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created. Note that gzipped files are supported and OpenNebula will automatically decompress them. Bzip2 compressed files is also supported, but it’s strongly discouraged since OpenNebula will not calculate it’s size properly.|
|SOURCE*||Mandatory (if no PATH)||Mandatory (if no PATH)||Any string||Source to be used in the DISK attribute. Useful for not file-based images.|
||This is the type of the supporting media for the image: a block device (
|VCENTER_DISK_TYPE||-||Optional||vCenter: (careful with the case): delta,eagerZeroedThick,flatMonolithic,preallocated,raw,rdm,rdmp,seSparse,sparse2Gb,sparseMonolithic,thick,thick2Gb,thin||The type of disk has implications on performance and occupied space. Values (careful with the case): delta,eagerZeroedThick,flatMonolithic,preallocated,raw,rdm,rdmp,seSparse,sparse2Gb,sparseMonolithic,thick,thick2Gb,thin. More information in the VMware documentation.|
|VCENTER_ADAPTER_TYPE||-||Optional||vCenter: Possible values (careful with the case): lsiLogic, ide, busLogic.||Type of controller to be used with this disk. More information in the VMware documentation|
||This attribute should only be used for special storage configurations. It sets how the image is going to be exposed to the hypervisor. Images of type
|MD5||Optional||Optional||An md5 hash||MD5 hash to check for image integrity|
|SHA1||Optional||Optional||An sha1 hash||SHA1 hash to check for image integrity|
||vCenter: This attribute is set to YES automatically when an IMAGE has been imported e.g an imported template or Wild VM. If set to YES, OpenNebula won’t remove from vCenter this image when the image is deleted from OpenNebula|
Be careful when
PATH points to a compressed bz2 image, since although it will work, OpenNebula will not calculate its size correctly.
Mandatory attributes for
DATABLOCK images with no
|SIZE||An integer||Size in MB.|
Example of an OS image:
NAME = "Ubuntu Web Development" PATH = /home/one_user/images/ubuntu_desktop.img DESCRIPTION = "Ubuntu 10.04 desktop for Web Development students. Contains the pdf lessons and exercises as well as all the necessary programming tools and testing frameworks."
Example of a CDROM image:
NAME = "MATLAB install CD" TYPE = CDROM PATH = /home/one_user/images/matlab.iso DESCRIPTION = "Contains the MATLAB installation files. Mount it to install MATLAB on new OS images."
Example of a DATABLOCK image:
NAME = "Experiment results" TYPE = DATABLOCK # No PATH set, this image will start as a new empty disk SIZE = 3.08 DESCRIPTION = "Storage for my Thesis experiments."
All the default restricted attributes to users in the oneadmin group are summarized in the following list: