nova/nova
Andrey Volkov 8e19ef4173 Check hosts have no instances for AZ rename
Update aggregate and update aggregate metadata API calls have the
ability to update availability zone name for the aggregate. If the
aggregate is not empty (has hosts with instances on it)
the update leads to discrepancy for objects saving availability zone as a
string but not reference.

From devstack DB they are:
- cinder.backups.availability_zone
- cinder.consistencygroups.availability_zone
- cinder.groups.availability_zone
- cinder.services.availability_zone
- cinder.volumes.availability_zone
- neutron.agents.availability_zone
- neutron.networks.availability_zone_hints
- neutron.router_extra_attributes.availability_zone_hints
- nova.dns_domains.availability_zone
- nova.instances.availability_zone
- nova.volume_usage_cache.availability_zone
- nova.shadow_dns_domains.availability_zone
- nova.shadow_instances.availability_zone
- nova.shadow_volume_usage_cache.availability_zone

Why that's bad?
First, API and Horizon show different values for host and instance for
example. Second, migration for instances with changed availability
zone fails with "No valid host found" for old AZ.

This change adds an additional check to aggregate an Update Aggregate API call.
With the check, it's not possible to rename AZ if the corresponding
aggregate has instances in any hosts.

PUT /os-aggregates/{aggregate_id} and
POST /os-aggregates/{aggregate_id}/action return HTTP 400 for
availability zone renaming if the hosts of the aggregate have any instances.
It's similar to conflicting AZ names error already available.

Change-Id: Ic27195e46502067c87ee9c71a811a3ca3f610b73
Closes-Bug: #1378904
2019-03-01 12:25:16 -05:00
..
api Merge "Refactor "networks" processing in ServersController.create" 2019-02-25 16:25:31 +00: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 Check hosts have no instances for AZ rename 2019-03-01 12:25:16 -05:00
conductor Follow up for I0c764e441993e32aafef0b18049a425c3c832a50 2019-02-22 10:57:11 +01:00
conf Fix a typo in configuration description 2019-02-21 15:50:14 +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 Check hosts have no instances for AZ rename 2019-03-01 12:25:16 -05:00
pci PCI: do not force remove allocated devices 2019-02-01 16:57:51 +00:00
policies Merge "Remove deprecated 'flavors' policy" 2019-02-23 06:13:00 +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 Check hosts have no instances for AZ rename 2019-03-01 12:25:16 -05:00
virt Merge "libvirt: Drop MIN_LIBVIRT_PARALLELS_SET_ADMIN_PASSWD" 2019-02-23 09:22:40 +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 Convert certificate generation to processutils. 2018-05-02 19:18:41 +10:00
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 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 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 Refactor WSGI apps and utils to limit imports 2018-03-06 22:05:12 +00:00