nova/nova
Matt Riedemann 9a977cb28c Add functional recreate test for regression bug 1825537
Change I2d9ab06b485f76550dbbff46f79f40ff4c97d12f in Rocky
(and backported through to Pike) added error handling to
the resize_instance and finish_resize methods to revert
allocations in placement when a failure occurs.

This is OK for resize_instance, which runs on the source
compute, as long as the instance.host/node values have not
yet been changed to the dest host/node before RPC casting
to the finish_resize method on the dest compute. It's OK
because the instance is still on the source compute and the
DB says so, so any attempt to recover the instance via hard
reboot or rebuild will be on the source host.

This is not OK for finish_resize because if we fail there
and revert the allocations, the instance host/node values
are already pointing at the dest compute and by reverting
the allocations in placement, placement will be incorrectly
tracking the instance usage with the old flavor against the
source node resource provider rather than the new flavor
against the dest node resource provider - where the instance
is actually running and the nova DB says the instance lives.

This change adds a simple functional regression test to
recreate the bug with a multi-host resize. There is already
a same-host resize functional test marked here which will
need to be fixed as well.

Conflicts:
      nova/tests/functional/test_servers.py
      nova/virt/fake.py

NOTE(mriedem): The test_servers conflict is due to not having
change If6aa37d9b6b48791e070799ab026c816fda4441c in Rocky. As
a result, the new regression test also had to be modified for
the call to assertFlavorMatchesAllocation. The fake module
conflict is due to not having change
Iefff121640e04abdbb6a4ae546c447f168dc8af9 in Rocky.

Change-Id: Ie9e294db7e24d0e3cbe83eee847f0fbfb7478900
Related-Bug: #1825537
(cherry picked from commit f4bb672106)
(cherry picked from commit eaa1fc6159)
2019-07-05 10:21:13 -04:00
..
api Delete resource providers for all nodes when deleting compute service 2019-06-21 09:55:19 -04:00
cells Add instance action record for snapshot instances 2017-12-11 17:46:38 +08:00
cmd Handle templated cell mappings in nova-status 2019-03-11 21:01:08 -04:00
common
compute Merge "Grab fresh power state info from the driver" into stable/rocky 2019-07-01 16:33:01 +00:00
conductor Merge "Fix incomplete instance data returned after build failure" into stable/rocky 2019-04-17 20:29:39 +00:00
conf libvirt: Add workaround to cleanup instance dir when using rbd 2019-01-15 15:53:48 +00:00
console Move create of ComputeAPI object in websocketproxy 2019-04-10 15:34:17 -07:00
consoleauth Fix stacktraces with redis caching backend 2018-10-01 07:50:53 +00:00
db Fix retry of instance_update_and_get_original 2019-05-20 11:57:01 +01:00
hacking Use nova.db.api directly 2018-07-10 14:56:27 +00:00
image Share snapshot image membership with instance owner 2019-04-30 21:13:46 +09:00
ipv6
keymgr
locale Imported Translations from Zanata 2019-01-06 07:42:59 +00:00
network Move get_pci_mapping_for_migration to MigrationContext 2019-06-05 17:43:15 +03:00
notifications Remove noisy DEBUG log 2018-08-24 11:19:14 +02:00
objects Merge "Move get_pci_mapping_for_migration to MigrationContext" into stable/rocky 2019-06-13 19:38:08 +00:00
pci PCI: do not force remove allocated devices 2019-02-05 23:29:36 +00:00
policies Remove support for /os-floating-ip-dns REST API 2018-07-18 22:23:45 -04:00
privsep Make supports_direct_io work on 4096b sector size 2018-11-21 14:14:22 +00:00
scheduler Merge "Disable limit if affinity(anti)/same(different)host is requested" into stable/rocky 2019-07-04 18:03:40 +00:00
servicegroup Fix service list for disabled compute using MC driver 2018-09-14 02:25:10 +00:00
tests Add functional recreate test for regression bug 1825537 2019-07-05 10:21:13 -04:00
virt Add functional recreate test for regression bug 1825537 2019-07-05 10:21:13 -04:00
vnc
volume Use migration_status during volume migrating and retyping 2019-05-07 12:43:10 +01:00
__init__.py
availability_zones.py AZ list performance optimization: avoid double service list DB fetch 2019-04-30 13:17:04 +00:00
baserpc.py
block_device.py Add uuid column to BlockDeviceMapping 2017-12-17 14:28:35 +00:00
cache_utils.py
config.py Configure placement DB context manager for nova-manage/status 2018-09-06 10:47:55 -04:00
context.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
crypto.py Convert certificate generation to processutils. 2018-05-02 19:18:41 +10:00
debugger.py
exception.py Merge "Fixes multi-registry config in Quobyte driver" into stable/rocky 2019-06-13 19:38:25 +00:00
exception_wrapper.py Add full traceback to ExceptionPayload in versioned notifications 2018-06-19 16:46:46 +08:00
filters.py
hooks.py
i18n.py correct referenced url in comments 2018-01-18 09:16:37 +08:00
loadables.py
manager.py conf: Remove 'db_driver' config opt 2018-03-16 17:23:16 +00:00
policy.py
profiler.py
quota.py Merge "Avoid joins in _server_group_count_members_by_user" 2018-08-07 23:16:06 +00:00
rc_fields.py Nix unused raise_if_custom_resource_class_pre_v1_1 2018-06-18 19:52:45 +00:00
rpc.py Use oslo.messaging per-call monitoring 2018-06-11 14:44:10 -07:00
safe_utils.py
service.py Move conductor wait_until_ready() delay before manager init 2018-08-31 16:21:52 -04:00
service_auth.py Fix NoneType error when [service_user] is misconfigured 2017-11-28 12:22:30 -06:00
test.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
utils.py Harden placement init under wsgi 2018-11-12 11:30:32 +00:00
version.py
weights.py
wsgi.py Refactor WSGI apps and utils to limit imports 2018-03-06 22:05:12 +00:00