Fault recovery method of virtual machine and server

The method automates virtual machine fault repair by inspecting and determining repair strategies, enhancing efficiency and minimizing disruptions through snapshot restoration and strategic fault repair, addressing inefficiencies in existing methods.

CN119127541APending Publication Date: 2024-12-13XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411009871.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Existing virtual machine fault detection and repair methods are inefficient and lack automation, leading to potential service interruptions and data loss during the repair process.

Method used

A method for virtual machine fault repair that includes inspecting target virtual machines for abnormalities, determining repair strategies based on inspection results, and executing repair scripts to automate the fault repair process, with options for snapshot restoration and fault repair in a startup state to minimize service disruption.

Benefits of technology

Enhances the efficiency of virtual machine fault repair by enabling automated detection and repair, reducing the risk of service interruptions and data loss, and optimizing the repair process through weighted decision models for selecting the most secure and efficient repair strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127541A_ABST
    Figure CN119127541A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a fault repairing method for a virtual machine. Relates to the technical field of virtual machine fault repair. The method comprises the steps of performing inspection on inspection items in a target virtual machine, obtaining an inspection result corresponding to each inspection item, determining a target repair strategy based on a corresponding relationship between an abnormal inspection result and the repair strategy under the condition that the inspection results have the abnormal inspection result representing that the target virtual machine has a fault, and repairing the target virtual machine according to the target repair strategy. And finally, executing the repair script in the target repair strategy, and repairing the fault of the target virtual machine. According to the method and the device, the fault of the target virtual machine can be determined by polling the preset polling item, and the repair strategy corresponding to the fault can be determined based on the corresponding relationship when the fault of the target virtual machine is determined, so that the fault of the virtual machine can be automatically detected and repaired, and the fault repair efficiency of the virtual machine can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of virtual machine fault repair, and in particular to a virtual machine fault repair method and server. Background Art

[0002] A virtual machine (VM) is a virtual environment created on a physical hardware system that acts as a virtual computer system. Any work that can be done on a physical computing device can be done on a virtual machine. Each virtual machine can run independently and can install different operating systems and application software.

[0003] A virtual machine may fail during operation, so how to detect and repair the failure of the virtual machine is a technical problem that urgently needs to be solved in this field. Summary of the invention

[0004] The embodiments of the present application provide a virtual machine fault repair method and server, which can improve the efficiency of virtual machine fault repair.

[0005] In a first aspect, an embodiment of the present application provides a method for repairing a virtual machine fault, the method comprising:

[0006] The inspection items in the target virtual machine are inspected to obtain the inspection results corresponding to each inspection item. If there is an abnormal inspection result in the inspection result indicating that the target virtual machine has a fault, the target repair strategy can be determined based on the corresponding relationship between the abnormal inspection result and the repair strategy, and then the repair script in the target repair strategy is executed to repair the fault in the target virtual machine. This realizes automatic detection and repair of virtual machine faults, thereby improving the efficiency of virtual machine fault repair.

[0007] In some possible implementations, a repair script in a target repair strategy is executed to repair a fault in a target virtual machine. Specifically, a repair script in a target repair strategy is executed to repair a fault in a virtual machine in a snapshot of a target virtual machine, wherein the snapshot of the target virtual machine is a snapshot corresponding to the target virtual machine created when an abnormal inspection result is determined that a fault exists in the target virtual machine.

[0008] When the virtual machine fault is repaired successfully, the fault of the target virtual machine is repaired using the repair script in the target repair strategy, or a fault repair virtual machine is created based on the target virtual machine snapshot, and the business of the target virtual machine is migrated to the fault repair virtual machine. In this way, when the virtual machine in the virtual machine snapshot is repaired successfully, the target virtual machine is repaired again, which can not only repair the target virtual machine fault but also reduce the risk of direct operation on the target virtual machine.

[0009] In some possible implementations, if the repair of the virtual machine in the virtual machine snapshot fails, the virtual machine snapshot can be restored, that is, the state and data of the virtual machine in the virtual machine snapshot after the repair are restored to be consistent with the state and data of the virtual machine saved in the virtual machine snapshot before the repair.

[0010] In some possible implementations, a virtual machine repair decision model can be introduced. When there is an abnormal inspection result in the inspection result that indicates that the target virtual machine has a fault, the target state node corresponding to the combination can be determined from the virtual machine repair decision model according to the combination of the abnormal inspection results, wherein the virtual machine repair decision model includes multiple state nodes, and the state node is used to represent the fault condition of the virtual machine. Then, according to the corresponding relationship between the state node and the repair strategy, the target repair strategy corresponding to the target state node can be determined.

[0011] When the target state node corresponds to multiple repair strategies, the target repair strategy corresponding to the target state node is determined according to the corresponding relationship between the state node and the repair strategy, which can be specifically:

[0012] According to the correspondence between the state node and the repair strategy, multiple repair strategies corresponding to the target state node are determined, and the repair strategy with the highest weight value among the multiple repair strategies can be determined as the target repair strategy, wherein the higher the weight value indicates the higher the security of executing the corresponding repair strategy, the shorter the execution completion time and the lower the cost.

[0013] Specifically, a repair strategy includes at least one repair script, and each repair script is pre-set with a corresponding execution completion time weight, cost weight, and safety weight. The weight value of the repair strategy can be obtained as follows:

[0014] Determine the first weight, second weight and third weight of each repair script; wherein the first weight is the ratio of the execution completion time weight of the repair script to the preset execution completion time coefficient, the second weight is the ratio of the cost weight of the repair script to the preset cost coefficient, and the third weight is the product of the safety weight of the repair script and the preset safety coefficient. Then, the sum of the first weight, the second weight and the third weight of the same repair script can be determined as the weight value of the repair script, the sum of the weight values ​​of the repair scripts in the same repair strategy and the number of repair scripts in the repair strategy are determined, and finally the ratio of the sum of the weight values ​​of the repair scripts in the same repair strategy to the number of repair scripts is determined as the weight value of the repair strategy.

[0015] In some possible implementations, based on the correspondence between the abnormal inspection results and the repair strategies, a target repair strategy is determined, which may be:

[0016] Query whether there is a repair strategy corresponding to the abnormal inspection result of the target virtual machine. If no repair strategy corresponding to the abnormal inspection result of the target virtual machine is found, user input information can be received, and then the repair strategy information corresponding to the abnormal inspection result of the target virtual machine can be extracted based on the user input information. Then, the correspondence between the abnormal inspection result and the repair strategy can be updated based on the repair strategy information, and the target repair strategy can be determined from the updated correspondence.

[0017] In some possible implementations, when executing the repair script in the target repair strategy, it may also be determined whether the target virtual machine is in a startup state.

[0018] When the target virtual machine is in the startup state, the repair script in the target repair strategy is executed to repair the fault existing in the target virtual machine.

