migration-tools/0013-set-agent-migration-task.patch
2024-11-11 17:02:47 +08:00

42 lines
1.3 KiB
Diff

From d5d7e0bed3bcfa893cf1907f2afbf8a3f05c679f Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
Date: Mon, 13 Nov 2023 16:16:55 +0800
Subject: [PATCH] =?UTF-8?q?agent=E7=B3=BB=E7=BB=9F=E8=BF=81=E7=A7=BB?=
=?UTF-8?q?=E4=BB=BB=E5=8A=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sysmig_agent/fork.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py
index cbc4165..23c10e2 100644
--- a/sysmig_agent/fork.py
+++ b/sysmig_agent/fork.py
@@ -239,3 +239,20 @@ def get_info_version(data):
version = json.loads(agent_info).get('kernel_version')
return version
+
+def system_migration(data):
+ kernel_version = get_info_version(data)
+ if not kernel_version:
+ kernel_version = '0'
+ task_id = json.loads(data).get('task_id')
+ # 更新SQL任务状态
+ sql_task_statue('1', task_id)
+ # 发送消息给Server更新任务流状态
+ post_server('task_start', task_id)
+ # The migration status is modified, and the breakpoint continues
+ mig_modify_statue(task_id)
+ #sql_mig_statue('00')
+ # MIGRATION MAIN
+ timed_task_migrate(task_id, kernel_version)
+ post_server('task_close', task_id)
+
--
2.20.1