diff --git a/lib/workflows/migrate_server.py b/lib/workflows/migrate_server.py index c3e355fd..dc131825 100644 --- a/lib/workflows/migrate_server.py +++ b/lib/workflows/migrate_server.py @@ -1,5 +1,6 @@ from typing import Optional +import openstackquery from openstack.connection import Connection from openstack_api.openstack_server import migrate_server, snapshot_server @@ -21,6 +22,18 @@ def server_migration( :param live: True to use live migration :type live: bool """ - snapshot_server(conn, server_id) - migrate_server(conn, server_id=server_id, dest_host=destination_host, live=live) + # Determine the status of the server + query = getattr(openstackquery, "ServerQuery")() + query.select("server_status") + query.where( + preset="any_in", + prop="server_id", + values=server_id, + ) + query.run( + "dev", all_projects=True, as_admin=True + ) # Do I need to add cloud account so that this will work on dev + print(query.to_string()) + # snapshot_server(conn, server_id) + # migrate_server(conn, server_id=server_id, dest_host=destination_host, live=live)