Image Repository 3.0

The image repository is the on in charge to store and manage registered images. You can get more information on its usage from a user perspective in the Managing Virtual Machine Images guide.

The way the image repository accomplishes these tasks is through a driver that knows how to perform these actions:

All these actions have an script associated that knows how to perform this. By default OpenNebula comes with a set of scripts that know how to store the images in the filesystem (we call this set of scripts fs).

Configuration

OpenNebula comes with the default (fs) image driver configured. In /etc/one/oned.conf these are the lines that load the driver:

IMAGE_MAD = [
    executable = "one_image",
    arguments  = "fs -t 15" ]

fs in the arguments tells the set of scripts to use and -t 15 is the number of threads that can run concurrently (the number of actions at the same time).

:!: Only one image driver can be loaded.

The place where the images will be stored can be changed also in /var/lib/one/remotes/image/fs/fsrc changing these variables:

if [ -z "${ONE_LOCATION}" ]; then
    export IMAGE_REPOSITORY_PATH=/var/lib/one/images
else
    export IMAGE_REPOSITORY_PATH=$ONE_LOCATION/var/images
fi

Other default values can be changed in /etc/one/oned.conf:

# Image Repository Configuration
#*******************************************************************************
#  DEFAULT_IMAGE_TYPE: This can take values
#       OS        Image file holding an operating system
#       CDROM     Image file holding a CDROM
#       DATABLOCK Image file holding a datablock,
#                 always created as an empty block
#  DEFAULT_DEVICE_PREFIX: This can be set to
#       hd        IDE prefix
#       sd        SCSI
#       xvd       XEN Virtual Disk
#       vd        KVM virtual disk
#*******************************************************************************
DEFAULT_IMAGE_TYPE    = "OS"
DEFAULT_DEVICE_PREFIX = "hd"
  • DEFAULT_IMAGE_TYPE: this will be the type of image created if we don't specify this when creating it
  • DEFAULT_DEVICE_PREFIX: this variable will be used when generating the devices the images will be attached. You can change it to sd if you want to use SCSI devices or xvd to use xen devices.