[0019] When the target virtual machine is in a shutdown state, the preset rescue system is used to boot the target virtual machine to start up. When the target virtual machine is booted to start up, the repair script in the target repair strategy is executed to repair the faults of the target virtual machine. In this way, repairing the virtual machine while it is in a startup state can reduce the risk of service interruption and data loss caused by virtual machine shutdown or restart.

[0020] In some possible implementations, inspection items in the target virtual machine are inspected to obtain inspection results corresponding to each inspection item, which may be:

[0021] The inspection items of the target virtual machine are determined according to the state information of the target virtual machine and the operation log data, wherein the state information of the target virtual machine can be used to reflect the overall performance and operation state of the target virtual machine, and then the inspection items can be inspected to obtain the inspection results corresponding to each inspection item.

[0022] Exemplarily, the status information of the target virtual machine may include: CPU utilization of the target virtual machine, memory occupancy of the target virtual machine, disk I / O status of the target virtual machine, suspicious network traffic of the target virtual machine, heartbeat detection of the target virtual machine, and domain name system check of the target virtual machine and other parameter indicators.

[0023] In a second aspect, an embodiment of the present application provides a server, including: a memory and a server;

[0024] The memory is coupled to the processor; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes any implementation method of the first aspect.

[0025] It can be seen from the above technical solution that the present application has the following beneficial effects:

[0026] The inspection items in the target virtual machine are inspected to obtain the inspection results corresponding to each inspection item. When there is an abnormal inspection result in the inspection result indicating that the target virtual machine has a fault, the target repair strategy is determined based on the correspondence between the abnormal inspection result and the repair strategy. Finally, the repair script in the target repair strategy is executed to repair the fault in the target virtual machine. Inspection of the pre-set inspection items can determine whether the target virtual machine has a fault. When a fault exists, the repair strategy corresponding to the fault can also be determined based on the correspondence, thereby realizing automatic detection and repair of virtual machine faults, thereby improving the efficiency of virtual machine fault repair. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1A A schematic diagram of a hyper-convergence platform provided in an embodiment of the present application;

[0028] Figure 1B A schematic diagram of a module structure of a computing device provided in an embodiment of the present application;

[0029] Figure 1C A flowchart of a virtual machine fault repair method provided in an embodiment of the present application;

[0030] Figure 1D The embodiment of the present application provides a flowchart for determining whether a virtual machine fails;

[0031] Figure 2 A schematic diagram of the structure of the first virtual machine repair decision model provided in an embodiment of the present application;

[0032] Figure 3 A schematic diagram of the structure of a second virtual machine repair decision model provided in an embodiment of the present application;

[0033] Figure 4 A schematic diagram of the structure of a third virtual machine repair decision model provided in an embodiment of the present application;

[0034] Figure 5 A schematic diagram of the structure of a fourth virtual machine repair decision model provided in an embodiment of the present application;

[0035] Figure 6 A schematic diagram of the structure of a fifth virtual machine repair decision model provided in an embodiment of the present application;

[0036] Figure 7 A schematic diagram of the structure of a sixth virtual machine repair decision model provided in an embodiment of the present application;

[0037] Figure 8 A flowchart for determining whether a virtual machine system state is in a startup state is provided in an embodiment of the present application;

[0038] Fig. 9A flowchart of another virtual machine fault repair method provided in an embodiment of the present application;

[0039] Fig.10 A flowchart of a decision model optimization method provided in an embodiment of the present application;

[0040] Fig.11 A structural diagram of a seventh virtual machine repair decision model provided in an embodiment of the present application;

[0041] Fig.12 A schematic diagram of a server structure provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0043] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0044] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.

[0045] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0046] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0047] The following introduces relevant technical terms and application scenarios of this application solution.

[0048] Hyper-convergence, also known as hyper-convergence infrastructure, is a software-defined network architecture that usually appears in the form of software on general-purpose server hardware. It can virtualize the computing and storage in the server to form a computing resource pool and a storage resource pool respectively.

[0049] A hyper-converged platform may be composed of multiple computing devices, each of which may include a hyper-converged system. The hyper-converged system may be used to virtualize the hardware resources in the computing device to form a virtual machine.

[0050] A virtual machine (VM) is a virtual environment created on a physical hardware system that acts as a virtual computer system. Any work that can be done on a physical computing device can be done on a virtual machine. Each virtual machine can run independently and can have different operating systems and application software installed.

[0051] The embodiment of the present application provides a method for repairing a virtual machine fault, including: inspecting inspection items in a target virtual machine, obtaining inspection results corresponding to each inspection item, and in the case where there is an abnormal inspection result in the inspection result that indicates that the target virtual machine has a fault, determining the target repair strategy based on the correspondence between the abnormal inspection result and the repair strategy, and finally executing the repair script in the target repair strategy to repair the target virtual machine. In the present application, inspecting the pre-set inspection items can determine whether the target virtual machine has a fault, and when it is determined that the target virtual machine has a fault, the repair strategy corresponding to the fault can also be determined based on the correspondence, thereby realizing automatic detection and repair of virtual machine faults, thereby improving the efficiency of virtual machine fault repair.

[0052] The following is an exemplary introduction to the system architecture provided in the embodiments of the present application.

[0053] The embodiments of the present application can be applied to a hyper-converged architecture and can perform fault repair and detection on virtual machines in a hyper-converged platform.

[0054] Figure 1A A schematic diagram of a hyper-convergence platform provided in an embodiment of the present application is shown. Figure 1A As shown, the hyper-converged platform may include multiple computing devices, for example, computing device 101a, computing device 101b, and computing device 101c.

[0055] The computing device may be, for example, a server, which may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as basic cloud computing services such as large databases and artificial intelligence platforms. When the above-mentioned server is a server cluster or a distributed system composed of multiple physical servers, multiple physical servers can form a blockchain, and each physical server is a node on the blockchain. The physical type of the service area can be a rack server, a high-density server, a GPU server, a tower server, and can also be a blade server, a whole cabinet server, etc., which is not specifically limited in this application.

[0056] Each computing device may include a hyper-converged system and a virtual machine (a computing device may include one virtual machine or multiple virtual machines). For example, computing device 101a may include a hyper-converged system 102a and a virtual machine 104a. Computing device 101b may include a hyper-converged system 102b and a virtual machine 104b, and computing device 101c may include a hyper-converged system 102c and a virtual machine 104c. The hyper-converged system may include software for defining and building a hyper-converged platform, which may be applied to any standard general-purpose server. The following is an introduction taking computing device 101a as an example.

