<p>DevStack has a couple of plugin mechanisms to allow easily adding support for additional projects and features.</p>
<h3>Extras.d Hooks</h3>
<p>These relatively new hooks are an extension of the existing calls from <code>stack.sh</code> at the end of its run, plus <code>unstack.sh</code> and <code>clean.sh</code>. A number of the higher-layer projects are implemented in DevStack using this mechanism.</p>
<p>The script in <code>extras.d</code> is expected to be mostly a dispatcher to functions in a <code>lib/*</code> script. The scripts are named with a zero-padded two digits sequence number prefix to control the order that the scripts are called, and with a suffix of <code>.sh</code>. DevSack reserves for itself the sequence numbers 00 through 09 and 90 through 99.</p>
<p>Below is a template that shows handlers for the possible command-line arguments:</p>
<li><strong>source</strong> - Called by each script that utilizes <code>extras.d</code> hooks; this replaces directly sourcing the <code>lib/*</code> script.</li>
<li><strong>stack</strong> - Called by <code>stack.sh</code> three times for different phases of its run:
<li><strong>install</strong> - Called after the layer 1 and 2 projects source and their dependencies have been installed.</li>
<li><strong>post-config</strong> - Called after the layer 1 and 2 services have been configured. All configuration files for enabled services should exist at this point.</li>
<li><strong>extra</strong> - Called near the end after layer 1 and 2 services have been started. This is the existing hook and has not otherwise changed.</li>
</ul></li>
<li><strong>unstack</strong> - Called by <code>unstack.sh</code> before other services are shut down.</li>
<li><strong>clean</strong> - Called by <code>clean.sh</code> before other services are cleaned, but after <code>unstack.sh</code> has been called.
</ul></p>
<h3>Hypervisor</h3>
<p>Hypervisor plugins are fairly new and condense most hypervisor configuration into one place.</p>
<p>The initial plugin implemented was for Docker support and is a useful template for the required support. Plugins are placed in <code>lib/nova_plugins</code> and named <code>hypervisor-<name></code> where <code><name></code> is the value of <code>VIRT_DRIVER</code>. Plugins must define the following functions:</p>
<ul>
<li><code>install_nova_hypervisor</code> - install any external requirements</li>
<li><code>configure_nova_hypervisor</code> - make configuration changes, including those to other services</li>
<li><code>start_nova_hypervisor</code> - start any external services</li>
<li><code>stop_nova_hypervisor</code> - stop any external services</li>
<li><code>cleanup_nova_hypervisor</code> - remove transient data and cache</li>