Fix scheduler_available_filters help

The help speaks about nova.scheduler.filters.standard_filters which does
not exist anymore. The default has been changed to all_filters with
commit 0d9ce831 but the help text was not updated so far.

Change-Id: I38dfadabe02489d8d40986e7f4d06c0c68097516
Clearer default implmentation for dhcp_options...

'pass' is less clear than 'return None' for the base implementation.

Change-Id: Iff53d5eb7e88e18849696d858b3d910b6ea71e63
Remove flush_operations in the volume usage output

flush_operations is not used by upper layer code and also
according to
ftp://libvirt.org/libvirt/java/javadoc/org/libvirt/DomainBlockStats.html
http://libvirt.org/ruby/api/Libvirt/Domain/BlockStats.html

seems the last value should be errs instead of flush_operations
so remove it from libvirt driver layer.

Change-Id: I438b6fa40e9d97e3ffddda03919c5d577e91c155
Don't touch info_cache after refreshing it in Instance.refresh()

We were touching info_cache to force it to be marked dirty in the
instance object after refreshing it. However, it isn't dirty, because
it has just been refreshed and the relationship to instance hasn't
been altered. Also, the dirty state on the instance object is
unconditionally reset immediately after this anyway.

Change-Id: Ibc8e9d95210d14c946f6f820492da2331c0d7fab
VMware: fix regression for 'TaskInProgress'

Commit 73d4a7c1b4681accd993c1109a9eff837ff612f4 caused a regression
with the snapshot deletion. That is, the snapshot deletion will retry
if the resource is busy. The fact that the exception was not supported
in olso caused the problem.

Version 0.6.0 supports this exception.

Change-Id: I12fcc7d039a123e681c51978b9cf632af8f9644b
Closes-bug: #1369463
VMware: pass vm_ref to _get_and_set_vnc_config

In the spawn refactor we get the vm_ref when the instance is created.
Passing it to the method _get_and_set_vnc_config saves a function
call. We are able to do this as we already have the vm_ref for the
instance in question.

Change-Id: I7b8d056af7f49ebd31beff2876edb9e6115d0a2c
VMware: pass vm_ref to _set_machine_id

Save a method call to get the vm_ref. In spawn this value exists so
we can pass it to the method if necessary.

Change-Id: Ied43fb09fb2eec2d2c22fce17b4f98ae3f58860e
VMware: Fix problem transferring files with ipv6 host

Need to protect the host name with '[' and ']' before
we create a http/https connection

Change-Id: I9320c47f446d1e6b6b088802c3916a88b118d9cf
Closes-bug: #1390906
Fixed quotas double decreasing problem

When we delete vm with status "soft-delete" we shouldn't change
quota values because they were changed during soft-deleting.

Closes-bug: #1333145
Change-Id: I3ed7b3245b8908faa02903c74503918f061016bd
Hard reboot doesn't re-create instance folder

When use share storage like ceph, instance's disk data is in ceph,
instance's disk doesn't rely on local instance folder anymore. So
when rebooting a instance, we should create the instance folder if
it is missed.

Closes-Bug: #1349978

Change-Id: I5948c7979a7dbe7764fba6cad1d9867893824024
make get_by_host use slave in periodic task

In periodic task functions nova prefer to use slave db
instead of primary db. This patch makes function
_get_host_volume_bdms to use slave db

Change-Id: Ia297524fc1acf06ab708509c805d14e215b10b86
Revert pause/unpause state when host restart

Give following scenario for instance task state
1) start to pause an active instance
2) the nova-compute died because of unexpected situation
3) when nova-compute start again , it's task state is pausing
it should be changed to None because host restarted

Also ,for the paused instance and its state is unpausing,
we need to unpase the instance.

Change-Id: If72a36dafd894ac47c0b255d701a3f9965ff2590
Closes-Bug: #1290639
libvirt: use qemu (qdisk) disk driver for Xen >= 4.2.0

According to the Xen ML [1] "qdisk is better supported and blktap is
unmaintained, we choose qdisk over blktap whenever possible" (change was
introduced in Xen's commit 0166217 [2]). The Xen documentation states
that the disk driver "should not be specified, in which case libxl will
automatically determine the most suitable backend" [3]. However, even if
libvirt does it OK [4] not setting the driver name so that libxl chooses
the best backend, it sets the file format to 'raw' so that a wrong
backend will be chosen by libxl.  Since 'qdisk' seems to be the
preferred option, it seems safe to set it as the backend.

[1] http://lists.xen.org/archives/html/xen-devel/2013-08/msg02633.html
[2] http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=0166217103e18368424fbd5ffff01c1ea50d0b17
[3] http://xenbits.xen.org/docs/unstable/misc/xl-disk-configuration.txt
[4] http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/libxl/libxl_conf.c;h=1210500858b00b1d10b0bc921ab8b5efc87e630f;hb=HEAD#l847

Closes-Bug: #1326238
Change-Id: Ia52d52a01916fac92dc8e648c462e237c0bfc915
Indicate whether service is down for mc driver

memcache driver for service didn't log any clue
whether the service is down or not. This patch add a
log to indicate it at DEBUG level.

Closes-Bug: #1382564

Change-Id: I05e12b56411f4475d1ef50e90e09abf75d7355b0
Only filter once for trusted filters

In spawn process the filters will be used only once if the
run_filter_once_per_request is set to True. This apply to the hosts
that will not be affected by previous instance resource consumption.
Trusted filter should be in this kind of filters.

Change-Id: Ia223797798679fecfcf90983ca81a9f395e67c3b
libvirt: vif tests should use a flavor object

Some part of the tests code are still using a dictionary
to simulate flavor data structure.
However, it has been in fact changed to being a nova object.

Changing these part to be an object.

Change-Id: Idb0e1ca8fa09e1a36ba0f62175f01ee856e3f31b
tests: update _get_instance_xml to accept custom flavor object

Currently LibvirtVifTestCase._get_instance_xml creates a default
flavor object and uses it for all tests. This makes it dificult
to test settings that are being activated by values in extra
spects.

Allowing the method to accept a flavor object and use the default
one, if not provided.

Change-Id: I3835aa5e6cf09268b132b9de377004c0e8df9cb0
Network object: add missing translations

An exception was raised and not translated in commit
e134f81d85f42b87238f7786b0b50066129c968d.

Change-Id: I1c65041bd3a7152088f1660800d3a58f6fe12eea
Make aggregate filters use objects

Some scheduler filters that use aggregates have been converted
to use nova objects. This patch converts the remaining ones to
use objects. In both cases the calls to the database are
replaced by calls to a utility method that gets the required
data using Aggregate objects. In the future these utility
methods could be replaced with an implementation that works on
a cache - for now they do not change the behavior - its just
a refactor.

blueprint kilo-objects
Change-Id: I42d5697a67805b7e85f82cf3cf2cd6e17d923955
Use admin only common test case in admin action unit test cases

This patch use nova.tests.unit.api.openstack.compute.plugins.v3
.admin_only_action_common as the base class of AdminActionsTest
which can be shared by v2 and v21

Partially implements blueprint v2-on-v3-api
Change-Id: I16b59e8db59242b8e7b626cc77d0fff6bfc062e4