[0057] The hyper-converged system 102a in the computing device 101a can virtualize the hardware resources in the computing device 101a to form a virtual machine 104a. In other words, the hyper-converged system 102a can virtualize the central processing unit (CPU), memory and other resources in the computing device 101a to provide computing virtualization functions. At the same time, the hyper-converged system 102a can virtualize storage resources such as solid-state drives in the computing device 101a to provide a unified storage resource pool. Therefore, the hyper-converged system 102a can form various resource pools by virtualizing the computing resources and storage resources in the computing device 101a.

[0058] The hyper-converged system 102a may also include an automated script execution tool 103a. The computing device 101a may obtain a job script through the automated script execution tool 103a, and may also execute the job script through the automated script execution tool 103a to perform fault detection and fault repair on the virtual machine 104a.

[0059] The virtual machine fault repair method provided in the embodiment of the present application can be applied to any computing device in a hyper-converged platform. It should be noted that the system architecture and application scenarios described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0060] For ease of understanding, the following is an exemplary introduction to the virtual machine fault repair method provided by the present application in conjunction with the accompanying drawings, which may be referred to as Embodiment 1. The virtual machine fault repair method is applicable to Figure 1A The system shown in the figure is described by taking the method in the first embodiment executed in a computing device as an example.

[0061] Before introducing the first embodiment, the various modules included in the computing device in this application and the functions of the modules are introduced.

[0062] Specifically, Figure 1B As shown, the computing device may include a fault discovery module 100 , a policy decision module 110 , and a policy execution module 120 .

[0063] The fault detection module 100 is used to determine whether a virtual machine fails. The policy decision module 110 is used to determine whether there is a repair strategy when it is determined that the virtual machine fails. The policy execution module 120 is used to execute the repair strategy to repair the virtual machine failure when it is determined that there is a repair strategy.

[0064] The following describes in detail the virtual machine fault repair method provided in the first embodiment of the present application in combination with the modules and functions included in the above computing device. Figure 1C As shown, the fault recovery method of the virtual machine includes:

[0065] S101: Determine whether a virtual machine fails.

[0066] The computing device may call the fault detection module to determine whether the virtual machine (also called the target virtual machine) has a fault. In an exemplary implementation, the fault detection module may determine the cause of the virtual machine fault by combining information such as the state information of the virtual machine and the operation log data.

[0067] The state information of the virtual machine is used to reflect the overall performance and operation status of the virtual machine, and may include parameter indicators such as the CPU utilization rate of the virtual machine, the memory occupancy rate of the virtual machine, the disk I / O status of the virtual machine, the suspicious network traffic of the virtual machine, the heartbeat detection of the virtual machine, and the domain name system (DNS) check of the virtual machine. In this way, judging whether a virtual machine has failed through multiple parameter indicators in the state information of the virtual machine and multiple channels such as operation log data can improve the accuracy of judging whether a virtual machine has failed and cover more scenarios where virtual machines may fail.

[0068] The fault detection module can also collect the operation log data of the virtual machine. These operation log data record various events and error information during the operation of the virtual machine, which is an important basis for diagnosing faults. The fault detection module can parse and filter the operation log data of the virtual machine to determine the key information related to the fault.

[0069] Exemplarily, the operation log data may include the startup and shutdown record data of the virtual machine. The startup and shutdown record data records the startup time of the virtual machine, whether the startup process is normal, the shutdown time, and the self-check information before shutdown. This information helps to determine whether the virtual machine can be started and shut down normally, and whether there are problems in the startup or shutdown process.

[0070] The operation log data may include system event data. Event data records system-level events that occur during the operation of the virtual machine, such as kernel errors, hardware failures, driver problems, etc. These events are usually closely related to the stability and reliability of the virtual machine.

[0071] Operation log data can also include application log data. If an application is running on the virtual machine, the application log will also be recorded. Application log data usually contains the application's operating status, error information, and user operations, which helps diagnose the failure of the application running on the virtual machine and optimize performance.

[0072] Operation log data can also include security log data. Security log data records events related to virtual machine security, such as user login attempts, permission changes, security policy execution, etc. These security log data are crucial to ensuring the security of virtual machines.

[0073] The computing device may pre-set the parameter indicators or operation log data included in the state information of the virtual machine as inspection items. Figure 1DAs shown, the computing device can pre-set the CPU utilization of the virtual machine, the heartbeat detection of the virtual machine, the DNS check of the virtual machine, the suspicious network traffic analysis of the virtual machine, etc. as inspection items (i.e., specific items that need to be checked during each inspection process), and each inspection item is used to find out whether the virtual machine has a certain type of fault. Therefore, the virtual machine fault can be discovered in time by screening and inspecting all inspection items. When the computing device calls the fault discovery module, the fault discovery module can execute step S1011 to check each inspection item.

[0074] Furthermore, the fault detection module can analyze the specific values ​​of these inspection items and compare them with the preset thresholds. For example, taking CPU utilization as an example, the threshold of CPU utilization is set to 80%. When the CPU utilization is greater than or equal to 80%, it is determined that the inspection item is abnormal and the virtual machine is faulty.

[0075] When step S1011 is completed, that is, each inspection item is inspected, step S1012 can be executed to determine whether there are any inspection items with abnormalities. If no abnormalities are found, step S1011 can be re-executed to perform the next round of inspections on each inspection item. The fault discovery module also has the ability to confirm whether the fault generated by the virtual machine is repaired. The fault discovery module can confirm whether such problems and abnormalities are resolved by screening and inspecting a certain inspection item.

[0076] In some possible implementations, if an abnormal inspection item is found, step S103 may be directly executed to determine whether there is a repair strategy.

[0077] In some possible implementations, if abnormal inspection items are found, step S102 may be performed first to back up the virtual machine in the current state in the form of a snapshot, and then, if the fault repair fails, the virtual machine snapshot in the current state is restored based on the backup data.

[0078] S102: Create a virtual machine snapshot.

[0079] The computing device can construct a virtual machine snapshot, so as to back up the state and data of the virtual machine at the time corresponding to the triggering of the virtual machine snapshot function, and then execute step S103. Specifically, in the case of a target virtual machine failure, a target virtual machine snapshot of the target virtual machine is constructed, and the target virtual machine snapshot may include inspection items of the target virtual machine. Since the failure to repair the fault is a possible repair result and does not necessarily occur, this step S102 is an optional execution step and does not belong to the necessarily executed step.

[0080] S103: Determine whether there is a repair strategy.

[0081] After determining that there are abnormal inspection items, the computing device can call the policy decision module to determine whether there is a repair strategy based on the corresponding relationship between the abnormal inspection result and the repair strategy. If it is determined that there is a repair strategy, step S104 can be executed to execute the repair strategy and repair the virtual machine fault. If it is determined that there is no repair strategy, the virtual machine fault repair method in this embodiment is terminated.

