Installing the XenAPI Plugins
When using Xen as the hypervisor for OpenStack Compute, you
can install a Python script (usually, but it can be any
executable) on the host side, and then call that through the
XenAPI. These scripts are called plugins. The XenAPI plugins
live in the nova code repository. These plugins have to be
copied to the hypervisor's Dom0, to the appropriate directory,
where xapi can find them. There are several options for the
installation. The important thing is to ensure that the
version of the plugins are in line with the nova installation
by only installing plugins from a matching nova
repository.
Manual Installation
To manually install
Create temporary files/directories:
$ NOVA_ZIPBALL=$(mktemp)
$ NOVA_SOURCES=$(mktemp -d)
Get the source from github. The example assumes the master
branch is used. Amend the URL to match the version
being used:
$ wget -qO "$NOVA_ZIPBALL" https://github.com/openstack/nova/archive/master.zip
$ unzip "$NOVA_ZIPBALL" -d "$NOVA_SOURCES"(Alternatively)
Should you wish to use the official Ubuntu
packages, use the following commands to get the
nova code base:
$ ( cd $NOVA_SOURCES && apt-get source python-nova --download-only )
$ ( cd $NOVA_SOURCES && for ARCHIVE in *.tar.gz; do tar -xzf $ARCHIVE; done )
Copy the plugins to the hypervisor:
$ PLUGINPATH=$(find $NOVA_SOURCES -path '*/xapi.d/plugins' -type d -print)
$ tar -czf - -C "$PLUGINPATH" ./ | ssh root@xenserver tar -xozf - -C /etc/xapi.d/plugins/
Remove the temporary files/directories:
$ rm "$NOVA_ZIPBALL"
$ rm -rf "$NOVA_SOURCES"
Packaged Installation
Follow these steps to produce a supplemental
pack from the nova sources, and package it as a XenServer
supplemental pack.
To package a XenServer supplemental pack
Create RPM packages. Given you have
the nova sources (use one of the methods mentioned
at Manual Installation):
$ cd nova/plugins/xenserver/xenapi/contrib
$ ./build-rpm.shThese
commands leave an .rpm file in
the rpmbuild/RPMS/noarch/
directory.
Pack the RPM packages to a
Supplemental Pack, using the XenServer DDK (the
following command should be issued on the
XenServer DDK virtual appliance, after the
produced rpm file has been copied over):
$ /usr/bin/build-supplemental-pack.sh \
> --output=output_directory \
> --vendor-code=novaplugin \
> --vendor-name=openstack \
> --label=novaplugins \
> --text="nova plugins" \
> --version=0 \
> full_path_to_rpmfileThis
command produces an .iso file
in the output directory specified. Copy that file
to the hypervisor.
Install the Supplemental Pack. Log
in to the hypervisor, and issue:
# xe-install-supplemental-pack path_to_isofile