nova/nova
Lee Yarwood 3a0f26c822 conductor: Recreate volume attachments during a reschedule
When an instance with attached volumes fails to spawn, cleanup code
within the compute manager (_shutdown_instance called from
_build_resources) will delete the volume attachments referenced by
the bdms in Cinder. As a result we should check and if necessary
recreate these volume attachments when rescheduling an instance.

Note that there are a few different ways to fix this bug by
making changes to the compute manager code, either by not deleting
the volume attachment on failure before rescheduling [1] or by
performing the get/create check during each build after the
reschedule [2].

The problem with *not* cleaning up the attachments is if we don't
reschedule, then we've left orphaned "reserved" volumes in Cinder
(or we have to add special logic to tell compute when to cleanup
attachments).

The problem with checking the existence of the attachment on every
new host we build on is that we'd be needlessly checking that for
initial creates even if we don't ever need to reschedule, unless
again we have special logic against that (like checking to see if
we've rescheduled at all).

Also, in either case that involves changes to the compute means that
older computes might not have the fix.

So ultimately it seems that the best way to handle this is:

1. Only deal with this on reschedules.
2. Let the cell conductor orchestrate it since it's already dealing
   with the reschedule. Then the compute logic doesn't need to change.

[1] https://review.openstack.org/#/c/587071/3/nova/compute/manager.py@1631
[2] https://review.openstack.org/#/c/587071/4/nova/compute/manager.py@1667

Conflicts:

  nova/tests/unit/conductor/test_conductor.py

NOTE(mriedem): There was a minor conflict due to not having change
I56fb1fd984f06a58c3a7e8c2596471991950433a in Queens.

Change-Id: I739c06bd02336bf720cddacb21f48e7857378487
Closes-bug: #1784353
(cherry picked from commit 41452a5c6a)
(cherry picked from commit d3397788fe)
2018-10-22 16:08:10 -04:00
..
CA
api Handle HostMappingNotFound when deleting a compute service 2018-07-18 12:59:07 +00:00
cells Add instance action record for snapshot instances 2017-12-11 17:46:38 +08:00
cmd nova-manage - fix online_data_migrations counts 2018-09-27 14:57:09 -04:00
common
compute Handle volume API failure in _post_live_migration 2018-10-16 22:43:20 -04:00
conductor conductor: Recreate volume attachments during a reschedule 2018-10-22 16:08:10 -04:00
conf Wait for network-vif-plugged before starting live migration 2018-08-22 12:34:54 -04:00
console Fix accumulated nits 2018-01-16 14:54:04 +00:00
consoleauth Merge "Remove translation of log messages" 2017-08-10 11:39:03 +00:00
db Merge "Fix DB archiver AttributeError due to wrong table name attribute used" into stable/queens 2018-09-19 16:20:36 +00:00
hacking trivial: Rename 'policy_check' -> 'policy' 2017-10-25 17:56:40 +01:00
image Workaround glanceclient bug when CONF.glance.api_servers not set 2018-02-08 09:06:48 -05:00
ipv6
keymgr Remove deprecated keymgr code 2017-09-11 15:48:30 -04:00
locale Imported Translations from Zanata 2018-03-01 06:16:22 +00:00
network Handle network-changed event for a specific port 2018-06-28 00:16:33 +00:00
notifications Merge "Remove noisy DEBUG log" into stable/queens 2018-09-21 12:01:58 +00:00
objects Filter deleted computes from get_all_by_uuids() 2018-09-21 14:46:35 -04:00
pci Address nits in I46d483f9de6776db1b025f925890624e5e682ada 2018-01-02 15:57:50 +00:00
policies Add policy rule to block image-backed servers with 0 root disk flavor 2018-06-18 13:51:41 -04:00
privsep stable-only: fix typo in IVS related privsep method 2018-10-03 19:28:30 +00:00
scheduler Revert "Make host_aggregate_map dictionary case-insensitive" 2018-09-25 19:10:48 -04:00
servicegroup Fix service list for disabled compute using MC driver 2018-09-16 19:12:55 +00:00
tests conductor: Recreate volume attachments during a reschedule 2018-10-22 16:08:10 -04:00
virt Merge "libvirt: Use os.stat and os.path.getsize for RAW disk inspection" into stable/queens 2018-10-05 10:03:47 +00:00
vnc
volume Use ksa session for cinder microversion check 2018-03-29 21:55:40 +00:00
__init__.py
availability_zones.py
baserpc.py
block_device.py Add uuid column to BlockDeviceMapping 2017-12-17 14:28:35 +00:00
cache_utils.py
config.py Set default of oslo.privsep.daemon logging to INFO level 2018-09-15 02:21:10 +00:00
context.py Allow cinderv2 endpoints within the request context catalog 2018-06-05 10:04:06 +01:00
crypto.py
debugger.py
exception.py [placement] Retry allocation writes server side 2018-08-03 14:41:15 +01:00
exception_wrapper.py rename binary to source in versioned notifications 2017-07-25 17:36:04 +02:00
filters.py
hooks.py
i18n.py correct referenced url in comments 2018-01-18 09:16:37 +08:00
loadables.py
manager.py
policy.py Add policy granularity to the Flavors API 2017-07-19 15:56:47 -04:00
profiler.py
quota.py Fix server_group_members quota check 2018-07-11 15:04:34 -04:00
rpc.py Remove dead code of api.fault notification sending 2017-10-09 17:29:40 +02:00
safe_utils.py Allow wrapping of closures 2017-07-20 10:07:52 +01:00
service.py Move conductor wait_until_ready() delay before manager init 2018-09-01 17:25:02 -04:00
service_auth.py Fix NoneType error when [service_user] is misconfigured 2017-11-28 12:22:30 -06:00
test.py Fix the request context in ServiceFixture 2018-09-04 19:36:26 +00:00
utils.py Merge "Handle TZ change in iso8601 >=0.1.12" 2018-01-31 00:36:50 +00:00
version.py
weights.py
wsgi.py