[0082] It should be noted that the correspondence between the inspection results and the repair strategies can be pre-set. For example, the inspection items include F1, F2 and F3. The pre-set correspondence between the inspection results and the repair strategies can be that if the inspection result of F1 is abnormal, the repair script x1 will be executed as the target repair strategy for repairing F1; if the inspection result of F2 is abnormal, the repair script x2 will be executed as the target repair strategy for repairing F2; if the inspection result of F3 is abnormal, the repair script x3 will be executed as the target repair strategy for repairing F3.

[0083] For another example, if the inspection results of F1 and F2 are abnormal, executing the repair script x1 and executing the repair script x2 are determined as target repair strategies for repairing F1 and F2.

[0084] As an example, the policy decision module can determine the target repair policy through the virtual machine repair decision model.

[0085] First, the virtual machine repair decision model can be introduced. The virtual machine repair decision model can be composed of a state node and a repair script. The state of the state node is composed of the results of each inspection item, which indicates the fault condition of the current virtual machine. For example, if the number of inspection items in the virtual machine repair decision model is set to n, the state node can be expressed as (m1, m2, m3, ..., mn). Among them, mn represents the inspection result of the nth inspection item. In a possible embodiment, the inspection result of the inspection item is represented by the value of mn. For example, mn = 1 can indicate that the inspection result of the nth inspection item is normal, and mn = 0 can indicate that the inspection result of the inspection item is abnormal.

[0086] In the embodiment of the present application, a repair script can be executed to convert the inspection result of the inspection item from abnormal to normal. Taking the nth inspection item as an example, if mn=0, the purpose of executing the repair script is to convert mn from 0 to 1.

[0087] Suppose the mth inspection item is Fm, the inspection result corresponding to the inspection item is mm, and there are n repair scripts. The repair script of Fm can be expressed as n ways to convert mm from 0 to 1, which is defined here as Fm(xn).

[0088] In combination with the state node, it can be considered that the state node to the next state node can be combined by the inspection item conversion from 0 to 1, that is, the connection between the state nodes can be connected by one or more Fm(xn). Exemplarily, taking the example that the state node can include a fault state node (that is, there is an abnormal result in the inspection item result), for example, the current inspection item includes two items F1 and F2, and there are 2 repair scripts corresponding to F1, namely F1(x1) and F1(x2), and there is 1 repair script corresponding to F2, namely F2(x1). The structure of the virtual machine repair decision model can be as follows Figure 2 shown.

[0089] Figure 2 Node A, Node B, and Node C are all faulty nodes. The node status of Node A indicates that the inspection results of inspection items F1 and F2 are both abnormal, that is, they can both be represented by the number 0. The node status of Node B indicates that the inspection result of inspection item F1 is normal, and the inspection result of inspection item F2 is abnormal, that is, the inspection result of inspection item F1 can be represented by the number 1, and the inspection result of inspection item F2 can be represented by the number 0. The node status of Node C indicates that the inspection result of inspection item F1 is abnormal, and the inspection result of inspection item F2 is normal, that is, the inspection result of inspection item F1 can be represented by the number 0, and the inspection result of inspection item F2 can be represented by the number 1.

[0090] Therefore, in Figure 2 In the virtual machine repair decision model shown, node A and node B are connected through F1(x1) and F1(x2), that is, by executing either of the two repair scripts F1(x1) and F1(x2), the node state can be converted from node A to node B. The conversion of the node state from node A to node B indicates that the anomaly indicated by the inspection item F1 has been repaired.

[0091] Node A and node C are connected via F2(x1), that is, by executing F2(x1), the node state can be converted from node A to node C. The conversion of the node state from node A to node C indicates that the anomaly indicated by inspection item F2 has been repaired.

[0092] The state nodes may also include normal state nodes, such as Figure 3 As shown in FIG. 1 , node D is a normal node (all inspection results are normal). Taking the current inspection items including F1 and F2 as an example, the node state of node D indicates that the inspection results of inspection items F1 and F2 are both normal, that is, both can be represented by the number 1. Therefore, the structure of the virtual machine repair decision model can also be as follows: Figure 3 As shown. Figure 3The structure of the virtual machine repair decision model includes node A, node B, node C and node D. Node A and node D can communicate with each other through F2(x1)F1(x2) (F2(x1) and F1(x2) repair scripts are executed together), F1(x1)F2(x1) (F1(x1) and F2(x2) repair scripts are executed together), F1(x2)F2(x1) (F1(x2) and F2(x1) repair scripts are executed together) and F2(x1) The four repair strategies F1(x1) (F2(x1) and F1(x1) repair scripts are executed together) are directly connected, indicating that the node state can be directly converted from node A to node D by executing any of the combinations of F2(x1)F1(x2), F1(x1)F2(x1), F1(x2)F2(x1) and F2(x1)F1(x1). The conversion of the node state from node A to node D indicates that the anomalies of inspection items F1 and F2 are repaired.

[0093] Node A and Node B can be connected via F1(x1) and F1(x2), and Node B and Node D can be connected via F2(x1). The node state can be converted from Node A to Node D by first executing either of the two repair scripts F1(x1) and F1(x2) to convert the node state from Node A to Node B, i.e., repairing the abnormality of inspection item F1, and then executing F2(x1) to convert the node state from Node B to Node D, i.e., repairing the abnormality of inspection item F2.

[0094] Node A and node C can be connected via F2(x1), and node C and node D can be connected via F1(x1) and F1(x2). The node state can be converted from node A to node D by first executing F2(x1) to convert the node state from node A to node C, i.e., repairing the abnormality of inspection item F2, and then executing any one of the repair scripts F1(x1) and F1(x2) to convert the node state from node C to node D, i.e., repairing the abnormality of inspection item F1.

[0095] In some possible implementations, when the inspection result of a certain inspection item is abnormal, it can be repaired by calling the corresponding repair script. However, when the inspection results of multiple inspection items are abnormal, it is uncertain whether the combination of multiple corresponding repair scripts can directly solve the abnormalities of all inspection items. There is a situation where new abnormalities are generated again after executing the repair script. Figure 4As shown, the node state of node C indicates that the inspection result of inspection item F1 is abnormal and the inspection result of inspection item F2 is normal. Under the node state of node C, if the F1(x2) repair script of inspection item F1 is executed, the node state may be converted from node C to node B instead of node D. That is, there may be a scenario where the inspection result of inspection item F2 is abnormal again, rather than the ideal situation where the node state is converted to the situation where both inspection item F1 and inspection item F2 are repaired.

