Make update_service_capabilities() accept a list of capabilities

This makes it possible to send multiple capabilites by single RPC.

Change-Id: I7c1b75eada17181c4fe08c55992b34d66276f498
Remove unused bridge interfaces

If a network gateway of multi hosted network is unsed by any VM on the
host, we tear down it.
It is implemented only with the VLAN manager.

Fixes LP bug #1084651

Change-Id: Ia7e399de5b8ddf6ec252d38dfbb8762c4f14e3a5
Add vif_type to the VIF model

This is part of blueprint vif-plugging-improvements.

The patch has two parts:
1. Add support for vif_type to the VIF model
2. Read the vif_type from the Quantum port binding

The patch is backward compatible, that is, a quantum plugin
does not need to return the vif_type.

Change-Id: Ice772f00b22163da98b98a2c69a0a4ad3f5526ff
Use admin user to read Quantum port.

This is part of blueprint vif-plugging-improvements.

The port vif_type is only returned from Quantum when the user
is an admin user.

This patch ensures that when Nova reads the ports the user is an
admin user.

Change-Id: I4d1a2bfc6e3ae4ad63fe5c72eda32137713b31c6
Allows an instance to post encrypted password

Exposes a new url in openstack metadata with two methods:

GET 169.254.169.254/openstack/latest/password # get password
POST 169.254.169.254/openstack/latest/password # post password

The password can only be set once and will be stored in an
instance_system_metadata value with the key 'password'

Part of blueprint get-password

Change-Id: I4bbee8326a09fe38d6393e9e70f009daae0c6ece
Fix KeyError of log message in virt/libvirt/utils.py

Add arguments vg and lv for function check_size() so that locals() can get
them.

Fixes: bug #1088434

Change-Id: I6b5609fe1be7e0bf09a45e65eab91427059a89db
Port to argparse based cfg

Import latest cfg from oslo-incubator with these changes:

 Add deprecated --logdir common opt
 Add deprecated --logfile common opt.
 Allow nova and others to override some logging defaults
 Fixing the trim for ListOp when reading from config file
 Fix set_default() with boolean CLI options
 Improve cfg's argparse sub-parsers support
 Hide the GroupAttr conf and group attributes
 Fix regression with cfg CLI arguments
 Fix broken --help with CommonConfigOpts
 Fix ListOpt to trim whitespace
 updating sphinx documentation
 Don't reference argparse._StoreAction
 Fix minor coding style issue
 Remove ConfigCliParser class
 Add support for positional arguments
 Use stock argparse behaviour for optional args
 Use stock argparse --usage behaviour
 Use stock argparse --version behaviour
 Remove add_option() method
 Completely remove cfg's disable_interspersed_args()
 argparse support for cfg

The main cfg API change is that CONF() no longer returns the un-parsed
CLI arguments. To handle these args, you need to use the support for
positional arguments or sub-parsers.

Switching nova-manage to use sub-parser based CLI arguments means the
following changes in behaviour:

 - no more lazy matching of commands - e.g. 'nova-manage proj q' will
   no longer work. If we find out about common abbreviations used in
   peoples' scripts, we can easily add those.

 - the help output displayed if you run nova-manage without any args
   (or just a category) has changed

 - 'nova-manage version list' is no longer equivalent to
   'nova-manage version'

Change-Id: I19ef3a1c00e97af64d199e27cb1cdc5c63b46a82
Move monkey patch config opts into nova.utils

The monkey_patch and monkey_patch_modules configuration options are
only used in nova.utils, so move them there.

blueprint: scope-config-opts
Change-Id: Ibfc34be46306041951ab0142ab737686eacae9da
Properly scope isolated hosts config opts

The isolated_hosts and isolated_images options are only used by the
isolated hosts scheduler filter, so move them there.

blueprint: scope-config-opts
Change-Id: Ia89b613d7d934a0072f262add039fe14ef236334
Allow conductor exceptions to pass over RPC silently

