nova/nova/tests
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
..
functional Check hosts have no instances for AZ rename 2019-03-01 12:25:16 -05:00
live_migration/hooks Merge "Change live_migration_wait_for_vif_plug=True by default" 2019-02-14 19:24:33 +00:00
unit Merge "Remove misleading code from _move_operation_alloc_request()" 2019-02-24 00:26:59 +00:00
__init__.py
fixtures.py Merge "Fix race in test_volume_swap_server_with_error" 2019-02-23 06:33:07 +00:00
json_ref.py Transform instance.exists notification 2018-06-05 12:51:30 +00:00