[0096] Therefore, in the process of establishing the virtual machine repair decision model, various inspection item abnormality scenarios can be simulated and combined in the simulated virtual machine operating environment, for example, (1,0,1), (0,1,0), etc. When the node state changes, different repair script combinations can be enumerated, and different repair script combinations can be used to try to repair various inspection item abnormality scenarios in different repair script execution orders. The repair script combination corresponding to the situation where a new abnormality is generated after executing the repair script can be removed, for example, the repair script combination that generates a loop can be removed, and the structure of the virtual machine repair decision model finally generated is directed acyclic (that is, each path in the virtual machine repair decision model points from one node to another node, there is no circular path, starting from any node, you can move forward along the direction of the path without returning to the node or entering an infinite loop).

[0097] The above mainly introduces the structure and establishment method of the virtual machine repair decision model. The following introduces the specific implementation method of the policy decision module to decide whether there is a repair strategy through the virtual machine repair decision model, combined with the structure of the virtual machine repair decision model.

[0098] Specifically, according to the combination of abnormal inspection results, the target state node corresponding to the combination can be determined from the virtual machine repair decision model, and according to the corresponding relationship between the abnormal state node and the repair strategy, the target repair strategy corresponding to the target state node can be determined.

[0099] For example, the structure of the virtual machine repair decision model is as follows: Figure 5 As shown in the example, the virtual machine repair decision model has three inspection items, namely F1, F2 and F3. F1 has two repair scripts, namely F1(x1) and F2(x1), F2 has one repair script F1(x2), and F3 has three repair scripts, namely F1(x3), F2(x3) and F3(x3).

[0100] For example, when the fault discovery module is inspecting, it is found that the inspection results of inspection items F1 and F3 are normal, and the inspection result of inspection item F2 is abnormal. According to the combination of abnormal inspection results, the node with a node state of (1,0,1) is determined as the target state node from the virtual machine repair decision model. Then, through the virtual machine repair decision model, according to the correspondence between the state node and the repair strategy, it can be decided that the target repair strategy is to execute the F1(x2) and F3(x3) repair scripts, so that the node state is converted from (1,0,1) to (1,1,1), thereby realizing the repair of the abnormality of inspection item F2.

[0101] For another example, when the fault discovery module is inspecting, it is found that the inspection result of inspection item F1 is normal, and the inspection results of inspection items F2 and F3 are both abnormal. That is, based on the abnormal inspection result, the node with a node state of (0,1,1) is determined to be the target state node. Then, the virtual machine repair decision model determines that there is no repair strategy, and it can be output that there is no available repair plan.

[0102] In some possible implementations, when it is determined that there are multiple corresponding repair strategies for the target state node based on the correspondence between the state node and the repair strategy, that is, when the virtual machine repair decision model decides that there are multiple repair strategies, the virtual machine repair decision model can output the repair strategy with the least number of repair scripts among the multiple repair strategies, that is, the repair strategy with the least number of repair scripts among the multiple repair strategies is determined as the target repair strategy, so as to execute the repair strategy finally output to repair the anomaly of the inspection item.

[0103] Exemplarily, for example, when the fault discovery module inspects, it is found that the inspection results of inspection items F1, F2, and F3 are all abnormal, that is, the node state of the target state node is determined to be (0, 0, 0). Through the virtual machine repair decision model, according to the correspondence between the state node and the repair strategy, it can be decided that there are multiple repair strategies, namely, repair strategy A, repair strategy B, and repair strategy C. Repair strategy A includes 3 repair scripts, that is, repair strategy A needs to execute 3 repair scripts, repair strategy B includes 2 repair scripts, and repair strategy C includes 1 repair script. The virtual machine repair decision model can output the repair strategy with the least repair scripts among the multiple repair strategies, repair strategy C, and then execute repair strategy C to repair the abnormality of the inspection item. It should be noted that the repair strategy with the least repair scripts among the multiple repair strategies may not be unique. For example, the repair scripts included in repair strategies B and repair strategies C are the least among the multiple repair strategies decided, for example, 1, then the virtual machine repair decision model can randomly output a repair strategy from repair strategy B and repair strategy C for subsequent execution.

[0104] In some possible implementation methods, when it is determined that there are multiple corresponding repair strategies for the target state node based on the correspondence between the state node and the repair strategy, that is, when the virtual machine repair decision model decides that there are multiple repair strategies, the virtual machine repair decision model can output the repair strategy with the highest weight value among the multiple repair strategies to repair the abnormality of the inspection item, that is, the repair strategy with the highest weight value among the multiple repair strategies is determined as the target repair strategy, so as to execute the final output repair strategy to repair the abnormality of the inspection item. This implementation method is different from the above implementation method in that this implementation method can take into account the execution completion time, security, and cost of each repair strategy, and finally execute the repair strategy with the highest security, shortest execution completion time, and lowest cost among the multiple repair strategies, thereby improving the security and repair efficiency of fault repair and reducing the cost of fault repair.

[0105] Specifically, the repair strategy may be a combination of executing multiple repair scripts. During the execution of each repair script, the corresponding execution completion time, security, cost and other issues need to be considered. Therefore, the execution completion time coefficient, security coefficient and cost coefficient of each repair script can be set in advance. The smaller the execution completion time coefficient, the shorter the execution completion time of the repair script. The larger the security coefficient, the higher the security of executing the repair script. The smaller the cost coefficient, the lower the cost of executing the repair script.

[0106] Furthermore, the weight value of the repair strategy can be calculated as follows:

[0107] Assume that for a repair strategy, n repair scripts need to be executed, and the execution completion time coefficient of each repair script is t i1 ,t i2 ,...,t in , the cost coefficients are c i1 ,c i2 ,...,c in , the safety factors are s i1 ,s i2 ,...,s in .

[0108] Formula (1) can be used to calculate the weight value of each repair strategy, taking the i-th repair strategy including n repair scripts as an example:

[0109]

[0110] Among them, W i is the weight value of the i-th repair strategy, w t ,w c ,w sThey are the weights corresponding to the execution completion time, cost and security respectively, and can be set according to actual needs, for example, set to 0.3, 0.3, 0.4 respectively. The larger the weight value, the higher the security of the repair strategy, the shorter the execution completion time and the lower the cost.

[0111] Here, the ratio of the execution completion time weight of the repair script in formula (1) to the preset execution completion time coefficient, that is, w t / t ij The value of is called the first weight, which is the ratio of the cost weight of the repair script to the preset cost coefficient, that is, w c / c ij The value of is called the second weight, which is the product of the safety weight of the repair script and the preset safety factor, that is, w s ×s ij The value of is called the third weight, and the sum of the first weight, the second weight, and the third weight of the same repair script is determined as the weight value of the repair script. i If there are n repair scripts in the system, it is necessary to determine the weight value of each repair script, and then i The weight value of the i-th repair strategy is determined by the ratio n of the sum of the weight values ​​of each repair script and the number of repair scripts.

[0112] The following is an introduction with specific examples.

[0113] Exemplarily, the inspection items include F1, F2 and F3. F1 is whether the CPU utilization of the virtual machine is abnormal, F2 is whether there is an io wait timeout in the virtual machine storage log, and F3 is whether there is an abnormal traffic alarm.

