Check microversion to set up block_migration option
Set block_migration to 'auto' only if
microversion >= 2.25
Add disk_over_commit option to migration_kwargs
as a mandatory parameter for versions less than 2.25
Related-prod: PRODX-48889
Change-Id: I7a72047a7a9792f3363f6e5ef22ccd9672fb8c7d
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index a4918ad..6244860 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -401,10 +401,29 @@
def _live_migrate_server(self, server, host_id=None):
src_host = self.get_host_for_server(server['id'])
+ # check if microversion is equal or more than 2.25 because of
+ # block_migration(str) = 'auto' is supported since compute
+ # api version 2.25
+ # else use block_migration_for_live_migration config option
+ # and add disk_over_commit option to migration_kwargs
+ if (self.compute_request_microversion and
+ self.compute_request_microversion < '2.25'):
+ migration_kwargs = {
+ "host": host_id,
+ "block_migration": (CONF.compute_feature_enabled.
+ block_migration_for_live_migration),
+ "disk_over_commit": False,
+ }
+
+ else:
+ migration_kwargs = {
+ "host": host_id,
+ "block_migration": "auto",
+ }
+
self.os_adm.servers_client.live_migrate_server(
server_id=server['id'],
- block_migration='auto',
- host=host_id)
+ **migration_kwargs)
waiters.wait_for_server_status(
self.servers_client, server['id'], 'ACTIVE')