wait_for_server_status(): report original request ID if failure

If waiting for a server to reach a particular status fails - for
example, a server never reaches ACTIVE after boot - the most useful
piece of information when debugging the failure is the orignal request
ID - in our example, the request ID of the original POST /servers
request.

This patch makes create_server() remember the original server boot
request ID, and wires that value up into wait_for_server_status(), so
that the latter can log it if the wait fails.

Because we have to remain compatible with calls to
wait_for_server_status() that do not pass a request_id, there's some
conditional logic to only log it if it was passed in.

Similar mechanics can, in the future, be added to other areas where
tests can fail, for example for live migration or resizing, or
attaching a port to an server.

Change-Id: I3d5aa41d96f7fa4fc860ed9d1076a247d5fa7bf6
2 files changed