[0114] When it is determined that inspection item F1 is abnormal, the corresponding repair script can be, for example, CPU hot-add and virtual machine restart. When inspection item F2 is abnormal, the corresponding repair script can be, for example, virtual machine migration to local storage, adjustment of virtual machine disk IO priority and virtual machine memory hot-add. When inspection item F3 is abnormal, the corresponding repair script can be, for example, adding abnormal traffic IP to the firewall blacklist and adjusting virtual machine network card traffic configuration. Then, according to F1, F2 and F3 and the corresponding repair scripts, the following can be constructed: Figure 6 The virtual machine repair decision model shown.

[0115] Furthermore, the execution completion time coefficient, safety coefficient and cost coefficient of each repair script may be preset, as shown in Table 1.

[0116] Table 1

[0117]

[0118]

[0119] It should be noted that the time in the above table refers to the completion time coefficient of the execution of the corresponding repair script, the cost refers to the cost coefficient of the corresponding repair script, and the safety refers to the safety coefficient of the corresponding repair script.

[0120] Through the inspection items F1, F2 and F3 in Table 1 and the corresponding repair scripts and the completion time coefficients corresponding to the repair scripts, the cost coefficients and the cost coefficients can be constructed as follows: Figure 7 The virtual machine repair decision model shown. Figure 7 The virtual machine repair decision model includes calculating the weight value of each repair script according to formula (1). When the virtual machine repair decision model determines that the virtual machine fails and has multiple repair strategies, the virtual machine repair decision model can calculate the repair strategy with the highest weight value according to the weight values ​​of the repair scripts included in each repair strategy, and then output the repair strategy with the highest weight value to repair the virtual machine failure.

[0121] like Figure 7 As shown, for example, when the fault discovery module inspects, it finds that the inspection results of inspection items F1, F2 and F3 in the virtual machine are all abnormal, that is, the node status is (0,0,0), and the actual faults generated by the corresponding virtual machine are virtual machine iowait timeout, abnormal CPU utilization and abnormal traffic alarm.

[0122] Through the virtual machine repair decision model, it can be determined that there are 4 repair strategies that can convert the node state from (0,0,0) to (1,1,1), that is, to repair the anomalies of inspection items F1, F2 and F3. The 4 repair strategies are repair strategy a, repair strategy b, repair strategy c and repair strategy d.

[0123] Repair strategy a is to execute the following repair scripts in sequence: CPU hot add -> virtual machine memory hot add -> add abnormal traffic source IP to the firewall blacklist.

[0124] Repair strategy b is to execute the following repair scripts in sequence:

[0125] CPU hot add -> virtual machine memory hot add -> adjust virtual machine network card traffic configuration.

[0126] Repair strategy c is to execute the following repair scripts in sequence:

[0127] Restart the virtual machine -> add the abnormal traffic source IP to the firewall blacklist.

[0128] Repair strategy d is to execute the following repair scripts in sequence:

[0129] Restart the virtual machine -> adjust the virtual machine network card traffic configuration.

[0130] Exemplarily, the weight value of each repair script can be calculated according to formula (1), for example, the weight value of CPU hot add is 2.2, the weight value of virtual machine memory hot add is 2.05, the weight value of adding abnormal traffic source IP to the firewall blacklist is 2.6, the weight value of adjusting virtual machine network card traffic configuration is 3.2, and the weight value of restarting virtual machine is 0.52. Then, the weight value of the corresponding repair strategy is calculated according to the weight value of each repair script. For example, the weight value of repair strategy a is the ratio of the sum of the weight values ​​of the three repair scripts of CPU hot add (taking 2.2 as an example), virtual machine memory hot add (taking 2.05 as an example), and adding abnormal traffic source IP to the firewall blacklist (taking 2.6 as an example) to the number of repair scripts 3, which is calculated to be 2.28. Similarly, the weight value of repair strategy b is calculated to be 2.48, the weight value of repair strategy c is calculated to be 1.56, and the weight value of repair strategy b is calculated to be 1.86. Then, the computing device can execute the repair strategy with the highest weight value, that is, repair strategy b, to repair the abnormality of the inspection item.

[0131] S104: Execute the repair strategy to repair the fault of the virtual machine.

[0132] The computing device can call the policy execution module to execute the repair policy and repair the fault of the virtual machine.

[0133] For example, Figure 8 As shown, the computing device can first execute step S801 to determine whether the virtual machine system status is in a startup state. If so, the computing device can execute step S802, call the policy execution module to execute the repair strategy output by the virtual machine repair decision model, and repair the fault of the faulty virtual machine. Then, step S105 can be executed to determine whether the virtual machine fault is repaired successfully.

[0134] If not, that is, when it is determined that the system state of the virtual machine is in the shutdown state, step S803 is executed, and the rescue system can be used to boot the virtual machine to start, and then step S804 is executed. When the target virtual machine is booted in the startup state, the repair script in the repair strategy output by the virtual machine repair decision model is executed to repair the fault of the faulty virtual machine, thereby repairing the virtual machine when it is in the startup state, which can reduce the risk of service interruption and data loss caused by virtual machine shutdown or restart. Then step S105 can be executed to determine whether the virtual machine fault is successfully repaired, where the rescue system refers to an operating system or software collection that can provide emergency repair or recovery services when a computer or virtual machine system encounters a problem. The rescue system can be used in a variety of situations, such as when the virtual machine operating system cannot be started, encounters hardware failure, system files are damaged, and security checks are required.

[0135] S105: Determine whether the fault of the virtual machine is repaired successfully.

[0136] The computing device can call the policy execution module to execute the repair policy, and after repairing the fault of the faulty virtual machine, determine whether the fault of the faulty virtual machine is repaired successfully. If the repair is successful, it is determined that the fault repair of the faulty virtual machine is completed, and then the fault repair method of the virtual machine in this embodiment ends.

[0137] If the repair fails, step S106 may be executed to restore the target virtual machine snapshot.

[0138] S106: Restore the target virtual machine snapshot.

[0139] In some possible implementations, the step of calling the policy execution module to execute the repair policy and repairing the virtual machine fault, i.e., step S104, can be performed in the constructed virtual machine snapshot, that is, the virtual machine in the created virtual machine snapshot is repaired, which can reduce the risk of directly operating the faulty virtual machine (target virtual machine).

[0140] Then, step S105 may be executed to determine whether the fault of the virtual machine is repaired successfully. It should be noted that the virtual machine here may also be a virtual machine in a virtual machine snapshot.

[0141] If the virtual machine in the virtual machine snapshot is repaired successfully, the repair strategy can be used to repair the faulty virtual machine, or a new virtual machine can be created based on the repaired virtual machine in the virtual machine snapshot (this newly created virtual machine can be called the fault repair virtual machine), and then the business of the faulty virtual machine can be migrated to the new virtual machine.

