Image Template¶
This page describes how to define a new image template. An image template follows the same syntax as the VM template.
Warning
Some template attributes 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. In the following tables, default attributes are marked with *
. For the complete list, see the Restricted Attributes section.
Important
The vCenter driver is a legacy component, and no longer receives updates or bug fixes.
Template Attributes¶
The following attributes can be defined in the template:
Attribute |
KVM |
vCenter |
Value |
Description |
---|---|---|---|---|
|
Mandatory |
Mandatory |
Any string |
Name that the Image will get. Every image must have a unique name. |
|
Optional |
Optional |
Any string |
Human readable description of the image for other users. |
|
Optional |
Optional |
|
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) |
|
Optional |
Optional |
|
Persistence of the image. If omitted, the default value is |
PERSISTENT_TYPE |
Optional
|
-
|
IMMUTABLE , SHAREABLE |
IMMUTABLE - An special persistent image, that will not be modified.SHAREABLE - Persistent image shareable by multiple VMs. Requires raw image FORMAT and shared datastore. Virtualization driver needs SUPPORT_SHAREABLE = "yes" This attribute should only be used for special storage configurations.
|
|
Optional |
Optional |
Any string e.g |
Prefix for the emulated device this image will be mounted at. For instance, |
|
Optional |
- |
Any string |
Target for the emulated device this image will be mounted at. For instance, |
|
Optional |
- |
|
Format of the image backing file. |
|
Optional |
- |
File system name (e.g ext4, xfs, …) |
Specific file system type. It is used for formatting datablocks and volatile disks. |
|
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 |
|
Mandatory (if no PATH) |
Mandatory (if no PATH) |
Any string |
Source to be used in the DISK attribute. Useful for not file-based images. |
|
Optional |
Optional |
For KVM: |
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.
|
|
- |
Optional |
vCenter: Possible values (careful with the case): |
Type of controller to be used with this disk. More information in the VMware documentation |
|
Optional |
- |
|
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 |
|
Optional |
Optional |
An MD5 hash |
MD5 hash to check for image integrity. |
|
Optional |
Optional |
An SHA1 hash |
SHA1 hash to check for image integrity. |
|
Optional |
Optional |
UUID value |
This attribute needs to be set for LUKS-encrypted images. Its value is UUID registered on hypervisor nodes as an identifier for the LUKS secret. |
|
- |
Optional |
|
vCenter: This attribute is set to |
Warning
Be careful when PATH
points to a compressed bz2 image, since although it will work, OpenNebula will not calculate its size correctly.
Important
All of the above KVM attributes also apply to LXC, with the exception of DEV_PREFIX
and TARGET
.
Mandatory attributes for DATABLOCK
images with no PATH
set:
Attribute |
Value |
Description |
---|---|---|
|
An integer |
Size in MB. |
Template Examples¶
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."
Restricted Attributes¶
All the default restricted attributes to users in the oneadmin group are summarized in the following list:
SOURCE
VCENTER_IMPORTED
These attributes can be configured in oned.conf.