Make separate calls to libvirt volume

This is a follow up patch to
https://review.openstack.org/#/c/116998/, where libvirt
volume's connect_volume method were split into get_config and
connect_volume. The following patch changes libvirt driver
to call the appropriate volume method, get_config or
connect_volume, instead of the old monolithic call to
connect_volume. connect_volume will no longer need to return
the libvirt xml after this switch over. This will improve
performance and eliminate possible race conditions.

Change-Id: I0d0d7ba98c53ad7509c28bb4866c488c0a049d2f
Closes-Bug: #1359617
Set error state when unshelve an instance due to not found image

If shelve image created by shelve operation can not be found when
unshelve, nova should set the instance error state.

This patch add a new param show_deleted to glance api:
:param show_deleted: (Optional) show the image even the status of
                     image is deleted.

Change-Id: Ie4bc8dfec0922023dd1a4204a67acd77f7bb0498
Closes-Bug: 1371406
Split and fix availability zone filter unit tests

The availability zone filter unit tests were broken, but the problem
with them was being masked due to aggregate fixtures that were created
in tests that happened to be alphabetically ordered right before them.
This patch splits out these unit tests into their own file and mocks out
the appropriate call to nova.db.aggregate_metadata_get_by_host() instead
of relying on database records.

Change-Id: Ic692d3e7c77047ae6d901b955bc504fdc5e73738
Split and fix the type filters unit tests

The unit test for TypeAffinityFilter was broken -- it was passing in the
instance_type['name'] key, when the filter class actually checks the
'id' key of the instance_type property of the filter_properties dict. :(

This corrects the tests, removes all DB accesses from both the type and
aggregate type affinity filter unit tests, and splits them out into
their own test file.

Change-Id: I5fc27c538cc419b4ed972839751e0e779151fc58
Port SecurityGroupRules controller into v2.1

This patch port SecurityGroupRules controller into v2.1 security_groups extension.

This patch just move the v2 code into v2.1 and share the unittest. The other
v2.1 related fix and improvement will be addressed by subsequent patchset.

Partially implements blueprint v2-on-v3-api

Change-Id: I23c6d7c70ec27068066e2a2e3c7764982bf8ed1d
Port security-group-default-rules extension into v2.1

This patch port security-group-default-rules into v2.1.

This patch just move the v2 code into v2.1 and share the unittest. The other
v2.1 related fix and improvement will be addressed by subsequent patchset.

Partially implements blueprint v2-on-v3-api

Change-Id: I4d65993d6413160d2c7c2eb2ce0c3f66768e1a36
Use 404 instead of 400 when security_group is non-existed

This patch correct the status code when security_group is
non-existed. This is good for sharing unittest between v2.1
and v2 API.

Change-Id: Ib4bd725381052947859db1ab30905fa33e502679
libvirt: introduce config to handle cells memory pages caps

Introduces a new config 'LibvirtConfigCapsNUMAPages' to
the driver libvirt which handles memory pages capabilities
of the host in the context of NUMA.

Work-item: Enhance libvirt driver to report available
           large pages per NUMA node in the host state data

Partial-Implement: blueprint virt-driver-large-pages
Change-Id: I902510c190a1b85d860f2579b01b52bb13f4d034
Merge "Set error state when unshelve an instance due to not found image"
Merge "Split and fix availability zone filter unit tests"
Merge "Port SecurityGroupRules controller into v2.1"
Merge "Port security-group-default-rules extension into v2.1"
Merge "Use 404 instead of 400 when security_group is non-existed"
Remove warning & change @periodic_task behaviour

During development of Juno, Ia227f4c4e69ecf361ab02d1d17a3010303650104
added a warning that the behaviour of periodic_tasks with an interval of
0 would change.  This patch changes the behaviour and removes the
warning.

Oslo (which provides the @periodic_task decorator) uses spacing=0 to
mean "run at the default interval of 60s", but several nova methods used
spacing=0 to mean "don't run".  These methods now behave consistently
with the Oslo code.

Due to an error in the original patch, some of the warnings refer to the
intended behaviour change as being in "the K release", and some to "Juno".
The warning about changing behaviour is first present in Juno, so this
patch should be merged in Kilo.

Change-Id: Ie5f2092a3b84e3674fe6a68ce511d2dc218bb625
Closes-bug: 1276203
Merge "libvirt: introduce config to handle cells memory pages caps"
Merge "Remove warning & change @periodic_task behaviour"
Merge "Split and fix the type filters unit tests"
Merge "Make separate calls to libvirt volume"