Store image disk_format and container_format

Store the disk_format and container_format image properties so that the
agent module can pick different image writing utilties based on the
image type that is downloaded

Change-Id: I1f4064a62995ecb8d1202c071f1153ce4e97fc4e
Improve hash ring value conversion

The current method for computing the point on the hash ring converts
the MD5 digest into a 4-byte integer (and assumes big-endian). The
digest is actually a 16-byte value, so we are eliminating much of
the value, thus increasing the possibility of hash collisions.

This patch does two things:

  * Removes the endianness assumption
  * Uses the full value of the digest to create a long integer,
    which has unlimited precision in Python.

Change-Id: I554ec46f506cb8cdfd5878c11a905a3acfe92db0
Add Node.maintenance_reason

When a node is maintenanced by Ironic or an operator, an operator
should know the reason for that. Add a string column to allow
Ironic or operators to enter a reason that the node is in
maintenance mode.

Implements: blueprint maintenance-reason

Change-Id: I7c77c92501e53f81704e9b9e5b52e0e2a410cc91
Add maintenance_reason when setting maintenance mode

Sets the reason for maintenance when the power status loop
automatically puts a node into maintenance mode.

Implements: blueprint maintenance-reason

Change-Id: If6c54d0eeb8b874fc9c59ef4f57fa812d78531b0
Removed hardcoded IDs from "node" test resources

Test resources are generated using certain helper methods to provide
key/value data. These methods hardcode ID fields which map to primary
key in the database. Subsequent creates on these resources force the
database to assign hardcoded primary keys, ignoring DB's internal
mechanisms. Though unlikely, this could lead to primary key conflicts.

This commit removes hardcoded IDs from node resources.

Change-Id: I29db29516a0a5bb00fa656c96c72636767d24bc6
Partial-Bug: #1268589
Add API endpoint to set/unset the node maintenance mode

This patch is adding an API endpoint to user set/unset the maintenance
mode of a node, since now we have an extra db field where operators can
specify the reason why the node was put in maintenance mode we should
make sure we clean this field as well once the node is removed from
maintenance mode, operations that requires extra actions as a consequence
of updating a attribute from a resource should have a separated endpoint
for it. Right now the endpoint is only updating the DB, but in the future
setting a node to maintenance mode should do more things like signalizing
Nova that the node is now in maintenance mode so that instances do not
gets scheduled onto it.

Implements: blueprint maintenance-reason
Change-Id: I1d4f609d248535064b9e3daeb67481d5b921aa7c
Iterate over glance API servers

The configuration option CONF.glance.glance_api_servers is meant to
be a list of Glance API servers, and should behave similar to its use
in Nova and Cinder: that each time a Glance API server is wanted, one
of the servers in the list is returned.

This changes CONF.glance.glance_api_servers to be a list instead of
a string. The list is randomly shuffled, and an iterator is
used to cycle through the list of servers.

This is backwards compatible and handles the case where the
user may have set [glance]/glance_api_servers = 'host:port' (or
'host1:port1, host2:port2'). The configuration library will
convert that to the corresponding list.

Closes-Bug: #1381135

Change-Id: Ic7cab502f38407aa0c282203804023dfa45b6623
Merge "Improve hash ring value conversion"
Merge "Add Node.maintenance_reason"
Updated from global requirements

Change-Id: I59c7219117374772ffc538463c12ed95251c61b3
Merge "Add API endpoint to set/unset the node maintenance mode"
Merge "Add maintenance_reason when setting maintenance mode"
Merge "Updated from global requirements"
Add maintenance to RESTful web API documentation

This adds [PUT|DELETE] v1/nodes/(node_uuid)/maintenance
to our RESTful web API documentation. It will show up at

http://docs.openstack.org/developer/ironic/webapi/v1.html#nodes

Change-Id: I42171e429ec72d270b51b246d7c8c6c38fed2e1e
Implements: blueprint maintenance-reason
Merge "Store image disk_format and container_format"
Merge "Removed hardcoded IDs from "node" test resources"
Updated from global requirements

Change-Id: I6fce8c7afe8abbd170461b42d0f07e85b79dffe4
Delete unused 'use_ipv6' config option

The 'use_ipv6' config option is not being used, and Ironic doesn't support
IPv6 (see https://bugs.launchpad.net/ironic/+bug/1325942). Someone may
try to set this value to True, and that wouldn't do anything, so it is
better to delete it and add it back in the future when IPv6 is supported.

I'm not sure it needs a DocImpact since it never worked, but I'll tag
it, just in case we want to document that "the 'use_ipv6' config option
was deleted because it never worked".

Closes-Bug: #1384509
DocImpact

Change-Id: I7704067ca50448ffb0982e653437d151af85471f
Merge "Delete unused 'use_ipv6' config option"
Get new auth token for ramdisk if old will expire soon

PXE driver prepares auth token for ramdisk, if this token near
expiration deploy will be fail. This patch modify PXE driver,
get new token from Keystone for this case. New function
token_expires_soon() added to keystone module.

Closes-Bug: #1377168
Change-Id: I215e2ec679b510152e2d140234594f7596e602af