Periodic task _cleanup_running_deleted_instances() looks for orphaned
and running instances on hypervisor that should be deleted.
The problem is it checks if running instance has the same
hypervisor defined as it is in nova database.
In bug #1285000 it has been found that removing instance during
its migration could lead to abandon instance files on destination
host.
This change removes host filter in _running_deleted_instances() to
find also orphaned instances that are running on 'post migration'
destination host.
Change-Id: Idd1b58b85329b8e021eba4bc27f577af1b3338f4
Partial-Bug: #1285000
There are some small comments on the review of
Ib2b49f70c55311195535a5ef250ff555e227fa0a
This is a follow-up for these comments.
Change-Id: I1d2d95a0864578161a34084db31eb460e895c1ec
Resource tracker doesn't clean up the resources of an instance after
it is offloaded since Ia93168b1560267178059284186fb2b7096c7e81f. So
this patch proposes an explicit cleanup in compute manager.
Closes-Bug: #1710249
Change-Id: Ib16e987d50162a4c11a31692704859b981915bed
The following 3 scenarios are covered by this patch:
* boot, shelve, unshelve, delete
* boot, shelve, shelve offload, unshelve on different host, delete
* boot, shelve, shelve offload, unshelve on the same host, delete
The second and the third scenarios are faulty and therefore those
test cases now assert the wrong behavior but contain the expected
behavior as commented out asserts.
Change-Id: Iaf88f8802a456d5e197b65405fa6959a2c514325
Related-Bug: 1710249
After evacuation the instance has allocations on both the source and
the destination computes. This is OK as the source compute is down.
However after the source compute is brought up the allocation from
the source host needs to be cleaned up.
Closes-Bug: #1709902
Change-Id: I0df401a7c91f012fdb25cb0e6b344ca51de8c309
If merge_resources results in a class of resource with a value of zero,
and that result is then used to form an allocation request, the
allocation will be rejected: the json schema for allocations requires
the value of a resource class to be at least 1.
Therefore merge_resources is changed so that anywhere the value is zero
in the results, that key is popped from the dict. We need to do it in
this way because we are modifying an existing dict, not returning a new
one that we are assembling.
Change-Id: Idea9315d6bce8b341f0c3d2dc0accca6ac259587
Closes-Bug: #1710908
Currently we report the full inventory for available nodes, and an empty
inventory for nodes that are deployed to or otherwise unavailable.
Reporting an empty inventory for deployed nodes has 2 bad consequences:
1. Nova tries deleting the inventory for Placement, which fails, because
the resources are still in use. This results in nasty warnings.
2. When adding a resource class to a deployed node, it does not get into
inventory, and thus does not get to Placement. It results in an error
later on, when the custom resource class is not found.
This patch fixes the latter problem by
1. Always reporting the custom resource class for deployed nodes, if present.
2. Reporting VCPUS/memory/disk in exactly the same amount, as it is configured
in the ironic node's properties.
As a side effect, the warnings are no longer shown for deployed nodes.
They still appear, however, for nodes during cleaning.
Partial-Bug: #1710141
Change-Id: I2fd1e4a95f000da19864e75299afa51527697101
We want the host to be the destination and the status to be active so
use _wait_for_server_parameter to wait on both of those, rather than
waiting only for the server to change to ACTIVE.
Without this, we sometimes see the server go ACTIVE but the host has
not yet changed.
Co-Authored-By: Balazs Gibizer <balazs.gibizer@ericsson.com>
Co-Authored-By: Chris Dent <cdent@anticdent.org>
Change-Id: I273998ebc03f3a832cc44787a5c2396da58e5e25
Closes-Bug: 1710509
api.rst has many stale information now as we have done
many changes in api framework specially removal of
stevedore extensions loading and plain routing.
This commit modify this doc to reflect latest information
and remove v2 specific info which are no longer valid.
Note- in next part we will merge api_2.rst in this doc and
show 'adding api method' step by step.
Change-Id: I0628d8fa0b19c3fb09f1896402fc85dcae90916f
Detail these features, including links to the documentation. No tests
are provided as no upstream Tempest tests currently exist.
Change-Id: I1bb3674f35f83e2a33243103a267b4aff70f852e
Always send 'accept: application/json' header when the scheduler
report client talks to placement.
Setting accept ensures that if there are error responses, they will be
formatted as JSON, not HTML. Without the accept header, webob will
choose to send what it thinks is a reasonable default.
Change-Id: I7464e085c8c688d85cdce5aaddcf3bf2e04498ab
Closes-Bug: #1708037
The original idea for ironic flavor migration was to handle it in
init_host(), so that the code wouldn't run often. But in a situation
like an upgrade with multiple Nova computes handling ironic nodes, this
may not cover all the nodes, so we are moving it to be run whenever the
cache is refreshed, and new nodes for the compute service that have
instances are detected. We also need to cover the cases where an
existing node has a new instance created on it to ensure that that new
instance's flavor is also migrated.
Closes-Bug: #1707021
Change-Id: If0a7af3a958cf3aba95b89b96df5ff6bf252b110
This patch test evacuation between two Pike compute hosts and
checks the resource state in the placement API.
Related-Bug: #1709902
Change-Id: Idedb8a911a2ab0c096f4c9f61c5db362b08758ba
When attaching a volume, if CONF.cinder.cross_az_attach=False,
we attempt to lookup the AZ that the instance is in and compare
that to the volume AZ. The instance AZ lookup involves getting
host aggregates which are in the API database, and in superconductor
mode the cell conductor can't access to the API database.
For volume attach, we could remove this check from the compute
service since we already check this in nova-api so the check in
nova-compute is redundant.
However, we still have a problem with checking this during boot
from volume where nova-compute creates the volume and then
attaches it. At that point it's too late and we'll fail.
We should eventually create volumes during boot from volume in
conductor, like we've talked about doing with neutron ports
during server create, but that's not something we have today
so we need to point out this limitation.
Change-Id: I9cbe41e41f8ccdc9962ab593f313b5a47314a9d1
There is an up-call from the xenapi driver when performing a live
migration and --block-migrate is not specified such that the driver
checks to see if the source and destination hosts are in the same
aggregate. This fails in a super-conductor setup because the
aggregates are now in the API database and the cell conductor
won't be able to access that database by design.
Change-Id: I6c880c72d87eb0116cb57371e5d600dced2915f7
Related-Bug: #1709594
This change deprecates the Exact filters, and two options commonly used
to enable them. Custom resource classes should be used instead.
Change-Id: I843353427c90142a366ae9ca63ee4298b4f3ecd4