Make sync_power_states yield

The sync_power_states periodic task can run for a long time, so it needs
to yield to other greenthreads. Adding yielding increases the chances
for race conditions, however.

So for every node returned from get_nodeinfo_list, we re-fetch and check
the states again, because they may have changed. Also, check the states
yet again after acquiring a lock. This can be fixed at some point by
allowing constraints to be passed when acquiring a lock. I've noted
this with a FIXME.

Also, when querying the Node, use the integer ID instead of the UUID,
because it's slightly more efficient.

Change-Id: Ie4d3f896e32b58378bfeb5ff457a9bfe6a8d065f
Merge "Add DiskPartitioner"
Update ironic.conf.sample

Update ironic.conf.sample due to changes in keystoneclient

Change-Id: I387ed02c50532527c41d12964c212b0cd9201fad
cleanup docstring for drivers.utils.get_node_mac_addresses

Change-Id: Id31ad06b2c44695d187138b32513b20120855302
Closes-Bug: 1306210
Remove hardcoded node id value

Change-Id: I9e4e74ce3a41e1cd3dd4e0d9ff1d1bde0656527f
Closes-Bug: 1306214
Better handling of missing drivers

Instead of loading all available drivers, this patch adds add a CONF
option for "enabled_drivers" which explicitly sets the expected drivers.
A failure to load an enabled driver will prevent the conductor service
from starting.

Use a callback hook in stevedore to capture and clean up import exceptions.
Third-party drivers are expected to use importutils to attempt to load
their external requirements, and when unable to, they should raise a
DriverNotFound error to tie into this hook.

Sets the default enabled drivers to:
- pxe_ssh
- pxe_ipmitool

tests/api/v1/test_ports was creating a ConductorManager instance
instead of appropriately mocking the conductor.rpcapi, which led to test
failures when changing how ConductorManager loads drivers. This patch
corrects this by properly mocking the rpcapi within that test class.

Change-Id: I2da37409cea98731a2ca18dfe7298861fde37783
Closes-bug: #1298529
Closes-bug: #1302562
Use DiskPartitioner

Use the new DiskPartitioner class to create the partition layout.

This commit also moves the sleep() workaround to avoid the "device is
busy" problem into the DiskPartitioner wrapper.

Change-Id: I28bb17c7ce2262d3088f58ab4421145e8d9baa1f
Closes-Bug: #1297925
Merge "Refactor sync_power_states tests to not use DB"
Merge "Make sync_power_states yield"
Merge "Use DiskPartitioner"
Add worker threads limit to _check_deploy_timeouts task

New nodes filter parameters added to db.sqlalchemy.api. This
parameters used in _check_deploy_timeouts periodic task for
limit of worker threads which can be started simultaneously.
New config option 'periodic_max_workers' added to conductor
group.

Closes-Bug: #1285793
Change-Id: I646540e334dec05682640c05cedb315e0ee355bc
Complete wrapping ironic client calls

This makes all ironic client calls use the new client wrapper that
encapsulates the retry logic.

Change-Id: I3dcbacee4c88704b8c2553a2f39cbcc32e8c306e
Closes-Bug: #1295870
Closes-Bug: #1307589
Modify the get console API

Changed the return value of the console GET api from string to
the following JSON object:
{'console_enabled': True, 'console_info': {'type': 'shellinaboxd',
   'url': 'http://<hostname>:<port>'}} for the node with console
enabled.
{'console_enabled': False, 'console_info': None} for the node
with console disabled.

Change-Id: I6c5818052e18ddfbcc148a18976ba5873b644039
Closes-Bug: 1307555
Implement list_instance_uuids() in Nova driver

This implements the list_instance_uuids() in the Nova
driver to help the compute manager more accurately track
instances running in an Ironic cluster.

Change-Id: I00978ea9622a2c15a6b2513bb11d695e7cab5572
nova.virt.ironic passes ephemeral_gb to ironic

Make the nova.virt.ironic driver pass the ephemeral_gb flavor spec, if
present, to Ironic via driver_info/pxe_ephemeral_gb. Will also forward
the CONF.default_ephemeral_format value to Ironic.

This patch also adds a default ephemeral format CONF option to
ironic.drivers.modules.pxe, just in case this isn't sent from Nova, eg.
because the config option has no default value.

Closes-bug: #1307726
Change-Id: I445965540c95db7a80c7f8da88e9d4218dcc8f01
Clean up calls to get_node()

This patch removes all direct calls to dbapi's get_node(). They are
replaced either by Node.get(), Node.get_by_id(), or Node.get_by_uuid()
calls.

Additional detail about the changes:

1) Break DBAPI get_node() into get_node_by_id() and get_node_by_uuid().
   Let's be explicit about which type we're passing. This allows
   Node.get_by_uuid() to work exactly how its named. Also, do not
   return an object from the DB API calls. The Node object itself will
   do the conversion.
2) Adds Node.get_by_id() to compliment the current Node.get_by_uuid()
   for places you are querying by the ID.
3) Adds Node.get() so that you can still have a single method to use
   to pass either and ID or a UUID.
4) Make all of the Node.get* calls set the 'context' so that you can
   later just node.save() without passing it. Doc strings have been
   updated to clarify what 'context' is for.

Change-Id: I995891b1645056a5b15c48e37b8bcd1e299ac468
Merge "Implement list_instance_uuids() in Nova driver"
Merge "Modify the get console API"
Document ClusteredComputeManager

Document the option needed to enable the ClusteredComputeManager in
nova.conf.

The commit a719472d added a custom compute manager to Ironic which
prevents some startups problem (e.g do not cause n-cpu to die at startup
if Ironic is not running yet) and workaround some frictions that we have
with Nova which assumes that each n-cpu is the only one responsible for
an instance (which is not true in the Ironic model).

Change-Id: I26bf5a1d3b634788044991e4524f64acf23bed9a
Merge "cleanup docstring for drivers.utils.get_node_mac_addresses"