When one service performs an operation on behalf of another, the
act of passing back an exception (even a known one) causes a lot
of scary log messages about the (presumed to be) error case.

This patch applies the new client_exceptions decorator to methods
in the conductor manager to prevent excess logging for known
situations.

Fixes bug 1084706

Change-Id: I56e472b0f08d584f5bbe5181ca909f2c11352120
Allow rpc-silent FloatingIP exceptions in n-net

This patch uses the new client_exceptions functionality to squelch
some errant exception dumps in the RPC layer.

Fixes bug 1084707

Change-Id: I31a783a67d7722751fcfeafab40e781dc762dd65
Add support for libvirt domain <sysinfo> XML config

Libvirt domains can have system metadata defined in a <sysinfo>
XML element. For the x86 platform with KVM guests, this can then
be used to populate the SMBIOS data tables

            <sysinfo>
              <bios>
                <entry name="vendor">Acme</entry>
              </bios>
              <system>
                <entry name="manufacturer">Acme</entry>
                <entry name="product">Wile Coyote</entry>
                <entry name="uuid">c7a5fdbd-edaf-9455-926a-d65c16db1809</entry>
              </system>
            </sysinfo>

Change-Id: Ib4980ddc2f558921893a7e208e304ba59636e430
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add support for libvirt domain <smbios> XML config

On x86 platforms the SMBIOS data tables can be customized
using the <smbios> XML config.

For example, to populate them based on the <sysinfo> data

            <smbios mode="sysinfo"/>

Or to copy the host's SMBIOS

            <smbios mode="host"/>

Change-Id: Ia4e6c1d9b0d66c58700ccf0f0fd97fa302aba64d
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add support for parsing the <uuid> from libvirt host capabilities

The libvirt host capabilities provide a <uuid> element which
uniquely identifies the host platform.

Change-Id: Ic619a24b4b90c757b868aa78396d6cdee56ccb4b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Implement an XML matcher

Uses the "Matcher" interface of the testtools assertThat() call to
compare XML document strings safely.  This will result in more
useful error results and will ignore attribute ordering issues
that caused problems with tests affected by lxml version skew.

Also converts test_libvirt_config to use XMLMatches, to
demonstrate its use.

Change-Id: I7821557a73eb8b5aca823cfccd02b4b660e0ffdb
Remove the deprecated quantum v1 code and directory.

The code in this directory is the v1 to integrate quantum with nova. at
that time, quantum hasn't a client and keystone support. At the nova side
, there is a quantum manager that connect to quantum server. now, all code
has been removed execept the nova_ipam_lib which is unused too. this patch
removes the nova_ipam_lib.py.

Change-Id: I05146d47fb57f215f8d010dbde8fdc0b2de55301
Properly scope password options

enable_instance_password is only used in api.openstack.compute.servers
so move it there.

password_length is passed as a parameter to every generate_password()
call, so just move it into nova.utils and have generate_password()
use it by default.

Note: using a config option as the default value of a kwarg isn't a
good idea because the option value is read when the function is defined
which means you can't control its value during unit tests. Instead we
use password=None as the default.

blueprint: scope-config-opts
Change-Id: I445174515fc2eacc56c7cccecadadd2a7e57d4f4
Move some opts into nova.utils

Both rootwrap_config and instance_usage_audit_period are only used in
nova.utils.

blueprint: scope-config-opts
Change-Id: Ide687af9b302f97f91a64b79f502a59fe7a715a3
Move link_prefix options into api.openstack.common

Add new update_link_prefix() helper methods which will contrain the
usage of the osapi_{compute,glance}_link_prefix options to the
nova.api.openstack.common module and move the options there.

blueprint: scope-config-opts
Change-Id: Idff76e16635b061f317f65d0b94bb300694833dc
Move osapi_max_limit into api.openstack.common

blueprint: scope-config-opts
Change-Id: I15e4f58be07ad4aff09ff30c021b1d86a6f15d53