nova/nova/tests/unit/compute
John Garbutt e3c5e22d1f Re-use existing ComputeNode on ironic rebalance
When a nova-compute service dies that is one of several ironic based
nova-compute services running, a node rebalance occurs to ensure there
is still an active nova-compute service dealing with requests for the
given instance that is running.

Today, when this occurs, we create a new ComputeNode entry. This change
alters that logic to detect the case of the ironic node rebalance and in
that case we re-use the existing ComputeNode entry, simply updating the
host field to match the new host it has been rebalanced onto.

Previously we hit problems with placement when we get a new
ComputeNode.uuid for the same ironic_node.uuid. This reusing of the
existing entry keeps the ComputeNode.uuid the same when the rebalance of
the ComputeNode occurs.

Without keeping the same ComputeNode.uuid placement errors out with a 409
because we attempt to create a ResourceProvider that has the same name
as an existing ResourceProvdier. Had that worked, we would have noticed
the race that occurs after we create the ResourceProvider but before we
add back the existing allocations for existing instances. Keeping the
ComputeNode.uuid the same means we simply look up the existing
ResourceProvider in placement, avoiding all this pain and tears.

Closes-Bug: #1714248
Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
Change-Id: I4253cffca3dbf558c875eed7e77711a31e9e3406
2017-12-11 16:23:49 -05:00
..
monitors Allow monitor plugins to set own metric object 2016-06-27 14:38:32 +05:30
__init__.py
eventlet_utils.py
fake_resource_tracker.py rt: explicitly pass compute node to _update() 2017-01-12 11:30:03 -08:00
test_claims.py rt: use a single ResourceTracker object instance 2017-01-16 14:09:25 -05:00
test_compute.py Implement new attach Cinder flow 2017-12-07 10:29:15 -05:00
test_compute_api.py Implement new attach Cinder flow 2017-12-07 10:29:15 -05:00
test_compute_cells.py Get original image_id from volume for volume-backed instance rebuild 2017-12-04 16:37:55 -05:00
test_compute_mgr.py Implement new attach Cinder flow 2017-12-07 10:29:15 -05:00
test_compute_utils.py Get auth from context for glance endpoint 2017-11-21 10:26:42 -06:00
test_compute_xen.py Make xen unit tests work with os-xenapi>=0.3.0 2017-09-05 16:06:31 -04:00
test_flavors.py Make compute unit tests inherit from test.NoDBTestCase 2015-02-24 17:54:29 +02:00
test_host_api.py Handle uuid in HostAPI.compute_node_get 2017-06-19 09:57:49 -04:00
test_keypairs.py Transform keypair.import notification 2017-10-30 16:44:29 -04:00
test_multi_cell_list.py Split instance_list into instance and multi_cell 2017-12-04 10:59:55 +08:00
test_provider_tree.py ProviderTree.get_provider_uuids() 2017-12-04 20:33:11 +00:00
test_resource_tracker.py Re-use existing ComputeNode on ironic rebalance 2017-12-11 16:23:49 -05:00
test_rpcapi.py Pre-create migration object 2017-10-05 13:49:15 -07:00
test_shelve.py Send Allocations to spawn 2017-10-18 06:43:57 -05:00
test_stats.py Address nits in Ia2296302 2016-03-08 16:48:08 +00:00
test_virtapi.py Remove mox from nova/tests/unit/compute/test_virtapi.py 2016-11-28 08:52:00 +00:00