[0142] If the repair of the virtual machine in the virtual machine snapshot fails, step S106 can be executed to restore the virtual machine snapshot, that is, executing step S106 can also restore the state and data of the virtual machine in the virtual machine snapshot after repair to be consistent with the state and data of the virtual machine saved in the virtual machine snapshot before repair.

[0143] In the present application, the computing device can call the fault discovery module to screen the pre-set inspection items to determine whether the virtual machine has a fault. After determining that there are abnormal inspection items, the computing device can call the policy decision module to determine whether there is a repair strategy. The policy decision module can use the virtual machine repair decision model to decide the optimal solution, and then the computing device can call the policy execution module to execute the solution (repair strategy) output by the decision module, thereby realizing automatic detection and repair of virtual machine faults, thereby improving the efficiency of virtual machine fault repair.

[0144] In order to increase the applicable virtual machine fault repair scenarios of the above embodiments and improve the efficiency of repairing virtual machine faults, the present application provides another embodiment, which is referred to as Embodiment 2. The difference between Embodiment 2 and Embodiment 1 is that in addition to the modules included in Embodiment 1, Embodiment 2 can also include a policy optimization module. When the policy decision module is called to determine that there is no repair strategy, the policy optimization module can be called to receive the manually input repair method, so that the repair strategy of the virtual machine repair decision model can be optimized. The method of Embodiment 2 can also be applied to computing devices, specifically as follows: Fig. 9 As shown, including:

[0145] S901: Determine whether a virtual machine failure occurs.

[0146] S902: Create a virtual machine snapshot.

[0147] S903: Determine whether there is a repair strategy.

[0148] After determining that there are abnormal inspection items, the computing device can call the policy decision module to determine whether there is a repair strategy. The policy decision module can repair the decision model through the virtual machine and decide on the optimal solution.

[0149] When it is determined through the virtual machine repair decision model that there is a repair strategy, step S904 is executed to execute the repair strategy to repair the fault of the virtual machine.

[0150] When it is determined through the virtual machine repair decision model that there is no repair strategy, step S907 may be performed to optimize the repair strategy of the virtual machine repair decision model.

[0151] For example, Figure 7 As shown, the fault discovery module found that the inspection results of inspection items F1 and F2 in the virtual machine were abnormal during the inspection, and the inspection results of F3 were normal, that is, the node status was (0,0,1), and the actual faults of the corresponding virtual machine were virtual machine iowait timeout and CPU utilization abnormality. In some cases, the abnormal inspection results of inspection items F1 and F2 may be caused by other factors or parameter indicators. Therefore, executing the corresponding repair script may not be able to repair the abnormal inspection items. For example, executing repair scripts such as CPU hot add and restarting the virtual machine cannot repair the abnormal inspection item F1, and executing repair scripts such as migrating the virtual machine to local storage, adjusting the virtual machine disk io priority and virtual machine memory hot add cannot repair the abnormal inspection item F2. Figure 7 The virtual machine repair decision model of the structure shown cannot determine a repair strategy for converting the node state from (0,0,1) to (1,1,1), so step S907 can be executed.

[0152] S904: Execute the repair strategy to repair the fault of the virtual machine.

[0153] S905: Determine whether the fault of the virtual machine is repaired successfully.

[0154] S906: Restore the virtual machine snapshot.

[0155] The principles of steps S901 - S906 in this embodiment are similar to those of steps S101 - 106 in the first embodiment, and are not described in detail here.

[0156] S907: Optimize the repair strategy of the virtual machine repair decision model.

[0157] The computing device can call the decision optimization module to optimize the repair strategy of the virtual machine repair decision model.

[0158] Specifically, the computing device may first execute Fig.10 S1011 in the step of sending a message requesting manual intervention.

[0159] After the user (relevant personnel) completes the fault repair of the virtual machine, the input information fed back by the user can be received, and the repair strategy information corresponding to the abnormal inspection result of the target virtual machine can be extracted based on the user input information (for example, new inspection items and corresponding repair scripts and completion time coefficients, cost coefficients, and safety coefficients can be fed back to the decision optimization module). Then, the correspondence between the abnormal inspection results and the repair strategies can be updated based on the repair strategy information (for example, the decision model can be adjusted and trained), and the target repair strategy can be determined from the updated correspondence.

[0160] For example, the inspection results of inspection items F1 and F2 are abnormal, that is, the actual fault of the virtual machine is the virtual machine iowait timeout and the abnormal CPU utilization rate is caused by the full load of the virtual machine CPU. Therefore, the relevant personnel can use the iowait timeout and the abnormal CPU utilization rate caused by the full load of the virtual machine CPU as the new inspection item F4. The new inspection item and the corresponding repair script and the completion time coefficient, cost coefficient and safety coefficient can be shown in Table 2:

[0161] Table 2

[0162]

[0163] The computing device can execute Fig.10 Step S1012 in the above method calls the decision optimization module to add the new inspection item to the inspection item set according to the user's feedback information and receives the corresponding repair script. Then, step S1013 is executed to trigger the offline simulation environment, and then step S1014 is executed to adjust and train the decision model in the offline simulation environment.

[0164] Specifically, the offline simulation environment here is an environment composed of virtual machines and high-computing-power server clusters. In this environment, virtual machines with various fault states after the new inspection items are added are constructed, and the decision model with the new repair script corresponding to the new inspection items is used to perform fault repair processing. If the decision model can output the corresponding repair strategy, it is determined that the adjustment training of the decision model is completed, and the decision model can be determined as the final decision model of the decision model adjustment training.

[0165] If the decision model with the new repair script corresponding to the new inspection item cannot decide on a repair solution, you can apply for manual intervention to continue to supplement the repair script in the decision model. After the supplement, rebuild the virtual machine of various fault states after the new inspection item is added, and use the decision model to re-perform the fault repair process. Repeat the iterative process until a decision model that can output a repair solution is obtained, which can indicate that the decision model has covered the new inspection item, and then complete the adjustment and training of the decision model.

[0166] For example, the iowait timeout caused by the full load of the virtual machine CPU and the abnormal CPU utilization are taken as new inspection items F4 and then the decision model is trained. After the training, for example, the following can be formed: Fig.11 The virtual machine repair decision model shown.

