Image Definition Template 4.0

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.

inlinetoc

Template Attributes

The following attributes can be defined in the template.

Attribute M / O Value Description
NAME Mandatory Any string Name that the Image will get. Every image must have a unique name.
DESCRIPTION Optional Any string Human readable description of the image for other users.
TYPE Optional OS, CDROM, DATABLOCK, KERNEL, RAMDISK, CONTEXT 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).
PERSISTENT Optional YES, NO Persistence of the image. If omitted, the default value is NO.
PERSISTENT_TYPE Optional IMMUTABLE An special persistent image, that will not be modified. This attribute should only be used for special storage configurations.
DEV_PREFIX Optional Any string Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”, or “vd” for KVM virtio. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).
TARGET Optional Any string Target for the emulated device this image will be mounted at. For instance, “hdb”, “sdc”. If omitted, it will be assigned automatically.
DRIVER Optional KVM: raw, qcow2 Xen:tap:aio:, file: Specific image mapping driver. VMware is unsupported
PATH 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.
SOURCE* Mandatory (if no PATH) Any string Source to be used in the DISK attribute. Useful for not file-based images.
DISK_TYPE OptionalBLOCK, CDROM or FILE (default). This is the type of the supporting media for the image: a block device (BLOCK) an ISO-9660 file or readonly block device (CDROM) or a plain file (FILE).
READONLY Optional YES, NO. 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 CDROM and those with PERSISTENT_TYPE set to IMMUTABLE will have READONLY set to YES. Otherwise, by default it is set to NO.

Mandatory attributes for DATABLOCK images with no PATH set:

Attribute Value Description
SIZE An integer Size in MB.
FSTYPE String Type of file system to be built: ext2, ext3, ext4, ntfs, reiserfs, jfs, swap, qcow2. Any other fs supported by mkfs will work if no special option is needed. Use raw to not to format the new image. For VMware datastores (vmware or vmfs), the raw value is the only acceptable one (any other value in these datastores will be neglected and the disk will be created raw)

Template Examples

Example of an OS image: <xterm> 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.” </xterm>

Example of a CDROM image: <xterm> 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.” </xterm>

Example of a DATABLOCK image: <xterm> NAME = “Experiment results” TYPE = DATABLOCK # No PATH set, this image will start as a new empty disk SIZE = 3.08 FSTYPE = ext3 DESCRIPTION = “Storage for my Thesis experiments.” </xterm>

Restricted Attributes

All the default restricted attributes to users in the oneadmin group are summarized in the following list:

  • SOURCE