Let VlanManager keep network's DNS settings.

Lost piece of https://review.openstack.org/14560

Change-Id: I0376767f66041e2647fc2319ab3b2a339cdf7a19
Fix getattr usage

Class 'object' has no '__getattr__' member as pylint pointed out.
Use the getattr function.

Change-Id: I38c6075ac477e2fe33870bed64b0e5e986175305
Removes unnecessary db query for instance type

The instance type information is already available in the instance
hash. This removes a db query and also reduces the likelyhood of a
race condtion where the instance type could change between the
point where boot API call was made and the request hits the compute
node.

blueprint no-db-compute

Change-Id: I8372a8c88049a8dacef86a7034c6df94c40c3001
Move host aggregate operations to VirtAPI

This patch moves the following virt driver host aggregate
operations to the VirtAPI:

  aggregate_get_by_host()
  aggregate_metadata_get()
  aggregate_metadata_add()
  aggregate_metadata_delete()

In the process, a bug was found in the xenapi/host.py code
that raises an AggregateHostNotFound error in such a way that
a KeyError is generated. This changes that behavior to raise
a NotFound instead, since the former expects you to already
know the aggregate_id, which we do not. This patch extends the
XenAPI host_maintenance_mode test to exercise this error path,
as well as the one where a host is not found within the returned
aggregate.

Related to bp/no-db-compute

Change-Id: I006665bfb27774d2eeb713b79c188ca53f6fb00b
Move security groups and firewall ops to VirtAPI

This patch moves the following network security-related
methods to VirtAPI:

  security_group_get_by_instance()
  security_group_rule_get_by_security_group()
  provider_fw_rule_get_all()

In order to make this change, the _provider_rules() method
of the FirewallDriver was changed from being a staticmethod
to a regular instance method. All uses of it were in the
context of an actual instance, so I saw no reason to keep
it static, which would have complicated the use of the VirtAPI
methods.

Related to bp:no-db-compute

Change-Id: I260c96b6aa4bbab694b74087f704b6405360b0bf
Add some xenapi Bittorrent tests

When the bittorrent support was added to the xenapi driver, no
tests were added. This patch adds a few, specifically around the
use of instance_system_metadata fetches from the database.

Change-Id: I165acd002e35e30c46fc60fc4de1ca6e07bb8845
Make instance_system_metadata load with instance

Right now, instance['system_metadata'] is demand-loaded at the
first use. This adds the necessary db fu to make it load at
instance_get_*() time.

Change-Id: Id29342fd34fe710b797b23558ef0fde8809231bc
Avoid unnecessary system_metadata db lookup

The bittorrent code in the xenapi driver added a specific database
query for the instance_system_metadata. This query is unnecessary,
as the system_metadata is available in the instance object itself.
This patch removes the queries and adds the small amount of
format translation required.

Change-Id: If72593289e18d2c45db8e782972eb9051e10d740
powervm: failed spawn should raise exception

fixes bug #1065295

On a failed spawn instance, we should run our cleanup on
the host and then re-raise the exception to inform
ComputeManager of a failure

Change-Id: Ia9ce8360117e94d10d53278d4c9a16931dea70f2
Add REST API support for list/enable/disable nova services

Implements one workitem of blueprint apis-for-nova-manage

This adds an extension that provides REST API for list/enable/
disable nova service. The interface ia accessed via

GET /v2/{tenant_id}/os-services
PUT /v2/{tenant_id}/os-services/enable
PUT /v2/{tenant_id}/os-services/disable

And the command:nova host-describe have implemented the functionality
of nova-manage service describe_resource. So we needn't add a REST
API for it.

DocImpact
Change-Id: I030a7e00b878d7931456e7e323db37b7c47fce48
Remove custom test assertions.

Now that we testtools, We can use stock testtools assert methods
instead of defining our own. As part of removing them, we add Matcher
classes to use in the testtools.assertThat method. testtools matchers can
be arbitrarily combined and chained, so give more flexibility than plain
asserts

Related to blueprint grizzly-testtools.

Change-Id: I26d1dbac8dc3c322eb55c96c48330c0e38636107
improve session handling around quotas

blueprint db-session-cleanup

Change-Id: I7606f69c0945b810deae098000717c7bcf96e77d
improve sessions for reservation

improve session handling for
  reservation_(get|destroy)

blueprint db-session-cleanup

Change-Id: I1b6e9a903ef8c3df7449201a2103dc720cdf0e31
improve session handling around virtual_interfaces

improve session handling around
 virtual_interface_(get|delete|delete_by_instance)

blueprint db-session-cleanup

Change-Id: I7ce5a5bb6f079d83d79c1f7ed00994af0af09f1e
Upgrade pylint version to 0.26.0

Upgrade pylint to reduce false positives in lintstack.

Change-Id: I10ab7a46c6a70daf9151f03cd9fea3c4851e6ebb
make libvirt with Xen more workable

- Xen creates it's own tap devices when using libvirt, unplugging in
  Nova is not necessary

- 'script' should be None for Xen using libvirt with Quantum Linux
  Bridge Agent

- live migration is not working because the libvirt method
  virConnectCompareCPU is not implemented for Xen

Change-Id: Ibb937f75763cb83691a056ca41e244e171499fbb
Merge "Removes unnecessary db query for instance type"
Move libvirt specific cgroups setup code out of nova.virt.disk.api

The nova.virt.disk.api module contains code that is generically
reusable for any hypervisor. Thus the 'bind' method should not
contain Libvirt LXC specific cgroups code

Change-Id: I919b74c2c4af8ba05b1005ea93d2164be69612ba
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Merge "Move host aggregate operations to VirtAPI"
Merge "Move security groups and firewall ops to VirtAPI"