/ganeti-os-nocloud

Primary LanguageShellGNU General Public License v3.0GPL-3.0

Synopsis

This is a fork of neicnordic's ganeti-os-nocloud .

Design differences

This provider seeks to create a "cloud-style" provisioning experience, relying on cloud-init as much as possible and avoiding Ganeti-specific features.

To that end, the provider:

Preparation

Clone the repo on your Ganeti host and copy the contents of the "os" directory into the Ganeti OS directory (which is /usr/share/ganeti/os if you installed via the Debian package).

Obtain cloud-init images for your guest Operating System. The image is expected to be in qcow2 format, but other formats supported by qemu-img can be selected by the OS variant definition.

Place the needed cloud-init images to /var/cache/ganeti-cloudimg and distribute them to all nodes. The expected file name of an image is specified in the corresponding configuration file found under /etc/ganeti/instance-nocloud/variants/. To add a missing OS variant, create the configuration file and add the name to /etc/ganeti/instance-nocloud/variants.list. The variant configuration supports the following variables:

  • IMAGE_FILE is the filename of the image. This option is required.
  • IMAGE_FORMAT is passed to the -f option of qemu-img, by default qcow2.
  • IMAGE_DIR is the directory where to look for images, by default /var/cache/ganeti-cloudimg.

Create a NoCloud data source using one of the methods described in the cloud-init documentation and place it on your Ganeti host.

VM Creation

Once the needed image is in place, the VM can be created by specifying nocloud+variant as the OS, where variant is one of /etc/ganeti/instance-nocloud/variants.list and data.iso is the NoCloud datasource:

gnt-instance add -o nocloud+${variant} \
-H cdrom_disk_type=ide,cdrom_image_path=${IMAGE_PATH}/data.iso,boot_order=disk \
vm.example.com

The cdrom_disk_type=ide config is necessary, because Ganeti will attempt to boot off the ISO file if you don't explicitly set this.

Known Issues/Caveats

This has only been tested on a single-node Ganeti cluster, and only with file-based storage. I plan on testing further as time permits, but it would be very much appreciated if you tested the code with other configurations.

Support for the vfat filesystem approach described in the cloud-init documentation is planned.