Decouple state inspection and availability check

The state of a node should only be considered when calculating
resources, not when determining availability.  This makes the driver
consider any node that exists in the node inventory as available, and
take into account its state when determining available resources. All nodes
will be presented to Nova, but those that are in maintenence mode, have no
power state or have an error power state will present zero resources.

Closes-Bug: #1309048
Change-Id: Ia78294ac5d39955dac99d3d773751e8f7538a74d
Stop creating a swap partition when none was specified

Formerly, when the Nova flavor specified no swap partition, Ironic would
still create a 1mb swap partition to avoid certain issues. Those have
been fixed in previous patches. This patch corrects the behavior such
that Ironic will only create a swap partition when one is requested.

Closes-Bug: #1273785
Change-Id: I6f1c2de3fc1128fd92911fa5ffc737eb20a17409
Place root partition last so that it can always be expanded

Make the partitioning layout consistent by having the root partition
always be the last partition. This enables tools like cloud-init's
growroot utility to expand the root partition until the end of the disk,
regardless of the presence of a swap or ephemeral partition. In the
case where there is neither a swap nor ephemeral partition, the root
partition is the only partition created.

Closes-Bug: #1313606
Change-Id: I82492eb50530adc1f31e934f15f5c67462819a71
Merge "Decouple state inspection and availability check"
Merge "Stop creating a swap partition when none was specified"
Merge "Place root partition last so that it can always be expanded"
RPC_API_VERSION out of sync

This sets the RPC_API_VERSION for the conductor manager to be 1.15,
which is the same as the version on the API/client side.

A unit test was added to check that the RPC_API_VERSIONs are equal.

Comments in rpcapi.py and manager.py were added to remind readers
that the versions need to be in sync.

Change-Id: I047603d2d1117399978e98b9a93c9c32f512bbf1
Closes-Bug: #1317202
Factoring out PXE and TFTP functions

Multiple drivers need to support neutron and Ironic's PXE and TFTP
server. Factoring them out into a common file will make that
transition possible. I've moved all the generic calls into neutron
and reconfigured the PXE driver to work with the new functions.

Change-Id: I181ffabe673636b628329592e623e6425da54d6d
(cherry picked from commit 01b9276be6d81080bf779d035630c9604386a144)
Adding a reference driver for the agent

This driver handles communication with the Ironic Python Agent's REST
API and controls the agent through the deploy and tear down process.
It utilizes the nodeless vendor driver passthru to communicate with
newly booted agents. Things not included yet are support for
Neutron, agent registration/discovery, and writing an image to the
drive before deploy is called.

The original source for this driver was on GitHub. For history,
check: https://github.com/rackerlabs/ironic-teeth-driver

Depends on:
https://review.openstack.org/#/c/81391/
https://review.openstack.org/#/c/81919/

Implements: blueprint agent-driver
Change-Id: Ic6ad8703304af3041c48e9ade32eccbffa78ec9c
(cherry picked from commit ece8a1c811217044bba459d7f4874105f7477c32)
Drivers determine acceptable power states

The list of acceptable power states for a Node to be in when Nova is
calling deploy, update, and destroy were set globally.
This patch allows the deploy drivers to determine
which states are acceptable for each. I added a new validate
method to the DeployInterface class that can be overriden if
a driver determines it needs different settings (such as the agent
driver). The current function provides sane defaults and the
same behavior as before for any driver not overriding the function.

Change-Id: Iefec4396c323d9746bb0ee84b015765a4adbb476
Closes-Bug: 1306202
(cherry picked from commit fae1c205b0e66fb28fdbe5c6d38c482cf6deb1b2)
Adding swift temp url support

This patch will allow properly configured Glance servers to return a temporary
URL for an object hosted on Swift. It will require Glance to use Swift
as its backend. A temporary URL will let the agent download an image from
Glance without requiring an auth_token, which gives access more than just
Glance. The easiest way to use it is to enable direct_url in Glance, but
you can set the appropriate config options to avoid needing to enable it.

We/I need to add a note in the docs about Swift being a possible dependency
for Ironic deploys using IPA, along with how to set the Temp URL key.

Swift perfomance concerns will be addressed in this blueprint:
https://blueprints.launchpad.net/ironic/+spec/improve-swift-agent-downloads

SecurityImpact
DocImpact

Implements: blueprint swift-temp-urls
Change-Id: I10e4784eee63e8edc9ba30a9c5004a08aa3a6d8e
(cherry picked from commit 7fb05fa546c2c51e70d50a54dfc0e1cfe9275d92)