[0167] like Fig.11 As shown, when the virtual machine repair decision model determines that the inspection results of inspection items F1, F2 and F4 are abnormal, the inspection results of F3 are normal, and the node state is (0,0,1,0), that is, the fault of the virtual machine is the iowait timeout and abnormal CPU utilization caused by the full load of the virtual machine CPU. There can be two repair scripts in the virtual machine repair decision model, namely, increasing the CPU time slice size and improving the CPU scheduling priority of read and write operations. For example, the weight of the CPU time slice size is 1.6, and the weight of improving the CPU scheduling priority of read and write operations is 2.05. The virtual machine repair decision model can output a high weight, that is, improving the CPU scheduling priority of read and write operations. The repair script is the final one, and then the virtual machine fault can be repaired by the repair script output by the virtual machine repair decision model. In this way, the optimization of the virtual machine repair decision model is realized through artificial mediation feedback and model adjustment training, the virtual machine fault repair scenario applicable to the virtual machine repair decision model is increased, and the efficiency of virtual machine fault repair is improved.

[0168] The following is an introduction to the hardware structure of the computing device of this application, see Fig.12 , Fig.12 A schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application.

[0169] like Fig.12As shown, the computing device 1000 includes a processor 1010 and a memory 1020; wherein the memory 1020 stores computer instructions, and the processor 1010 is used to execute the computer instructions, so that the server 1000 executes the virtual machine fault repair method shown above.

[0170] In some embodiments, the processor 1010 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.

[0171] In some embodiments, the memory 1020 may be a volatile memory or a non-volatile memory, such as a register. Specifically, a volatile memory refers to a memory in which the data stored inside will be lost when the power supply is interrupted. Among them, the volatile memory is mainly a random access memory (RAM), including a static random access memory (SRAM) and a dynamic random access memory (DRAM). A non-volatile memory refers to a memory in which the data stored inside will not be lost even if the power supply is interrupted. Common non-volatile memories include read-only memory (ROM), optical disks, magnetic disks, solid-state hard disks, and various memory cards based on flash memory technology.

[0172] In some embodiments, the memory 1020 has executable codes, and the memory 1010 executes the codes to implement the search for server models.

[0173] The communication interface 1030 is used for communicating with the outside. For example, the communication interface 1030 is used as a first interface to realize communication with a real device.

[0174] The bus can be a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of understanding, Fig.12 It is represented by only one thick line, but it does not mean that there is only one bus or one type of bus.

[0175] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on a computing device, the computing device is caused to execute the fault repair method of the above-mentioned virtual machine. The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc. The computer-readable storage medium includes instructions that instruct the computing device to execute the fault repair method of the above-mentioned virtual machine.

[0176] In some possible implementations, the computing device may be a server, which is of course only an example and does not constitute any limitation.

[0177] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

[0178] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for repairing a virtual machine fault, characterized in that: The method comprises: Inspect the inspection items in the target virtual machine to obtain the inspection results corresponding to each inspection item; In the case where there is an abnormal inspection result in the inspection result indicating that the target virtual machine has a fault, determining the target repair strategy based on the corresponding relationship between the abnormal inspection result and the repair strategy; The repair script in the target repair strategy is executed to repair the fault existing in the target virtual machine.

2. The method according to claim 1, characterized in that When the inspection results contain the abnormal inspection result, determining a target repair strategy based on the corresponding relationship includes: In the case where there is an abnormal inspection result in the inspection result indicating that the target virtual machine has a fault, a target state node corresponding to the combination is determined from a virtual machine repair decision model according to a combination of the abnormal inspection results; the virtual machine repair decision model includes a plurality of state nodes, and the state nodes are used to represent the fault condition of the virtual machine; According to the correspondence between the state node and the repair strategy, the target repair strategy corresponding to the target state node is determined.

3. The method according to claim 2, characterized in that The target state node corresponds to a plurality of repair strategies, and determining the target repair strategy corresponding to the target state node according to the correspondence between the state node and the repair strategy includes: Determine multiple repair strategies corresponding to the target state node according to the corresponding relationship between the state node and the repair strategy; The repair strategy with the highest weight value among the multiple repair strategies is determined as the target repair strategy. The higher the weight value, the higher the security of executing the corresponding repair strategy, the shorter the execution completion time and the lower the cost.

4. The method according to claim 3, characterized in that One of the repair strategies includes at least one repair script, each of which is pre-set with a corresponding execution completion time weight, cost weight, and safety weight. The weight value of the repair strategy is obtained by: Determine a first weight, a second weight, and a third weight for each repair script; wherein the first weight is a ratio of the execution completion time weight of the repair script to a preset execution completion time coefficient, the second weight is a ratio of the cost weight of the repair script to a preset cost coefficient, and the third weight is a product of the safety weight of the repair script and a preset safety coefficient; Determine the sum of the first weight, the second weight, and the third weight of the same repair script as the weight value of the repair script; Determine the sum of weight values ​​of each repair script in the same repair strategy and the number of repair scripts in the repair strategy; The ratio of the sum of the weight values ​​of the repair scripts in the same repair strategy to the number of the repair scripts is determined as the weight value of the repair strategy.

5. The method according to claim 1, characterized in that The determining of the target repair strategy based on the correspondence between the abnormal inspection result and the repair strategy includes: Query whether there is a repair strategy corresponding to the abnormal inspection result of the target virtual machine; If no repair strategy corresponding to the abnormal inspection result of the target virtual machine is found, receiving user input information; Extracting repair strategy information corresponding to the abnormal inspection result of the target virtual machine according to the user input information; The corresponding relationship between the abnormal inspection result and the repair strategy is updated based on the repair strategy information, and the target repair strategy is determined from the updated corresponding relationship.

6. The method according to claim 1, characterized in that The executing the repair script in the target repair strategy to repair the fault existing in the target virtual machine includes: When the target virtual machine is in a startup state, executing a repair script in the target repair strategy to repair the fault existing in the target virtual machine; When the target virtual machine is in a shutdown state, the target virtual machine is guided to start up, and when the target virtual machine is guided to be in a startup state, a repair script in the target repair strategy is executed to repair the fault existing in the target virtual machine.

7. The method according to any one of claims 1 to 6, characterized in that: Before inspecting the inspection items in the target virtual machine and obtaining the inspection results corresponding to each inspection item, the method further includes: In the event that the target virtual machine fails, a target virtual machine snapshot of the target virtual machine is constructed.

8. The method according to claim 7, characterized in that The executing the repair script in the target repair strategy to repair the fault existing in the target virtual machine includes: Execute the repair script in the target repair strategy to repair the fault existing in the virtual machine in the target virtual machine snapshot; When the fault of the virtual machine is repaired successfully, repairing the fault of the target virtual machine using the repair script in the target repair strategy; Or, a fault recovery virtual machine is created according to the target virtual machine snapshot, and the services of the target virtual machine are migrated to the fault recovery virtual machine.

9. The method according to claim 8, characterized in that The method further comprises: In the event that the fault repair of the virtual machine fails, the target virtual machine snapshot is restored.

10. A server, characterized in that: including memory and processor; a memory and a processor, the memory being coupled to the processor; The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 9.