NIFTY - openNebula Image File synchronizaTion utilitY

NIFTY is a tool for uploading and registering cloud appliances in OpenNebula.

Build Status Dependency Status Gem Version Code Climate

What does NIFY do?

Basically NIFTY takes a prepared appliance (virtual machine) and its descriptor and automatically uploads, register and prepares template in OpenNebula. Virtual machine can be than easily instantiated. Furthermore, NIFTY can expire an appliance so users will no longer be able to use it (for example due to security reasons). Expired appliances are automatically cleaned after configured time period.

How does NIFTY work?

NIFTY cooperates with two other tools COMFY and ITCHY which can prepare an appliance with a correct descriptor. NIFTY then reads a descriptor and either registers or expires the appliance.

Requirements

  • Ruby >= 1.9.3
  • Rubygems

OpenNebula backend

  • OpenNebula >= 4.6 (doesn't have to be present on the same machine)

Installation

From distribution specific packages

Distribution specific packages can be created with omnibus packaging for NIFTY. When installing via packages you don't have to install neither ruby nor rubygems. Packages contain embedded ruby and all the necessary gems and libraries witch will not effect your system ruby, gems and libraries.

Currently supported distributions:

Ubuntu 12.04
Ubuntu 14.04
Debian 7.6
Debian 8.2
CentOS 6.5
CentOS 7.1

From RubyGems.org

To install the most recent stable version

gem install nifty

From source (dev)

Installation from source should never be your first choice! Especially, if you are not familiar with RVM, Bundler, Rake and other dev tools for Ruby!

However, if you wish to contribute to our project, this is the right way to start.

To build and install the bleeding edge version from master

git clone git://github.com/CESNET/nifty.git
cd nifty
gem install bundler
bundle install
bundle exec rake spec

Configuration

Create a configuration file for NIFTY

Configuration file can be read by NIFTY from these three locations:

  • ~/.nifty/nifty.yml
  • /etc/nifty/nifty.yml
  • PATH_TO_GEM_DIR/config/nifty.yml

The default configuration file can be found at the last location PATH_TO_GEM_DIR/config/nifty.yml.

Usage

NIFTY is run with executable nifty. For further assistance run nifty help:

$ nifty help

Commands:
  nifty backends                                                                                                                                           # Lists all available backends with their description
  nifty help [COMMAND]                                                                                                                                     # Describe available commands or one specific command
  nifty opennebula --api-call-timeout=API-CALL-TIMEOUT --expiration-interval=EXPIRATION-INTERVAL --permissions=PERMISSIONS -d, --datastores=one two three  # Runs NIFTY with backend opennebula
  nifty opennebula-migrate --api-call-timeout=API-CALL-TIMEOUT                                                                                             # Prepares "opennebula" for integration with NIFTY
  nifty opennebula-transfer-methods                                                                                                                        # Lists all available transfer methods with their description for "opennebula" backend
  nifty version                                                                                                                                            # Prints NIFTY's version

Options:
  -a, --appliance-dir=APPLIANCE-DIR                  # Directory from where appliance descriptors will be loaded
  -m, --transfer-method=TRANSFER-METHOD              # Transfer method for image upload
  -t, [--transfer-destination=TRANSFER-DESTINATION]  # Image upload destination
      --logging-level=LOGGING-LEVEL
      [--logging-file=LOGGING-FILE]                  # File to write log to
      [--debug], [--no-debug]                        # Runs nifty in debug mode

Backends

OpenNebula is currently the only supported backend for NIFTY. NIFTY can upload and register images and create VM templates in OpenNebula. Image and template generating mechanism can be customized by providing custom templates via --template-dir option. Default templates are situated in PATH_TO_GEM_DIR/config/templates directory. To list all options for Opennebula backend run nifty help opennebula:

$ nifty help opennebula

Usage:
  nifty opennebula --api-call-timeout=API-CALL-TIMEOUT --expiration-interval=EXPIRATION-INTERVAL --permissions=PERMISSIONS -d, --datastores=one two three

Options:
      [--secret=SECRET]                                  # Pair of username and password in form of 'username:password' for accessing OpenNebula
      [--endpoint=ENDPOINT]                              # OpenNebula's XML RPC endpoint
      --expiration-interval=EXPIRATION-INTERVAL          # How long should expired images be kept in OpenNebula befor removal, 0 means don't remove
      --api-call-timeout=API-CALL-TIMEOUT                # How long will NIFTY wait for image/template operations to finish in OpenNebula
  -d, --datastores=one two three                         # Names of OpenNebula datastores images will be uploaded to
      [--template-dir=TEMPLATE-DIR]                      # If set, templates within this directory are used to construct images and templates in OpenNebula
      [--description-naming], [--no-description-naming]  # If true, uses identifier and version from appliance description as template/image name instead of generated uuids
      [--disk-expiration], [--no-disk-expiration]        # Will expire old disks before the new one is registered
      --permissions=PERMISSIONS                          # UNIX-like image and template permissions in OpenNebula
      [--groups=one two three]                           # Names of groups appliances will be registred to in OpenNebula
  -a, --appliance-dir=APPLIANCE-DIR                      # Directory from where appliance descriptors will be loaded
  -m, --transfer-method=TRANSFER-METHOD                  # Transfer method for image upload
  -t, [--transfer-destination=TRANSFER-DESTINATION]      # Image upload destination
      --logging-level=LOGGING-LEVEL
      [--logging-file=LOGGING-FILE]                      # File to write log to
      [--debug], [--no-debug]                            # Runs nifty in debug mode

Transfer methods

NIFTY currently supports two transfer methods:

  • noop (no operation) - dummy transfer method, doesn't change image location
  • cp (copy) - creates an image copy in --transfer-destination directory

To list all available transfer methods for selected backend run nifty <BACKEND>-transfer-methods, for example nifty opennebula-transfer-methods.

Contributing

  1. Fork it ( https://github.com/CESNET/nifty/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request