Retry ssh connections on auth failure.

Some cloud instance types (Fedora for example) create
the ssh user after sshd comes online. This allows
our ssh connection retry loop to handle this scenario
gracefully.

Change-Id: Ie345dea50fc2983112cd2e72826a708583d2712a
Add fedora support

The previous loop iterating usernames doesn't work if another user is
added as we move onto the second username once ssh comes up and root
fails to run a command and then hit a timeout on the second user and
never attempt the 3rd.

Instead take an approach there we continue trying root until it either
works or ssh succeeds but a command can't be run. At this stage we can
try any other users that may be configured on the image, with a short
timeout (as we know ssh has come up, if it hadn't ssh'ing as root would
have timed out).

Change-Id: Id05aa186e8496d19f41d9c723260e2151deb45c9
Merge "Retry ssh connections on auth failure."
Merge "Add fedora support"
Roll up node stats

As the number of providers and targets grows, the number of stats
that graphite has to sum in order to produce the summary graphs that
we use grows.  Instead of asking graphite to summarize something like
400 metrics (takes about 3 seconds), have nodepool directly produce
the metrics that we are going to use.

Change-Id: I2a7403af2512ace0cbe795f2ec17ebcd9b90dd09
Keep py3.X compatibility for urllib/urllib2

Use six.moves.urllib instead of urllib and
six.moves.urllib.request instead of urllib2.

Partial-Bug: #1280105

Change-Id: Id122f7be5aa3e0dd213bfa86f9be86d10d72b4a6
Merge "Roll up node stats"
Raise min_demand due to slow node boot times

Booting a node takes up to 16 minutes, so keep more nodes in ready
state.

Change-Id: I0ae647c658feffabc499c96b0a9ed11855202c4b
Delete created keypairs if nova boot fails

If the server fails to boot (perhaps due to quota issues) during
an image update, if nodepool created a key for that server it won't
be deleted because the existing keypair delete is done as part of
deleting the server.  Handle the special case of never having
actually booted a server and delete the keypair explicitly in that
case.

Change-Id: I0607b77ef2d52cbb8a81feb5e9c502b080a51dbe
Set paramiko version > 1.9.0

Ubuntu 12.04 package version for paramiko is 1.7.7.1, which lacks
the additional arguments for exec_command:

  TypeError: exec_command() got an unexpected keyword argument 'get_pty'

1.10.0 was the first version to add get_pty flag.

Change-Id: I3b4d8a6d8a1d10ab002a79824feab8937d160244
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
Include provider names in timeout messages

Also, remove the extra "waiting for".

Change-Id: I5842daecb6b193eb5d6d2d2662dfab89ac8f7344
Depend on hacking for its dependencies.

flake8 does not pin its pep8 and pyflakes dependencies which makes it
possible for new sets of rules to suddenly apply whenever either of
those projects pushes a new release. Fix this by depending on hacking
instead of flake8, pep8, and pyflakes directly. This will keep nodepool
in sync with the rest of openstack even if it doesn't use the hacking
rules (H*).

Change-Id: Ice9198e9439ebcac15e76832835e78f72344425c
Merge "Include provider names in timeout messages"
Add SubNodes and the ability to delete them

There's no way to create subnodes yet.  But this change introduces
the class/table and a method to cleanly delete them if they exist.

The actual server deletion and the waiting for that to complete
are separated out in the provider manager, so that we can kick
off a bunch of subnode deletes and then wait for them all to
complete in one thread.

All existing calls to cleanupServer are augmented with a new
waitForServerDeletion call to handle the separation.

Change-Id: Iba9d5a0a61cccc07d914e60a24777c6451dca7ea
Add the ability to create subnodes

An image can specify that it should be created with a number of
subnodes.  That number of nodes of the same image type will also
be created and associated with each primary node of that image
type.

Adjust the allocator to accomodate the expected loss of capacity
associated with subnodes.

If a node has subnodes, wait until they are all in the ready state
before declaring a node ready.

Change-Id: Ia4b315b1ed2999da96aab60c5c02ea2ce7667494
Stop waiting for resources in ERROR state

As soon as a resource changes to the ERROR state, stop waiting for
it.  Return it to the caller, where it will be deleted.

Change-Id: I128bc4344b238b96e5696cce87f608fb2cdffa6e
Merge "Stop waiting for resources in ERROR state"
Merge "Raise min_demand due to slow node boot times"
Add 'labels' as a configuration primitive

Labels replace images as the basic identity for nodes.  Rather than
having nodes of a particular image, we now have nodes of a particular
label.  A label describes how a node is created from an image, which
providers can supply such nodes, and how many should be kept ready.

This makes configuration simpler (by not specifying which images
are associated with which targets and simply assuming an even
distribution, the target section is _much_ smaller and _much_ less
repetitive).  It also facilitates describing how a nodes of
potentially different configurations (e.g., number of subnodes) can
be created from the same image.

Change-Id: I35b80d6420676d405439cbeca49f4b0a6f8d3822
Fix image/label name typo in stats

Change-Id: Ibd75b0ef169d6a3cc2a1ebfbea54139dfa28dedc