Refactor work with TaskLog in sqlalchemy.api

Add _task_log_get_query() private method
It is used to remove from task_log_get() and task_log_get_all() session.
parametr and save performance.

task_log_get() method
Remove session parameter from public method.

task_log_get_all() method
Remove session parameter from public method.

task_log_begin_task()
Remove session parameter from public method.
Remove unused return value.

task_log_end_task()
Remove session parameter from public method.
Use 1 db request instead of 2.
Remove unused return value.

blueprint db-session-cleanup

Change-Id: I2c8252de7978e8fddd800e903f18a73ee9a95034
Remove baremetal-compute-pxe.filters

The baremetal PXE driver doesn't seem to run dnsmasq at all, so remove
the rootwrap filter which allows it to do so. This was introduced by
commit a2f260f.

Change-Id: I4cc1127222b73af218a6a8808d0ad54478878af1
Validated device_name value in block device map

1. Checked value of device_name parameter provided in block device
mapping section of Create server API.
2. Added unit test coverage.

Fixes LP: #1087165

Change-Id: I32ed59a577167d9bf42cb3667bfb1ba3963d6c71
Implement Quantum support for addition and removal of fixed IPs

Fixes bug 1099378

Change-Id: I696d1f702cf99ef15af47c261844febd8a6e7ffc
use postgresql INET datatype for storing IPs

Change-Id: I9a61ffbececc6534b1a9c52e1fa29370db0e12ca
Fix nova.availability_zones docstring

Change-Id: I66fe5cd5ab688bd4d3bedcdb79823497c65912e9
sync latest log and lockutils from oslo

Change-Id: I2aa0e63a7e9c3b7bea829fddf42a00d3318c6d6f
Clean up get_instance_id_by_floating_address

Reduce number of nova.db calls in get_instance_id_by_floating_address
to 1, fixed_ip_get_by_floating_address (A new nova.db.api function)

Change-Id: Ie1313ea73290ae11dce03d3726d5c23e4d73cb00
Reduce number of iptable-save restore loops

Instead of running iptables-save and iptables-restore per table,
run iptables save and restore on all tables at once.

Change-Id: If610d07c22ddaeb03ab37ee64d3d3a55d5e5b34f
Make nova-api logs more useful

The current logs make it hard to identify what API command is actually
being called, especially for POST, where the action is in the body.

* Whenever there is body, log it (info level)
* Log what function the API command maps to (debug level)

Change-Id: Ief14186b94e321d97575ee25e3507d3fc0178de6
Create ports in quantum matching hypervisor MAC addresses.

When hypervisors supply a set of MAC addresses for instances, the
network driver is responsible for matching up the requested MACs and
the available (or requested) networks.

The simplest case, which this patch addresses, is to create ports in
quantum on the desired networks, rather than having quantum create
them dynamically with dynamically created MAC addresses.

Change-Id: I84cd96671b76b8beaa31436c8a438f7818ef622f
Pull NovaWebSocketProxy class out of nova-novncproxy binary

To allow sharing of proxy code between nova-novncproxy and
nova-spicehtml5proxy, pull the NovaWebSocketProxy class
out of nova-novncproxy into a new nova/console/websocketproxy.py
file

Adds previously missing websockify dep to pip-requires.

Blueprint: libvirt-spice
Change-Id: If1334256680e7075598f00ce153cf6f021cc720f
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add nova-spicehtml5proxy helper

Add nova-spicehtml5proxy which provides a websockets proxy,
equivalent to nova-novncproxy

Blueprint: libvirt-spice
Change-Id: I48be78c97bb7dd6635fd4bba476ef22701418ba1
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add a get_spice_console method to nova.virt.ComputeDriver API

To mirror the existing get_vnc_console method, add a new
get_spice_console method to nova.virt.ComputeDriver API.

No attempt is made to wire this up to the RPC API, since at
this time there is no equivalent of novnc or xvpvncproxy to
use with SPICE.

Blueprint: libvirt-spice
Change-Id: I4cf12074b240d6882e46a81783cf20a3d97d4b2a
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Expose a get_spice_console RPC API method

To mirror the existing get_vnc_console RPC API method, expose a
new get_spice_console RPC API method. The only console type
supported currently is 'spice-html5' which is equivalent to
'novnc'

Blueprint: libvirt-spice
Change-Id: Iab9d3dfc3564a122a8cd2b53d34fdcc725bfa29b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add encryption method using an ssh public key.

This is a prerequisite for adding support to xenapi with
a guest agent to support the get-password command.

Related to blueprint get-password

Change-Id: I226ea5ee4fd6e326ccbb39cdf9098925d3f45312
Save password set through xen agent.

The get-password extension expects an encrypted b64 encoded password.
If we are setting the password via a guest agent and the user has
provided a public key, then we can go ahead and encrypt the password
and write it to metadata. If the guest agent is not working or not
installed, we leave the encrypted password to be set by posting to the
metadata server.

Related to blueprint get-password

Change-Id: I3ed26c7e1929f3c4c84f9bb87b0c620ab27223cb
Correcting improper use of the word 'an'.

Change-Id: I032509539c61f2f5fda2001e2db5a3298e30c561
correcting for proper use of the word 'an'.

Change-Id: Ib6180284d806a00c520df378e651fba947e2397a
Move compute node operations to conductor

This adds the following operations to conductor:

  compute_node_create()
  compute_node_update()

It also makes resource_tracker use them instead of making direct
calls to the database.

Further, it introduces a convert_datetimes() helper to the db api,
which can be used internally to convert ISO time strings back to
datetimes, so that we're getting them over the RPC wire. This
should be used in other places in the future to fix similar
situations and avoid one-off conversions in random places.

This removes the last direct database call from resource tracker,
and thus the db import.

Related to blueprint no-db-compute

Change-Id: I49c0bb30e7dd46d6f68550ebb644381961a0867f