Run keepalive in a dedicated thread

Periodic tasks are not concurrent, they run one after the other in
a single greenthread so if a periodic tasks take a long time to run
(e.g syncing the power state of the devices) the conductor will miss the
keepalive and will be considered dead even tho it's not. This commit is
adding the keepalive to a dedicated greenthread to avoid such problem.

Partial-Bug: #1308680
Change-Id: Ib4159e55a42f268c75f362180e145e637735c16d
Remove 'node' parameter from the Deploy interface

The node parameter is redundant since the node object is an attribute
of the task object.

In the PXE driver, the helper functions _create_token_file,
_remove_internal_attrs, _update_neutron and _create_pxe_config were also
updated removing the 'node' parameter from the function definition.

Partial-Bug: #1312632
Change-Id: I82b3078c00cdf6e417c3f379bf03f1c5cae533d7
Fix chassis bookmark link url

Fix the chassis bookmark link url and modify the validate_link() at
tests/api/base.py to enable it to validate bookmark links. The tests on
all the resources were also updated to check if the bookmark link was
generated correctly.

Closes-Bug: #1304564
Change-Id: I8383dd1d48569dadbbafb4587c89973f8440b396
Add parallel_image_downloads option

Updates the Ironic image_cache module so that we
use a new parallel_image_downloads (False by default)
option to control whether images are downloaded
and converted to raw format in parallel.

This option helps resolve IO thrashing issues which
can occur on small seed VMs (or small baremetal nodes)
where parallel image downloads and qemu-img conversions
can cause cryptic deployment failures in ironic-conductor.

Change-Id: Id1a63d22cdfd26e9360fdfd747162f549f95da33
Closes-bug: #1322676
Merge "Run keepalive in a dedicated thread"
Merge "Fix chassis bookmark link url"
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 a68508d50d76e27dab9f569fb8aa0eedc245b1c1)
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 f8a1aa510618c2a9078e1572817c1b1b2f7d9eb7)
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 849036cd1df9cbcbd32bd7f8f96ec21e9035c99e)
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 327d32726dbc1d9a1ee97315a66210f76c8123f8)