nova/nova
Matt Riedemann 4363b10f5b Remove misleading code from _move_operation_alloc_request()
Change I1c9442eed850a3eb7ac9871fafcb0ae93ba8117c in Pike
made the scheduler "double up" the old_flavor and new_flavor
allocations when resizing to the same host. If there were
Ocata computes still in the deployment at the time, which would
be normal in Pike for rolling upgrades, the ResourceTracker
would overwrite the instance allocations in placement based on
the instance.flavor when the update_available_resource periodic
task would run.

If that periodic ran after scheduling but before finish_resize(),
the old_flavor would be used to report allocations. If the periodic
ran after finish_resize(), the new_flavor would be used to report
allocations.

That Ocata-compute auto-heal code was removed in Rocky with change
I39d93dbf8552605e34b9f146e3613e6af62a1774, but should have effectively
been vestigial since Queens when nova-compute should be at most N-1 so
there should be no Ocata compute services.

This change removes the misleading Pike-era code in the
_move_operation_alloc_request() which sums the allocations for the
old and new flavor when resizing to the same host since:

1. The compute service no longer does what the comment says.
2. Since Queens, conductor swaps the instance-held allocations
   on the source node to the migration record and the
   _move_operation_alloc_request method is only called if the
   instance has allocations, which it won't during resize. So the
   only time _move_operation_alloc_request is called now is during
   an evacuate because conductor doesn't do the allocation swap in
   that case. And since you can't evacuate to the same host, the
   elif block in _move_operation_alloc_request is dead code.

Note that change I1c9442eed850a3eb7ac9871fafcb0ae93ba8117c was
effectively a change in behavior for resize to the same host
because the scheduler sums the old/new flavor resource allocations
which could result in a false NoValidHost error when in reality
the total allocation for the instance is going to be the maximum
of the resource class allocations between the old and new flavor,
e.g. if the compute has 8 VCPUs total and the instance is using
6 VCPUs with the old flavor, and then resized to a new flavor with
8 VCPUs, the scheduler is trying to "claim" 14 VCPUs when really the
instance will only use 8 and that causes a NoValidHost error.
Comparing to the pre-Pike scheduling and ResourceTracker.resize_claim
behavior for resize to the same host, the scheduler would only filter
on the new flavor resources and the resize_claim would only claim
based on the new_flavor resources as well. The update_available_resource
periodic would account for old_flavor usage in
_update_usage_from_migration() after the instance was resized and
before it was confirmed/reverted.

Change-Id: I8c6b6c46b2587ee727653dafadbcb08b99ed7d35
Related-Bug: #1790204
2019-02-22 12:52:02 -05:00
..
api API microversion 2.69: Handles Down Cells Documentation 2019-02-20 10:10:50 -08:00
cells Per aggregate scheduling weight 2019-01-21 11:48:44 +08:00
cmd Merge "Add fill_virtual_interface_list online_data_migration script" 2019-01-31 13:43:35 +00:00
common
compute Merge "Lock detach_volume" 2019-02-14 21:46:53 +00:00
conductor Follow up for I0c764e441993e32aafef0b18049a425c3c832a50 2019-02-22 10:57:11 +01:00
conf Merge "API microversion 2.69: Handles Down Cells Documentation" 2019-02-21 00:29:01 +00:00
console Use X-Forwarded-Proto as origin protocol if present 2019-01-16 00:28:53 +00:00
consoleauth Fix stacktraces with redis caching backend 2018-09-27 13:15:11 -04:00
db Update mailinglist from dev to discuss 2018-12-05 09:44:35 +08:00
hacking Add a hacking rule for deprecated assertion methods 2018-10-25 11:49:10 +09:00
image Update mailinglist from dev to discuss 2018-12-05 09:44:35 +08:00
ipv6
keymgr
locale Imported Translations from Zanata 2018-09-23 06:53:32 +00:00
network Merge "Remove get_config_vhostuser" 2019-02-15 04:34:23 +00:00
notifications The field instance_name was added to InstanceCreatePayload 2019-01-15 15:27:07 +00:00
objects Follow up for I0c764e441993e32aafef0b18049a425c3c832a50 2019-02-22 10:57:11 +01:00
pci PCI: do not force remove allocated devices 2019-02-01 16:57:51 +00:00
policies Merge "Default zero disk flavor to RULE_ADMIN_API in Stein" 2019-02-15 02:18:05 +00:00
privsep create_veth_pair is unused, remove it. 2019-02-08 00:23:06 +00:00
scheduler Remove misleading code from _move_operation_alloc_request() 2019-02-22 12:52:02 -05:00
servicegroup Fix deprecation warning for threadgroup.add_timer 2019-02-07 09:37:00 -05:00
tests Remove misleading code from _move_operation_alloc_request() 2019-02-22 12:52:02 -05:00
virt Merge "libvirt: Bump MIN_{LIBVIRT,QEMU}_VERSION for "Stein"" 2019-02-21 00:02:13 +00:00
vnc Deprecate the nova-xvpvncproxy service 2018-10-15 10:03:13 +01:00
volume Make [cinder]/catalog_info no longer require a service_name 2018-11-28 18:33:30 -05:00
__init__.py
availability_zones.py
baserpc.py
block_device.py Add method to generate device names universally 2019-01-15 18:55:11 +00:00
cache_utils.py
config.py Configure placement DB context manager for nova-manage/status 2018-09-05 10:29:48 -04:00
context.py Remove NovaException logging from scatter_gather_cells 2018-11-21 12:43:35 -05:00
crypto.py
debugger.py
exception.py Fup for the bandwidth resource provider series 2019-02-04 14:10:31 +01: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
loadables.py
manager.py
policy.py Fix string interpolations in logging calls 2019-01-29 15:06:39 +09:00
profiler.py
quota.py Make _instances_cores_ram_count() be smart about cells 2018-11-13 03:35:33 -05:00
rc_fields.py Switch to using os-resource-classes 2019-02-07 11:11:09 +00:00
rpc.py Fix jsonutils.to_primitive UserWarning 2018-12-17 22:56:50 -05:00
safe_utils.py
service.py Move conductor wait_until_ready() delay before manager init 2018-08-31 12:50:10 -07:00
service_auth.py
test.py Merge "Use a static resource tracker in compute manager" 2019-02-04 19:53:38 +00:00
utils.py Merge "Address nits from I9e30a24a4c0640f282f507d0a96640d3cdefe43c" 2019-02-20 16:26:31 +00:00
version.py
weights.py Per aggregate scheduling weight 2019-01-21 11:48:44 +08:00
wsgi.py