nova/nova
Lee Yarwood b7bf1fbe49 libvirt: Add workaround to cleanup instance dir when using rbd
At present all virt drivers provide a cleanup method that takes a single
destroy_disks boolean to indicate when the underlying storage of an
instance should be destroyed.

When cleaning up after an evacuation or revert resize the value of
destroy_disks is determined by the compute layer calling down both into
the check_instance_shared_storage_local method of the local virt driver
and remote check_instance_shared_storage method of the virt driver on
the host now running the instance.

For the Libvirt driver the initial local call will return None when
using the shared block RBD imagebackend as it is assumed all instance
storage is shared resulting in destroy_disks always being False when
cleaning up. This behaviour is wrong as the instance disks are stored
separately to the instance directory that still needs to be cleaned up
on the host. Additionally this directory could also be shared
independently of the disks on a NFS share for example and would need to
also be checked before removal.

This change introduces a backportable workaround configurable for the
Libvirt driver with which operators can ensure that the instance
directory is always removed during cleanup when using the RBD
imagebackend. When enabling this workaround operators will need to
ensure that the instance directories are not shared between computes.

Future work will allow for the removal of this workaround by separating
the shared storage checks from the compute to virt layers between the
actual instance disks and any additional storage required by the
specific virt backend.

NOTE(lyarwood): Conflicts as If1b6e5f20d2ea82d94f5f0550f13189fc9bc16c4
only merged in Rocky and the backports of
Id3c74c019da29070811ffc368351e2238b3f6da5 and
I217fba9138132b107e9d62895d699d238392e761 have yet to land on
stable/queens from stable/rocky.

Conflicts:
        nova/conf/workarounds.py

Related-Bug: #1761062
Partial-Bug: #1414895
Change-Id: I8fd6b9f857a1c4919c3365951e2652d2d477df77
(cherry picked from commit d6c1f6a103)
(cherry picked from commit 8c678ae572)
2019-03-13 12:10:41 +00:00
..
api Merge "Fix os-simple-tenant-usage result order" into stable/queens 2019-02-22 03:53:42 +00:00
CA
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 Lock detach_volume 2019-02-18 12:44:02 +00:00
conductor Handle tags in _bury_in_cell0 2018-12-12 17:20:44 -05:00
conf libvirt: Add workaround to cleanup instance dir when using rbd 2019-03-13 12:10:41 +00:00
console Fix accumulated nits 2018-01-16 14:54:04 +00:00
consoleauth Fix stacktraces with redis caching backend 2018-10-01 07:52:08 +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 Merge "Handle IndexError in _populate_neutron_binding_profile" into stable/queens 2019-02-11 21:53:20 +00:00
notifications Merge "Remove noisy DEBUG log" into stable/queens 2018-09-21 12:01:58 +00:00
objects Exclude build request marker from server listing 2019-01-03 14:27:36 +00:00
pci PCI: do not force remove allocated devices 2019-02-05 23:29:54 +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 Merge "Make host_manager use scatter-gather and ignore down cells" into stable/queens 2019-03-13 02:18:21 +00:00
servicegroup Fix service list for disabled compute using MC driver 2018-09-16 19:12:55 +00:00
tests libvirt: Add workaround to cleanup instance dir when using rbd 2019-03-13 12:10:41 +00:00
virt libvirt: Add workaround to cleanup instance dir when using rbd 2019-03-13 12:10:41 +00:00
vnc
volume Use ksa session for cinder microversion check 2018-03-29 21:55:40 +00:00
__init__.py
availability_zones.py Avoid lazy-load error when getting instance AZ 2017-05-25 15:46:22 -04:00
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_wrapper.py rename binary to source in versioned notifications 2017-07-25 17:36:04 +02:00
exception.py Explicitly fail if trying to attach SR-IOV port 2018-10-03 18:05:00 -04: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_auth.py Fix NoneType error when [service_user] is misconfigured 2017-11-28 12:22:30 -06:00
service.py Move conductor wait_until_ready() delay before manager init 2018-09-01 17:25:02 -04:00
test.py Fix the request context in ServiceFixture 2018-09-04 19:36:26 +00:00
utils.py Make supports_direct_io work on 4096b sector size 2018-11-21 10:47:30 +00:00
version.py
weights.py
wsgi.py