A method and apparatus for determining a failure migration
By performing fault detection and login detection on the switch, combined with fault log tables and flow control rules, the problem of mis-migrating caused by misjudgment in existing technologies has been solved, achieving accuracy and high availability of fault migration.
Patent Information
- Application Number
- CN202411818405.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-12-11
AI Technical Summary
Existing technologies are prone to misjudging real faults and temporary network problems during fault migration, leading to large-scale false migrations and affecting the high availability of cloud servers.
By performing fault detection, port detection, and login detection on the switch, combined with fault log tables and flow control rules, the number of times fault migration is triggered is limited, ensuring that virtual machine migration only occurs under specific conditions.
This effectively avoids large-scale erroneous migrations, improves the accuracy of fault migration judgment, and ensures the high availability of cloud servers and the continuity of network services.
Smart Images

Figure CN119583314B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to a method and apparatus for determining fault migration. Background Technology
[0002] Cloud server failover, also known as fault migration, is a process designed to ensure the high availability of cloud servers by promptly initiating virtual machine failover operations when a hardware failure occurs on the host machine.
[0003] Currently, the pre-failure migration assessment strategy involves receiving heartbeat packets from all agent modules and updating the status of all physical machines. Based on the physical machine status, the system determines if a fault exists and sends a response packet to the corresponding agent module, thus deciding whether to migrate the virtual machines on that physical machine. However, lost or delayed heartbeat packets may be mistakenly identified as physical machine failures, triggering virtual machine migration. If this strategy fails to effectively distinguish between genuine faults and temporary network issues, normally functioning virtual machines may be misjudged as requiring migration, leading to large-scale false migrations.
[0004] Therefore, how to avoid large-scale mismigrating has become an urgent problem to be solved in this field. Summary of the Invention
[0005] This application provides a method and apparatus for determining fault migration, with the aim of avoiding large-scale false migration.
[0006] To achieve the above objectives, this application provides the following technical solution:
[0007] A method for determining fault migration includes:
[0008] When a fault message is received from the host machine, fault detection is performed on the switch corresponding to the host machine;
[0009] When the switch corresponding to the host passes the test, determine whether the fault record table contains fault information of the host.
[0010] If the fault record table does not contain fault information of the host machine, then fault detection is performed on the port of the switch corresponding to the host machine;
[0011] When the port of the switch corresponding to the host machine is not faulty, a login check is performed on the host machine;
[0012] If the host machine fails the login detection, the fault information of the host machine is stored in the fault record table;
[0013] Retrieve fault information of host machines that have initiated fault migration within the target time period from the fault record table; the fault information of the host machines includes the number of host machines.
[0014] When the number of fault information on the host machine is not greater than the preset maximum number, the virtual machine is triggered to perform fault migration.
[0015] Optionally, the fault detection of the switch corresponding to the host machine includes:
[0016] Select a predetermined number of other host machines from the switches corresponding to the host machine;
[0017] Use the ping command to check whether all other host machines are communicating normally with the host machine;
[0018] If any of the other host machines cannot communicate normally with the host machine, then the switch corresponding to the host machine is determined to have failed the test;
[0019] If all other host machines communicate normally with the host machine, then the switch corresponding to the host machine is determined to have passed the detection.
[0020] Optional, also includes:
[0021] If the fault record table contains fault information of the host machine, then fault migration will not be performed.
[0022] Optionally, the fault detection of the port of the switch corresponding to the host machine includes:
[0023] Detect whether a faulty host machine exists in the fault record table within a preset time period;
[0024] If the faulty host exists in the fault record table within the preset time period, then determine whether the switch where the faulty host is located is the same switch.
[0025] If the faulty host is located on the same switch, then determine whether the number of faulty hosts is less than the preset number of hosts;
[0026] If the number of faulty host machines is less than the preset number of host machines, then it is determined that the port of the switch corresponding to the host machine has not failed.
[0027] If the number of faulty host machines is not less than the preset number of host machines, then it is determined that the port of the switch corresponding to the host machine has failed.
[0028] Optionally, the login detection on the host machine includes:
[0029] Use the ping command to check if the host machine's network connection is normal;
[0030] If the host machine's network connection is normal, then use sshpass to remotely log in to the host machine;
[0031] If the host machine successfully logs in remotely, then the host machine is determined to have passed the login detection.
[0032] If the remote login to the host machine fails, it is determined that the host machine has failed the login detection.
[0033] Optional, also includes:
[0034] If the host machine's network connection is abnormal, a fault migration will be performed.
[0035] Optional, also includes:
[0036] When the number of fault messages on the host machine exceeds the preset maximum number, a message indicating that the fault messages on the host machine are abnormal will be returned.
[0037] A fault migration determination device, comprising:
[0038] The first detection unit is used to perform fault detection on the switch corresponding to the host machine when it receives fault information from the host machine.
[0039] The detection unit is used to determine whether the fault record table contains fault information of the host machine when the switch corresponding to the host machine passes the detection.
[0040] The second detection unit is used to perform fault detection on the port of the switch corresponding to the host machine if the fault record table does not contain fault information of the host machine.
[0041] The login detection unit is used to perform login detection on the host machine when the port of the switch corresponding to the host machine is not faulty;
[0042] A storage unit is used to store the fault information of the host machine in the fault record table if the host machine fails the login detection.
[0043] The acquisition unit is used to acquire fault information of host machines that have initiated fault migration within the target time period from the fault record table; the fault information of the host machines includes the number of host machines.
[0044] The migration unit is used to trigger the virtual machine to perform fault migration when the number of fault information of the host machine is not greater than a preset maximum number.
[0045] Optionally, the first detection unit is specifically used for:
[0046] Select a predetermined number of other host machines from the switches corresponding to the host machine;
[0047] Use the ping command to check whether all other host machines are communicating normally with the host machine;
[0048] If any of the other host machines cannot communicate normally with the host machine, then the switch corresponding to the host machine is determined to have failed the test;
[0049] If all other host machines communicate normally with the host machine, then the switch corresponding to the host machine is determined to have passed the detection.
[0050] Optionally, the first detection unit is specifically used for:
[0051] The stop unit is configured to not perform fault migration if the fault record table contains fault information of the host machine.
[0052] The technical solution provided in this application performs fault detection on the switch upon receiving fault information from the host machine. If the switch corresponding to the host machine passes the detection and the fault record table does not contain fault information from the host machine, fault detection is performed on the switch port. If the port corresponding to the host machine is not faulty, login detection is performed on the host machine. If the host machine fails the login detection, fault information of host machines that have initiated fault migration within the target time period is retrieved from the fault record table. If the number of fault information entries for the host machine is not greater than a preset maximum number, the virtual machine is triggered to perform fault migration. When fault information from the host machine is received, fault detection is performed on the host machine again. If a host machine fault is confirmed, the number of times fault migration can be triggered within a certain time period is limited, and fault migration will only occur when certain conditions are met, thereby effectively avoiding large-scale erroneous migrations. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 A flowchart illustrating a fault migration determination method provided in an embodiment of this application;
[0055] Figure 2 A flowchart illustrating a fault detection method for a switch provided in an embodiment of this application;
[0056] Figure 3A flowchart illustrating a fault detection method for a switch port provided in an embodiment of this application;
[0057] Figure 4 A flowchart illustrating a host machine login detection method provided in this application embodiment;
[0058] Figure 5 A schematic diagram illustrating a simplified fault migration judgment method provided in an embodiment of this application;
[0059] Figure 6 A schematic diagram illustrating a fault migration detection method provided in an embodiment of this application;
[0060] Figure 7 This is a schematic diagram of the architecture of a fault migration determination device provided in an embodiment of this application. Detailed Implementation
[0061] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0062] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0063] like Figure 1 The diagram shown is a flowchart of a fault migration judgment method provided in an embodiment of this application, applied to a fault migration system, and includes the following steps:
[0064] S101: When a fault message is received from the host machine, fault detection is performed on the switch corresponding to the host machine.
[0065] The fault information of the host machine includes, but is not limited to: host machine ping unreachable, cloud sentinel or DCOS host machine agent reporting timeout, and disk read-only.
[0066] It should be noted that the fault information of the host machine is sent by the host machine monitoring system. Cloud Sentinel and Data Center Operating System (dcos) are commonly used host machine operation and maintenance monitoring systems. In the event of a host machine failure, the monitoring system will capture the fault information of the host machine.
[0067] Understandably, when the monitoring system receives fault information about the host machine, the fault migration system (such as CVM-CVM) on the pod (the smallest unit of application deployment) will immediately trigger the fault migration convergence detection logic to perform secondary fault detection on the host machine, first by detecting the fault of the switch corresponding to the host machine.
[0068] Optionally, in another embodiment of this application, the specific implementation of fault detection from the switch corresponding to the host in step S101 is as follows: Figure 2 As shown, it includes the following steps:
[0069] S201: Select a preset number of other host machines from the switches corresponding to the host machine.
[0070] Optional, the preset quantity includes, but is not limited to: 5 units.
[0071] It is understandable that a preset number of other hosts are selected from the switches corresponding to the host machine. That is, a preset number of other hosts are randomly selected from the same switch as the host machine. If the number of hosts under the same switch as the host machine is less than the preset number, then all other hosts under the same switch as the host machine are obtained.
[0072] S202: Use the ping command to check whether all other host machines are communicating normally with the host machine.
[0073] If any other host cannot communicate normally with the host, then proceed to step S203; if all other host machines can communicate normally with the host, then proceed to step S204.
[0074] Understandably, the ping command is used to check if all other host machines are communicating normally with the host machine. Specifically, this involves controlling the host machine to send ping requests to all other host machines and checking if they can respond successfully. If all other host machines fail to respond (i.e., none return a ping response), this usually indicates a problem with network communication, meaning that all other host machines cannot communicate normally with the host machine.
[0075] S203: It has been determined that the switch corresponding to the host machine failed the test.
[0076] Understandably, if any other host cannot communicate normally with the host, it is determined that the switch corresponding to the host has failed the test, that is, the switch has failed, and no fault migration will be performed.
[0077] It should be noted that, to ensure network service continuity, the system will initiate a migration convergence process, migrating traffic to other available devices or paths. Finally, it will rely on the LA high availability mechanism to ensure that the network continues to operate normally until the failed device (such as a switch) is restored or replaced.
[0078] S204: Confirm that the switch corresponding to the host machine has passed the test.
[0079] Understandably, if all other host machines communicate normally with the host machine, then the switch corresponding to the host machine has passed the test, indicating that the switch has not failed. It is necessary to continue testing for other aspects to see if there are any faults.
[0080] S102: When the switch corresponding to the host passes the test, determine whether the fault record table contains fault information of the host.
[0081] If the fault log table does not contain fault information of the host machine, then proceed to step S103.
[0082] Understandably, when the switch corresponding to the host passes the test, it checks whether the fault record table contains fault information of the host. That is, it checks the fault record table to confirm whether there is a fault event of the host in the fault migration state.
[0083] Specifically, the fault record table is presented in the following format: Table 1.
[0084] Table 1
[0085] Fields type illustrate id varchar(64) trigger_time bigint(20) Fault trigger time svr_asset_id varchar(100) Fixed Assets svr_lan_ip varchar(20) Host IP svr_device_type varchar(20) Physical model name host_type int(11) 0. underlay; 1. overlay svr_idc_name varchar(100) fault_detail varchar(100) Fault Details svr_logic_area varchar(100) zone_id int(11) inner_switch varchar(128) Switch information detail int(11) 0 – Fault initiated normally, migration in progress; 1 – >=3 master machines on the same switch report anomalies within 5 minutes, the third one does not trigger actual migration, only fault information is recorded; 2 – All slave machines on the master machine have completed fault migration; 3 – Master machine fault migration completed, but slave machines failed; 4 – Multiple fault migrations were initiated against the master machine at the same time, resulting in fault conflicts; 5 – SSH login verification successful, fault convergence; 6 – Fault migration flow control.
[0086] It should be noted that the "mother machine" in Table 1 refers to the host machine.
[0087] It should be emphasized that the contents shown in Table 1 are for illustrative purposes only.
[0088] Optionally, after step S102, the method further includes:
[0089] If the fault log table contains fault information from the host machine, then fault migration will not be performed.
[0090] Understandably, if the fault log table already contains fault information for the host machine and the event is already in the migration state, initiating a fault migration again may result in redundant operations, increase the system load, or even cause performance problems or migration conflicts.
[0091] It should be noted that when the fault log table contains fault information of the host machine, only the fault event of the host machine is recorded in the fault log table, and no fault migration is performed.
[0092] S103: Perform fault detection on the ports of the switch corresponding to the host machine.
[0093] It is understandable that fault detection is performed on the ports of the switch corresponding to the host machine to check whether the fault information of the host machine is caused by abnormalities in some ports of the switch. If so, then there is no need to perform fault migration.
[0094] Optionally, in another embodiment of this application, the specific implementation of step S103 is as follows: Figure 3 As shown, it includes the following steps:
[0095] S301: Detect whether there is a faulty host machine in the fault record table within a preset time period.
[0096] If a faulty host is found in the fault record table within the preset time period, then step S302 is executed.
[0097] Among them, the faulty host indicates the host that has failed.
[0098] Optionally, the preset time period includes, but is not limited to, 5 minutes.
[0099] It is understandable that the system checks whether a faulty host machine exists in the fault record table within a preset time period. If a faulty host machine exists in the fault record table within the preset time period, the fault migration will not be performed.
[0100] S302: Determine whether the switch on which the faulty host is located is the same switch.
[0101] If the faulty host is on the same switch as the faulty host, then proceed to step S303.
[0102] Understandably, to determine whether the faulty host machine is on the same switch, specifically, the host machine's MAC address is obtained, and the MAC address is used to confirm whether they are connected to the same physical switch port.
[0103] It should be noted that if the faulty host machine is located on a different switch than the one on which the faulty host machine is located, then fault migration will not be performed.
[0104] S303: Determine if the number of faulty host machines is less than the preset number of host machines.
[0105] If the number of faulty host machines is less than the preset number of host machines, then proceed to step S304; if the number of faulty host machines is not less than the preset number of host machines, then proceed to step S305.
[0106] Optionally, the preset number of host machines includes, but is not limited to, 3.
[0107] S304: Confirm that the port of the switch corresponding to the host machine is not faulty.
[0108] S305: The port of the switch corresponding to the host machine has been found to be faulty.
[0109] It should be noted that since the switch has two ports, if one port fails, the traffic will migrate to the other port. The network traffic switching takes less than 5 minutes, while initiating the failover takes longer. In order to minimize the downtime of tenant virtual machines, the time to wait for the switch LA high availability to take effect is shorter, and the port of the failed switch will return to normal after it takes effect.
[0110] S104: When the port of the switch corresponding to the host machine is not faulty, perform a login check on the host machine.
[0111] It should be noted that if the host machine passes the login detection, then no fault migration will be performed.
[0112] Optionally, in another embodiment of this application, the specific implementation of step S104 is as follows: Figure 4 As shown, it includes the following steps:
[0113] S401: Use the ping command to check if the host machine's network connection is normal.
[0114] If the host machine's network connection is normal, proceed to step S402.
[0115] Understandably, the ping command is used to check if the host machine's network connection is normal. Specifically, a ping request is sent to the host machine to check if it can respond successfully. If the host machine does not respond, it indicates that the host machine's network connection is abnormal.
[0116] Optionally, after step S402, the method further includes:
[0117] If the host machine's network connection is abnormal, a failover will be performed.
[0118] It should be noted that if the host machine's network connection is abnormal, a fault migration will be performed. The fault migration process is as follows: the fault information of the host machine is stored in the fault record table, the fault information of the host machine that has initiated fault migration within the target time period is retrieved from the fault record table, and when the number of fault information of the host machine is not greater than the preset maximum number, the virtual machine is triggered to perform fault migration.
[0119] S402: Use sshpass to remotely log in to the host machine.
[0120] S403: If remote login to the host machine fails, it is determined that the host machine has failed the login check.
[0121] S404: If the host machine successfully logs in remotely, then the host machine has passed the login check.
[0122] S105: If the host machine passes the non-login detection, the fault information of the host machine will be stored in the fault record table.
[0123] Understandably, if the host machine passes the no-login detection, the fault information of the host machine will be stored in the fault record table, and the fault migration initiation preparation process will begin, that is, continue to execute step S106.
[0124] S106: Retrieve fault information of host machines that have initiated fault migration within the target time period from the fault log table.
[0125] The fault information of the host machine includes the number of host machines.
[0126] Optionally, the target time period can be set according to the actual situation, and there are no specific restrictions here. For example, the target time period is within ten minutes.
[0127] Optionally, after step S106, the method further includes:
[0128] When the number of fault messages on the host machine exceeds the preset maximum number, a message indicating that the fault messages on the host machine are abnormal will be returned.
[0129] The preset maximum number is the maximum number of fault information entries for the host machine in the flow control rules.
[0130] Understandably, when the number of fault messages on the host machine exceeds the preset maximum, an abnormal fault message is returned, prompting manual intervention. In this case, only the fault information of the host machine is recorded, and fault migration is not performed. For example, if the limit is 10 minutes to migrate only 3 machines, it is reasonable for one or two host machines to experience hardware failures within a 10-minute period. However, if more than 10 machines fail, it does not conform to objective laws. The reason may be a large number of false alarms, or the convergence logic triggering a hidden bug that causes convergence failure, etc., requiring flow control to stop fault migration.
[0131] It should be noted that flow control rules can be modified according to the flow control configuration table. The flow control configuration table supports custom modification of rules and enabling / disabling of rules, and is used to limit the number of times a host machine failover can be initiated within a certain period of time. The number of attempts is retrieved from the fault record table, and is counted based on the host machine IP information of the failover events initiated within a certain time period.
[0132] Specifically, the flow control configuration table is shown in Table 2.
[0133] Table 2
[0134] Fields type illustrate id bigint(32) span bigint(32) Inspection period, in seconds maximum int(11) Number of fault migrations allowed during the inspection period status int(11) Rule status: 0: disable 1: enable createTime timestamp updateTime timestamp illustrate
[0135] It should be noted that the contents shown in Table 2 are for illustrative purposes only.
[0136] S107: When the number of fault information on the host machine is not greater than the preset maximum number, the virtual machine is triggered to perform fault migration.
[0137] Understandably, when the number of fault information on the host machine is not greater than the preset maximum number, it is still necessary to record the fault information on the host machine in the fault record table, and then trigger the virtual machine to perform fault migration.
[0138] It should be noted that after the fault migration, the fault migration information also needs to be recorded in the migration record table. The specific format of the migration record table is shown in Table 3.
[0139] Table 3
[0140] Fields type illustrate id varchar(64) uuid varchar(64) Submachine UUID CPU int(11) Submachine CPU mem int(11) Submachine memory size volume_size int(11) Submachine disk size volume_type varchar(20) Submachine disk type IP varchar(20) Submachine IP appid Submachine appid orig_host varchar(20) Source motherboard IP host_type int(11) 0. underlay; 1. overlay target_host varchar(20) target mother machine IP begin_time bigint(20) Start time end_time bigint(20) End time status int(11) Status: 0 Initialization 1 Success 2 Failure 3 Migration in progress detail int(11) Fault migration log details (record.detail): 0 - Automatic migration, successful; 1 - Cloud host includes local disk, fault migration not supported; 2 - No available target host resources, migration impossible; 3 - Interface error (requires investigation and repair of VS and other interface issues), slave machine fault migration in progress; 4 - CGW interface error; 5 - Slave machine fault migration in progress; 6 - When the same host machine triggers multiple fault tickets, and multiple slave machines with the same UUID from these fault tickets all fail to migrate, to prevent multiple migration requests from being initiated to a single slave machine during batch migration; 7 - Manual retry in progress.
[0141] It should be noted that the contents shown in Table 3 are for illustrative purposes only.
[0142] It should be emphasized that the above Figure 1 The content shown can be summarized simply. Figure 5 The content shown is as follows: Upon receiving alarms (i.e., fault information of the host machine) sent by Cloud Sentinel and DCOS, fault migration detection is performed on the host machine (see steps S101 to S104). If the host machine passes the fault migration detection, flow control detection is performed on the fault migration (see steps S105 to S106). If the flow control detection is passed, fault migration is performed (see step S107). If the host machine fails the fault migration detection or fails the flow control detection, fault migration is not performed (i.e., migration convergence).
[0143] Furthermore, to better describe the process of fault migration detection on the host machine, the following explanation is provided in conjunction with specific application scenarios. (See also...) Figure 6First, perform fault detection on the switch corresponding to the host machine. If all other hosts on the same switch cannot communicate normally with the host machine, no fault migration will be performed. If all other hosts on the same switch can communicate normally with the host machine, then repeated fault migration will be detected. If the fault log table contains fault information of the host machine, no fault migration will be performed. If the fault log table does not contain fault information of the host machine, then perform fault detection on the port of the switch corresponding to the host machine. If the number of faulty hosts is greater than or equal to 3 within 5 minutes, no fault detection will be performed. If the number of faulty hosts is less than 3 within 5 minutes, then perform login detection on the host machine. First, check whether the host machine's network connection is normal using the ping command. If the host machine's network connection is normal, then use sshpass to remotely log in to the host machine. If the remote login to the host machine fails, or the host machine's network connection is abnormal, then prepare for fault migration. If the remote login to the host machine fails, no fault migration will be performed.
[0144] In summary, upon receiving fault information from the host machine, a fault check will be performed on the host machine again. If a host machine fault is confirmed, the number of times fault migration can be triggered within a certain period will be limited. Fault migration will only occur when certain conditions are met, thus effectively avoiding large-scale false migrations.
[0145] like Figure 7 The diagram shown is an architectural schematic of a fault migration judgment device provided in an embodiment of this application. The judgment device includes: a first detection unit 100, a judgment detection unit 200, a second detection unit 300, a login detection unit 400, a storage unit 500, an acquisition unit 600, and a migration unit 700.
[0146] The first detection unit 100 is used to perform fault detection on the switch corresponding to the host machine when it receives fault information from the host machine.
[0147] The first detection unit 100 is specifically used for: filtering out a preset number of other host machines from the switches corresponding to the host machine; checking whether all other host machines are communicating normally with the host machine using the ping command; if any other host machine cannot communicate normally with the host machine, then it is determined that the switch corresponding to the host machine has failed the detection; if all other host machines are communicating normally with the host machine, then it is determined that the switch corresponding to the host machine has passed the detection.
[0148] The detection unit 200 is used to determine whether the fault record table contains fault information of the host machine when the switch corresponding to the host machine passes the detection.
[0149] The second detection unit 300 is used to perform fault detection on the port of the switch corresponding to the host machine if the fault record table does not contain fault information of the host machine.
[0150] The second detection unit 300 is specifically used for: detecting whether there is a faulty host in the fault record table within a preset time period; if there is a faulty host in the fault record table within the preset time period, determining whether the switch where the faulty host is located is the same switch; if the switch where the faulty host is located is the same switch, determining whether the number of faulty hosts is less than the preset number of hosts; if the number of faulty hosts is less than the preset number of hosts, determining that the port of the switch corresponding to the host has not failed; if the number of faulty hosts is not less than the preset number of hosts, determining that the port of the switch corresponding to the host has failed.
[0151] The login detection unit 400 is used to perform login detection on the host machine when the port of the switch corresponding to the host machine is not faulty.
[0152] The login detection unit 400 is specifically used to: check whether the host machine's network connection is normal using the ping command; if the host machine's network connection is normal, then use sshpass to remotely log in to the host machine; if the host machine remote login is successful, then the host machine is determined to have passed the login detection; if the host machine remote login fails, then the host machine is determined to have failed the login detection.
[0153] Storage unit 500 is used to store the fault information of the host machine in the fault record table if the host machine fails the login detection.
[0154] The acquisition unit 600 is used to obtain the fault information of the host machines that have initiated fault migration within the target time period from the fault record table; the fault information of the host machines includes the number of host machines.
[0155] Migration unit 700 is used to trigger virtual machine fault migration when the number of fault information on the host machine is not greater than the preset maximum number.
[0156] In summary, upon receiving fault information from the host machine, a fault check will be performed on the host machine again. If a host machine fault is confirmed, the number of times fault migration can be triggered within a certain period will be limited. Fault migration will only occur when certain conditions are met, thus effectively avoiding large-scale false migrations.
[0157] Preferably, combined with Figure 7 As shown, the judgment device also includes a stop unit, which is used to not perform fault migration if the fault record table contains fault information of the host machine.
[0158] Preferably, combined with Figure 7 As shown, the determination device also includes a fault migration unit, used to perform fault migration if the host machine's network connection is abnormal.
[0159] Preferably, combined with Figure 7 As shown, the judgment device also includes a return unit, which is used to return a prompt message indicating that the fault information of the host machine is abnormal when the number of fault information of the host machine exceeds a preset maximum number.
[0160] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. In particular, for system or system embodiments, since they are fundamentally similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. Components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0161] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0162] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for determining fault migration, characterized in that, include: When a fault message is received from the host machine, fault detection is performed on the switch corresponding to the host machine; When the switch corresponding to the host passes the test, determine whether the fault record table contains fault information of the host. If the fault record table does not contain fault information of the host machine, then fault detection is performed on the port of the switch corresponding to the host machine; When the port of the switch corresponding to the host machine is not faulty, a login check is performed on the host machine; If the host machine fails the login detection, the fault information of the host machine is stored in the fault record table; Retrieve fault information of host machines that have initiated fault migration within the target time period from the fault record table; the fault information of the host machines includes the number of host machines. When the number of fault information on the host machine is not greater than the preset maximum number, the virtual machine is triggered to perform fault migration. The fault detection of the port of the switch corresponding to the host machine includes: Detect whether a faulty host machine exists in the fault record table within a preset time period; If the faulty host exists in the fault record table within the preset time period, then determine whether the switch where the faulty host is located is the same switch. If the faulty host is located on the same switch, then determine whether the number of faulty hosts is less than the preset number of hosts; If the number of faulty host machines is less than the preset number of host machines, then it is determined that the port of the switch corresponding to the host machine has not failed. If the number of faulty host machines is not less than the preset number of host machines, then it is determined that the port of the switch corresponding to the host machine has failed.
2. The method according to claim 1, characterized in that, The fault detection of the switch corresponding to the host machine includes: Select a predetermined number of other host machines from the switches corresponding to the host machine; Use the ping command to check whether all other host machines are communicating normally with the host machine; If any of the other host machines cannot communicate normally with the host machine, then the switch corresponding to the host machine is determined to have failed the test; If all other host machines communicate normally with the host machine, then the switch corresponding to the host machine is determined to have passed the detection.
3. The method according to claim 1, characterized in that, Also includes: If the fault record table contains fault information of the host machine, then fault migration will not be performed.
4. The method according to claim 1, characterized in that, The login detection on the host machine includes: Use the ping command to check if the host machine's network connection is normal; If the host machine's network connection is normal, then use sshpass to remotely log in to the host machine; If the host machine successfully logs in remotely, then the host machine is determined to have passed the login detection. If the remote login to the host machine fails, it is determined that the host machine has failed the login detection.
5. The method according to claim 4, characterized in that, Also includes: If the host machine's network connection is abnormal, a fault migration will be performed.
6. The method according to claim 1, characterized in that, Also includes: When the number of fault messages on the host machine exceeds the preset maximum number, a message indicating that the fault messages on the host machine are abnormal will be returned.
7. A fault migration determination device, characterized in that, include: The first detection unit is used to perform fault detection on the switch corresponding to the host machine when it receives fault information from the host machine. The detection unit is used to determine whether the fault record table contains fault information of the host machine when the switch corresponding to the host machine passes the detection. The second detection unit is used to perform fault detection on the port of the switch corresponding to the host machine if the fault record table does not contain fault information of the host machine. The login detection unit is used to perform login detection on the host machine when the port of the switch corresponding to the host machine is not faulty; A storage unit is used to store the fault information of the host machine in the fault record table if the host machine fails the login detection. The acquisition unit is used to acquire fault information of host machines that have initiated fault migration within the target time period from the fault record table; the fault information of the host machines includes the number of host machines. The migration unit is used to trigger the virtual machine to perform fault migration when the number of fault information of the host machine is not greater than a preset maximum number. The fault detection of the port of the switch corresponding to the host machine includes: Detect whether a faulty host machine exists in the fault record table within a preset time period; If the faulty host exists in the fault record table within the preset time period, then determine whether the switch where the faulty host is located is the same switch. If the faulty host is located on the same switch, then determine whether the number of faulty hosts is less than the preset number of hosts; If the number of faulty host machines is less than the preset number of host machines, then it is determined that the port of the switch corresponding to the host machine has not failed. If the number of faulty host machines is not less than the preset number of host machines, then it is determined that the port of the switch corresponding to the host machine has failed.
8. The apparatus according to claim 7, characterized in that, The first detection unit is specifically used for: Select a predetermined number of other host machines from the switches corresponding to the host machine; Use the ping command to check whether all other host machines are communicating normally with the host machine; If any of the other host machines cannot communicate normally with the host machine, then the switch corresponding to the host machine is determined to have failed the test; If all other host machines communicate normally with the host machine, then the switch corresponding to the host machine is determined to have passed the detection.
9. The apparatus according to claim 7, characterized in that, The first detection unit is specifically used for: The stop unit is configured to not perform fault migration if the fault record table contains fault information of the host machine.
Citation Information
Patent Citations
Container fault processing method, device and equipment and computer storage medium
CN117632354A
Network system, redundancy method, failure detector and failure detection program
JP2013008320A