OpenNebula Linux VM Contextualization.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
Javi Fontan 37ce3c3e31
Init scripts for both one and ec2
9 years ago
base Move scripts for non ec2 machines to dir.one 9 years ago
base.one/etc/one-context.d Move scripts for non ec2 machines to dir.one 9 years ago
base_arch Fix one-contextd and deb/rpm init.d 9 years ago
base_deb/etc Init scripts for both one and ec2 9 years ago
base_deb.one/etc/one-context.d Init scripts for both one and ec2 9 years ago
base_rpm/etc/one-context.d Move scripts for non ec2 machines to dir.one 9 years ago
base_rpm.ec2/etc/init.d Init scripts for both one and ec2 9 years ago
base_rpm.one/etc Move scripts for non ec2 machines to dir.one 9 years ago
LICENSE Move context packages to its own repository 11 years ago
PKGBUILD Change cloud-utilz-bzr to mkinitcpio-growrootfs to reduce dependencies 9 years ago
README.md gh-9: update package information 10 years ago
generate.sh Move scripts for non ec2 machines to dir.one 9 years ago
one-context.install Remove Arch from postinstall and added PKGBUILD and one-context.install 9 years ago
postinstall Cleanup post install for pull request 9 years ago

README.md

Linux VM Contextualization

Description

These are the source of the contextualization packages used by VM to be configured with the information generated by OpenNebula.

Development

To contribute bug patches or new features, you can use the github Pull Request model. It is assumed that code and documentation are contributed under the Apache License 2.0.

More info:

Authors

Compatibility

This add-on is compatible with OpenNebula >= 4.6.

Requirements

  • Ruby >= 1.8.7
  • gem fpm
  • dpkg utils for deb package creation
  • rpm utils for rpm package creation

On Ubuntu/Debian you can install the package rpm and you will be able to generate both rpm and deb packages.

Use

Package Description

Here are located the files needed to generate OpenNebula contextualization packages. The packages generated contain these files:

  • /etc/udev/rules.d/* These files disable the udev network an cdrom generation
  • /etc/init.d/vmcontext This is the startup script that will try to mount context cdrom, load contextualizaton variables, call scripts in the contextualization scripts directory and call init.sh if it exists in the context cd.
  • /etc/one-context.d/* This directory holds the scripts that will be called by vmcontext script. They should be named starting with a number so they are called in order.

By default only the network configuration context script is included in the packages. These scripts are different for rpm and deb based distributions and are located in base_<deb|rpm> directories.

The packages also have a post-install script that does these steps:

  • Delete persistent cd and net rules from /etc/udev/rules.d
  • Links vmcontext script to /etc/rc.d
  • Deletes network configuration files

Package Generation

The script generator.sh generates both deb and rpm packages and can be configured to include more files in the package or change some of its parameters.

On start it creates a temporary directory and copies there:

  • base directory
  • base_<deb|rpm> directory
  • Any file or directory from the arguments.

Then these files are included in the package.

The default parameters to create a package are as follows:

VERSION=1.0.1
MAINTAINER=OpenNebula Systems <support@opennebula.systems>
LICENSE=Apache
PACKAGE_NAME=one-context
VENDOR=OpenNebula Systems
DESCRIPTION="
This package prepares a VM image for OpenNebula:
  * Disables udev net and cd persistent rules
  * Deletes udev net and cd persistent rules
  * Unconfigures the network
  * Adds OpenNebula contextualization scripts to startup

To get support use the OpenNebula mailing list:
  http://opennebula.org/community:mailinglists
"
PACKAGE_TYPE=deb
URL=http://opennebula.org

You can change any parameter setting an environment variable with the same name. For example, to generate an rpm package with a different package name:

$ PACKAGE_TYPE=rpm PACKAGE_NAME=my-context ./generate.sh

You can also include new files. This is handy to, for example, include new scripts executed to contextualize an image. For example, we can have an script that install a user ssh key. We will create the file hierarchy that will go inside the package in a directory:

$ mkdir -p ssh/etc/one-context.d
$ cp <our-ssh-script> ssh/etc/one-context.d/01-ssh-key
$ ./generate.sh ssh/etc

NOTE: The generator must be executed from the same directory it resides.