Handle missing dst_pool parameter in zone_migration

Unlike Nova, Cinder does not support calling the 'os-migrate_volume'[1]
action without a host or a cluster. For volume migrations of type
'migrate' in watcher the dst_pool is required, but for other migrations
that migrate the volumes to different types is not needed. This
change checks if the dst_pool is defined and prevents some migrations
when it's misssing information.

Adds testing for creating audits with the Zone Migration status,
validating the schema changes.

[1] https://docs.openstack.org/api-ref/block-storage/v3/index.html#migrate-a-volume

Closes-Bug: 2108988

Change-Id: I305c58e47093c4a884e86f1d91fdc15ef2a1cfba
Signed-off-by: jgilaber <jgilaber@redhat.com>
This commit is contained in:
jgilaber
2025-05-16 13:46:57 +02:00
parent 6cb4e2fa83
commit fe56660c44
5 changed files with 198 additions and 47 deletions

View File

@@ -6,4 +6,9 @@ fixes:
This brings the implementation of the strategy in line with the the api schema
where dest_node is optional.
If a dst_pool is not passed, the strategy will not migrate some volumes, as Cinder can't compute a
destination host when migrating available volumes like Nova does. If src_type and dst_type are equal,
a migration is only performed if a dst_pool is provided, otherwise the volume will be skipped/ignored.
If src_type and dst_type are different, the strategy will retype the volumes.
See: https://bugs.launchpad.net/watcher/+bug/2108988 for more details.