nova/nova/tests/functional
Matt Riedemann 1b02166528 Restore soft-deleted compute node with same uuid
There is a unique index on the compute_nodes.uuid column which
means we can't have more than one compute_nodes record in the
same DB with the same UUID even if one is soft deleted because
the deleted column is not part of that unique index constraint.

This is a problem with ironic nodes where the node is 1:1 with
the compute node record, and when a node is undergoing maintenance
the driver doesn't return it from get_available_nodes() so the
ComputeManager.update_available_resource periodic task (soft)
deletes the compute node record, but when the node is no longer
under maintenance in ironic and the driver reports it, the
ResourceTracker._init_compute_node code will fail to create the
ComputeNode record again because of the duplicate uuid.

This change handles the DBDuplicateEntry error in compute_node_create
by finding the soft-deleted compute node with the same uuid and
simply updating it to no longer be (soft) deleted.

Closes-Bug: #1839560

Change-Id: Iafba419fe86446ffe636721f523fb619f8f787b3
(cherry picked from commit 8b007266f4)
2019-08-15 12:03:31 -04:00
..
api Include all network devices in nova diagnostics 2019-05-04 09:44:22 -06:00
api_sample_tests Add 'path' query parameter to console access url 2019-07-16 08:51:18 +01:00
compute Switch to using os-resource-classes 2019-02-07 11:11:09 +00:00
db Create request spec, build request and mappings in one transaction 2019-04-26 21:22:49 +00:00
libvirt libvirt: Use SATA bus for cdrom devices when using Q35 machine type 2019-06-13 15:56:58 +00:00
notification_sample_tests Stabilize unshelve notification sample tests 2019-07-03 07:25:21 +00:00
regressions Restore soft-deleted compute node with same uuid 2019-08-15 12:03:31 -04:00
wsgi Switch to using os-resource-classes 2019-02-07 11:11:09 +00:00
__init__.py Eventlet monkey patching should be as early as possible 2019-03-25 09:22:01 +01:00
api_paste_fixture.py Use external placement in functional tests 2018-12-12 18:46:49 +00:00
api_samples_test_base.py Merge "Fix os-simple-tenant-usage result order" 2018-10-27 08:57:52 +00:00
fixtures.py Convert driver supported capabilities to compute node provider traits 2019-02-28 23:28:19 +00:00
integrated_helpers.py Merge "Handle placement error during re-schedule" into stable/stein 2019-05-23 17:35:38 +00:00
test_aggregates.py Check hosts have no instances for AZ rename 2019-03-01 12:25:16 -05:00
test_availability_zones.py Update instance.availability_zone on revertResize 2019-03-28 09:57:12 -04:00
test_boot_from_volume.py Properly track local root disk usage during moves 2018-10-08 17:33:49 -04:00
test_compute_mgr.py Fup for the bandwidth series 2019-02-27 10:23:15 +01:00
test_conf_max_attach_disk_devices.py Add configuration of maximum disk devices to attach 2019-01-30 15:47:10 +00:00
test_images.py Share snapshot image membership with instance owner 2019-02-08 18:06:27 -05:00
test_instance_actions.py Improve NeutronFixture and remove unncessary stubbing 2018-08-02 15:15:03 +02:00
test_legacy_v2_compatible_wrapper.py Improve NeutronFixture and remove unncessary stubbing 2018-08-02 15:15:03 +02:00
test_list_servers_ip_filter.py Use external placement in functional tests 2018-12-12 18:46:49 +00:00
test_login.py update api_samples code to use better variables 2015-12-14 11:23:26 +08:00
test_metadata.py Use external placement in functional tests 2018-12-12 18:46:49 +00:00
test_middleware.py Removes unnecessary utf-8 encoding 2016-12-20 10:27:01 +07:00
test_multiattach.py Improve NeutronFixture and remove unncessary stubbing 2018-08-02 15:15:03 +02:00
test_nova_manage.py Use external placement in functional tests 2018-12-12 18:46:49 +00:00
test_report_client.py Use a placement conf when testing report client 2019-03-04 20:43:48 +00:00
test_server_faults.py Replace non-nova server fault message 2019-08-06 10:48:49 -04:00
test_server_group.py Remove duplicate cleanup in functional tests 2019-03-07 23:58:58 +00:00
test_servers.py Drop source node allocations if finish_resize fails 2019-07-01 15:19:19 -04:00