Virtual machine migration method and device, equipment, medium and program product

By using blockchain technology to acquire and evaluate host machine health status information and select suitable target hosts for virtual machine migration, the problem of low resource utilization when host machines fail in cloud computing platforms is solved, and the rational use and maximization of resources are achieved.

CN121567584APending Publication Date: 2026-02-24CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511786229.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-01
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

When a host machine fails in a cloud computing platform, existing virtual machine migration methods cannot guarantee the maximization of host machine resource utilization, which can easily lead to unreasonable migration.

Method used

The health status information of each host machine is obtained through blockchain technology. Based on the health status information, a target host machine that is compatible with the faulty host machine is selected, and the virtual machine is migrated to the target host machine. The compatibility is evaluated by considering factors such as the amount of remaining resources, network status and fault details.

Benefits of technology

It enables reasonable migration in the event of host failure, maximizes host resource utilization, and avoids resource waste and unreasonable migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567584A_ABST
    Figure CN121567584A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual machine migration method and device, equipment, a medium and a program product. The method comprises the following steps: in response to a failure of a first host machine in a block chain, obtaining health state information of each host machine in the block chain; each host machine comprises a first host machine and at least one second host machine except the first host machine; selecting a target host machine matched with the first host machine from at least one second host machine according to the health state information of each host machine; migrating the virtual machine running in the first host machine to the target host machine; according to the virtual machine migration method, the health state information of each host machine in the block chain is considered, and the target host machine adaptive to the first host machine is selected according to the health state information of each host machine, so that the failed host machine can be reasonably migrated, and the utilization rate of host machine resources is maximized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a virtual machine migration method, apparatus, device, medium, and program product. Background Technology

[0002] In the field of computer technology, an increasing number of enterprise users are choosing cloud computing for data processing. However, as cloud computing platforms grow in scale and their business becomes more complex, their operation and maintenance services also face significant challenges.

[0003] When a fault occurs in one of the host machines in the host machine cluster corresponding to the cloud computing platform, the scheduler will usually migrate or evacuate the cloud hosts on the host machine to any normal host machine.

[0004] However, the above migration methods cannot guarantee the maximization of host machine resource utilization, which can easily lead to unreasonable migration of the host machine. Summary of the Invention

[0005] Therefore, it is necessary to provide a virtual machine migration method, apparatus, device, medium, and program product to address the above-mentioned technical problems, which can reasonably migrate a faulty host machine.

[0006] Firstly, this application provides a virtual machine migration method, including:

[0007] In response to a failure of the first host in the blockchain, the system obtains the health status information of each host in the blockchain; each host includes the first host and at least one second host other than the first host.

[0008] Based on the health status information of each host machine, select a target host machine that is compatible with the first host machine from at least one second host machine;

[0009] Migrate the virtual machine running on the first host machine to the target host machine.

[0010] In one embodiment, the health status information includes the number of remaining resources; accordingly, based on the health status information of each host machine, selecting a target host machine adapted to the first host machine from at least one second host machine includes: selecting a second host machine from at least one second host machine whose second remaining resource number is not less than the first remaining resource number, based on the first remaining resource number of the first host machine and the second remaining resource number of each second host machine, as the target host machine adapted to the first host machine.

[0011] In one embodiment, the health status information further includes: network status information and fault details information; correspondingly, selecting a second host machine from at least one second host machine with a second remaining resource quantity not less than a first remaining resource quantity as a target host machine adapted to the first host machine includes: selecting a second host machine from at least one second host machine with a second remaining resource quantity not less than a first remaining resource quantity as a candidate host machine; for each candidate host machine, determining the compatibility between the candidate host machine and the first host machine based on the network status information and fault details information corresponding to the candidate host machine; and selecting the candidate host machine with a compatibility that meets the preset requirements as the target host machine adapted to the first host machine.

[0012] In one embodiment, determining the compatibility between the candidate host and the first host based on the network status information and fault details information corresponding to the candidate host includes: determining the compatibility weight information corresponding to the candidate host based on the network status information and fault details information corresponding to the candidate host; and determining the compatibility between the candidate host and the first host based on the compatibility weight information and the difference between the second remaining resource quantity and the first remaining resource quantity of the candidate host.

[0013] In one embodiment, selecting a second host machine whose second remaining resource quantity is not less than the first remaining resource quantity from the at least one second host machine as a target host machine adapted to the first host machine, based on the first remaining resource quantity of the first host machine and the second remaining resource quantity of at least one second host machine, includes: determining the total remaining resource quantity of the at least one second host machine based on the second remaining resource quantity of the at least one second host machine; and selecting a second host machine whose second remaining resource quantity is not less than the first remaining resource quantity from the at least one second host machine as a target host machine adapted to the first host machine when the total remaining resource quantity is not less than the first remaining resource quantity.

[0014] In one embodiment, obtaining the health status information of each host in the blockchain includes: receiving the health status information of each host sent by a third host with accounting authority among at least one second host; the health status information of each host is sent to the third host by at least one other second host other than the third host after obtaining the corresponding health status information from the block address of each host, or the third host obtains it from the block address corresponding to each host.

[0015] Secondly, this application also provides a virtual machine migration apparatus, comprising:

[0016] The acquisition module is used to acquire the health status information of each host in the blockchain in response to a failure of the first host in the blockchain; each host includes the first host and at least one second host other than the first host.

[0017] The selection module is used to select a target host machine that is compatible with the first host machine from at least one second host machine based on the health status information of each host machine.

[0018] The migration module is used to migrate virtual machines running on the first host machine to the target host machine.

[0019] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0020] In response to a failure of the first host in the blockchain, the system obtains the health status information of each host in the blockchain; each host includes the first host and at least one second host other than the first host.

[0021] Based on the health status information of each host machine, select a target host machine that is compatible with the first host machine from at least one second host machine;

[0022] Migrate the virtual machine running on the first host machine to the target host machine.

[0023] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0024] In response to a failure of the first host in the blockchain, the system obtains the health status information of each host in the blockchain; each host includes the first host and at least one second host other than the first host.

[0025] Based on the health status information of each host machine, select a target host machine that is compatible with the first host machine from at least one second host machine;

[0026] Migrate the virtual machine running on the first host machine to the target host machine.

[0027] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0028] In response to a failure of the first host in the blockchain, the system obtains the health status information of each host in the blockchain; each host includes the first host and at least one second host other than the first host.

[0029] Based on the health status information of each host machine, select a target host machine that is compatible with the first host machine from at least one second host machine;

[0030] Migrate the virtual machine running on the first host machine to the target host machine.

[0031] The aforementioned virtual machine migration method, apparatus, device, medium, and program product, in response to a failure of the first host machine in the blockchain, acquires the health status information of each host machine in the blockchain; each host machine includes the first host machine and at least one second host machine other than the first host machine; based on the health status information of each host machine, a target host machine adapted to the first host machine is selected from at least one second host machine; the virtual machine running on the first host machine is migrated to the target host machine; in the above process, the health status information of each host machine in the blockchain is considered, and a target host machine adapted to the first host machine is selected based on the health status information of each host machine, which can reasonably migrate the failed host machine and ensure the maximization of host machine resource utilization. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a flowchart illustrating a virtual machine migration method in one embodiment;

[0034] Figure 2 This is a flowchart illustrating the steps for selecting a target host in one embodiment;

[0035] Figure 3 This is a flowchart illustrating the target host selection steps in another embodiment;

[0036] Figure 4 This is a flowchart illustrating the target host machine selection steps in yet another embodiment;

[0037] Figure 5 This is a flowchart illustrating the steps for obtaining health status information in one embodiment;

[0038] Figure 6 This is a flowchart illustrating the virtual machine migration method in another embodiment;

[0039] Figure 7 This is a flowchart illustrating a method for writing health status information in one embodiment;

[0040] Figure 8 This is a structural block diagram of a virtual machine migration device in one embodiment;

[0041] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0043] In one exemplary embodiment, such as Figure 1 As shown, a virtual machine migration method is provided, including the following steps:

[0044] S110, in response to a failure of the first host in the blockchain, obtains the health status information of each host in the blockchain; each host includes the first host and at least one second host other than the first host.

[0045] In this context, the first host machine can be understood as the host machine that has experienced a malfunction. The second host machine can be understood as the host machine that has not experienced a malfunction.

[0046] Among them, health status information can be understood as information used to indicate the health status of the host machine.

[0047] In some embodiments, health status information may include at least one of the following: network status information, fault details information, and remaining resource quantity.

[0048] Among them, network status information can include network fluctuations.

[0049] The fault details information can be understood as at least one of the following: the number of faults that have occurred and the duration between the last fault and the current time.

[0050] The remaining resources can be understood as at least one of the remaining Central Processing Units (CPUs) (such as remaining utilization) and the remaining memory (such as remaining gigabytes).

[0051] Understandably, a smaller network state value indicates less network fluctuation, meaning a more stable network. A larger value for the number of failures indicates more failures. A larger value for the duration between the last failure and the current time indicates that the last failure occurred further back in time.

[0052] In some embodiments, health status information can be obtained based on the storage address of each host in the blockchain.

[0053] S120: Based on the health status information of each host machine, select a target host machine that is compatible with the first host machine from at least one second host machine.

[0054] In some embodiments, the health status information of each second host machine can be compared with the health status information of the first host machine, and at least one second host machine whose health status information matches that of the first host machine can be selected as the target host machine.

[0055] In some embodiments, the second host machine that is most compatible with the first host machine can be selected from at least one second host machine as the target host machine.

[0056] S130 migrates the virtual machine running on the first host machine to the target host machine.

[0057] The virtual machine may include the cloud host in the first host machine.

[0058] In some embodiments, virtual machines on a first host machine can be evacuated to a target host machine using whole-machine evacuation technology. Whole-machine evacuation technology can be understood as a technology that automatically migrates virtual machines running on a physical host (such as a host machine) to other healthy hosts when the physical host (such as a hardware failure or crash) or other emergency occurs, in order to ensure business continuity and service availability.

[0059] The virtual machine migration method described above takes into account the health status information of each host in the blockchain. Based on the health status information of each host, a target host that is compatible with the first host is selected. This allows for the reasonable migration of faulty hosts and ensures the maximum utilization of host resources.

[0060] Based on the technical solutions of the above embodiments, this application also provides another optional embodiment, in which the health status information is refined into the remaining resource quantity; correspondingly, the target host selection step of S120 is refined.

[0061] See Figure 2 The steps for selecting the target host machine, as shown, include:

[0062] S210, based on the first remaining resource quantity of the first host machine and the second remaining resource quantity of each second host machine, select a second host machine from at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity, as the target host machine adapted to the first host machine.

[0063] In some embodiments, for each second host machine, the second remaining resource quantity of the second host machine can be compared with the first remaining resource quantity of the first host machine. If the second remaining resource quantity is not less than the first remaining resource quantity, the corresponding second host machine can be used as the target host machine adapted to the first host machine.

[0064] Through the above embodiments, at least one target host machine with a corresponding second remaining resource quantity not less than the first remaining resource quantity can be selected from at least one second host machine.

[0065] To maximize host resource utilization, a target host most compatible with the first host can be selected. Based on the technical solutions of the above embodiments, this application also provides another optional embodiment. In this optional embodiment, the health status information can be refined into remaining resource quantity, network status information, and fault details information. Correspondingly, the target host selection step in S210 can be further refined.

[0066] See Figure 3 The steps for selecting the target host machine, as shown, include:

[0067] S310, select a second host machine from at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity, as a candidate host machine.

[0068] In some embodiments, for each second host machine, the second remaining resource quantity of the second host machine can be compared with the first remaining resource quantity of the first host machine. If the second remaining resource quantity is not less than the first remaining resource quantity, the corresponding second host machine can be used as a candidate host machine.

[0069] In some embodiments, the selected candidate host may include at least one.

[0070] S320 determines the compatibility between the candidate host and the first host based on the network status information and fault details of each candidate host.

[0071] Here, adaptability can be understood as the degree of adaptation. Optionally, adaptability can be the evacuation adaptability index.

[0072] In some embodiments, for each candidate host, the adaptation weight information corresponding to the candidate host can be determined based on the network status information and fault details information corresponding to the candidate host; the adaptation degree between the candidate host and the first host can be determined based on the adaptation weight information and the difference between the second remaining resource quantity and the first remaining resource quantity of the candidate host.

[0073] In some embodiments, the adaptation weight information corresponding to the candidate host can be determined based on the network status value, the number of failures that have occurred, and the duration between the last failure time and the current time in the network status information corresponding to the candidate host.

[0074] In some embodiments, the smaller the network state value, the longer the time between the last failure and the current time, and the fewer the number of failures, the smaller the determined adaptation weight information can be.

[0075] In some embodiments, the adaptation weight information can be obtained according to the following formula:

[0076]

[0077] in, This represents the adaptation weight information corresponding to the c-th candidate host. This represents the network status information corresponding to the c-th candidate host. This represents the number of failures that have occurred for the c-th candidate host. This represents the duration between the last time the c-th candidate host experienced a failure and the current time.

[0078] In some embodiments, the fit can be obtained according to the following formula:

[0079]

[0080] in, This represents the compatibility between the c-th candidate host and the first host. This represents the second remaining resource quantity corresponding to the c-th candidate host; This indicates the number of remaining resources corresponding to the first host machine.

[0081] S330 selects candidate hosts that meet preset adaptation requirements as target hosts that are compatible with the first candidate host.

[0082] In some embodiments, candidate host machines with a compatibility score less than a preset compatibility score threshold can be selected as target host machines adapted to the first host machine. In some embodiments, candidate host machines with the lowest compatibility score can be selected as target host machines adapted to the first host machine, i.e.: ;in, This represents the candidate host machine with the lowest compatibility. This indicates taking the minimum value.

[0083] It is understandable that the smaller the adaptation weight information, the smaller the difference between the second remaining resource quantity and the first remaining resource quantity, that is, the selected target host is the second host with the second remaining resource quantity being closer to the first remaining resource quantity, and the unselected second host is the host with the larger second remaining resource quantity and the smaller the remaining resource fragmentation, thereby maximizing the utilization of host resources.

[0084] In order to improve the efficiency of target host selection, based on the technical solutions of the above embodiments, this application also provides another optional embodiment, in which the target host selection step of S210 can be further refined.

[0085] See Figure 4 The steps for selecting the target host shown include:

[0086] S410, determine the total number of remaining resources of at least one second host based on the second remaining resource quantity of at least one second host.

[0087] In some embodiments, the second remaining resource quantities of at least one second host machine can be summed to obtain the total remaining resource quantity of at least one second host machine.

[0088] In some embodiments, the total amount of remaining resources can be obtained according to the following formula:

[0089]

[0090] in, This represents the total amount of remaining resources on at least one secondary host machine; This indicates the amount of remaining resources on each secondary host machine.

[0091] S420, if the total number of remaining resources is not less than the first number of remaining resources, select a second host machine from at least one second host machine whose second number of remaining resources is not less than the first number of remaining resources, and use it as the target host machine adapted to the first host machine.

[0092] In some embodiments, when the total number of remaining resources is not less than the first number of remaining resources, the process of selecting a second host machine from at least one second host machine whose second number of remaining resources is not less than the first number of remaining resources as the target host machine adapted to the first host machine can be found in [reference needed]. Figure 2 or Figure 3 The implementation process of these steps will not be elaborated here.

[0093] It is understandable that if the total number of remaining resources is less than the first number of remaining resources, then at least one of the second host machines does not have a corresponding second host machine with a second number of remaining resources not less than the first number of remaining resources, meaning a target host machine cannot be selected. Therefore, in the above embodiment, the implementation method of selecting a target host machine is only executed when the total number of remaining resources is not less than the first number of remaining resources, which can avoid the waste of computing resources caused by continuing to select a target host machine when the total number of remaining resources is less than the first number of remaining resources.

[0094] Based on the technical solutions of the above embodiments, this application also provides another optional embodiment, in which the health status information acquisition step of S110 can be further refined.

[0095] See Figure 5 The steps for obtaining health status information shown include:

[0096] S510, receive health status information of each host machine sent by at least one third host machine with accounting authority in the second host machine; the health status information of each host machine is sent to the third host machine by at least one other second host machine other than the third host machine after obtaining the corresponding health status information from the block address of each host machine, or the third host machine obtains it from the block address corresponding to each host machine.

[0097] The accounting permission can be understood as the permission to write the health status information of each host machine into the corresponding block address.

[0098] It is understood that, in some embodiments, after the first host machine in the blockchain fails, at least one other second host machine (excluding the third host machine) can obtain the corresponding health status information from the block addresses of each host machine, and then send it to the third host machine, which in turn sends it to the execution entity of the virtual machine migration method. Alternatively, after the first host machine in the blockchain fails, the third host machine obtains the corresponding health status information from the block addresses of each host machine, and then sends the corresponding health status information of each host machine to the execution entity of the virtual machine migration method.

[0099] In some embodiments, the health status information stored in the block address corresponding to each host machine may be written by a third host machine.

[0100] In some embodiments, during blockchain updates, each host machine in the blockchain can compete for the right to record transactions based on a consensus algorithm. The third host machine with the right to record transactions can write the health status information of each host machine into the corresponding block address, as follows:

[0101]

[0102] in, This indicates the identification information of each host machine; Indicates the first One host machine; Indicates the first The block address of each host machine; Indicates the first The amount of resources used by each host machine; Indicates the first The total amount of resources for each host machine; Indicates the first Network status information of each host machine; Indicates the first The number of failures that have occurred on each host machine; Indicates the first The duration between the last time a host machine failed and the current time.

[0103] Based on the technical solutions of the above embodiments, this application also provides another optional embodiment, in which the above virtual machine migration method is described in detail.

[0104] See Figure 6 The virtual machine migration method shown includes:

[0105] S610, in response to a failure of the first host in the blockchain, receives health status information of each host in the blockchain from at least one third host with accounting authority in at least one second host.

[0106] The second host is a host in the blockchain that has not experienced any failures.

[0107] The health status information includes the amount of remaining resources, network status information, and fault details.

[0108] The health status information of each host machine is either obtained by at least one other second host machine (excluding the third host machine) from the block address of each host machine and then sent to the third host machine, or obtained by the third host machine from the block address of each host machine.

[0109] S620, determine the total number of remaining resources of at least one second host based on the second remaining resource quantity of at least one second host.

[0110] S630: Determine whether the total number of remaining resources is greater than or equal to the first remaining resource quantity of the first host machine; if yes, execute S640; otherwise, end.

[0111] S640: For each second host machine, determine whether the second remaining resource quantity of the second host machine is greater than or equal to the first remaining resource quantity; if so, then the second host machine is selected as a candidate host machine and S650 is executed; otherwise, the process ends.

[0112] S650 determines the adaptation weight information for each candidate host based on the network status information and fault details of the candidate host.

[0113] S660, based on the adaptation weight information and the difference between the second remaining resource quantity and the first remaining resource quantity of the candidate host, determine the adaptation degree between the candidate host and the first host.

[0114] S670 selects candidate host machines that meet preset adaptation requirements as target host machines that are adapted to the first host machine.

[0115] The S680 migrates virtual machines running on the first host machine to the target host machine.

[0116] Based on the technical solutions of the above embodiments, this application also provides another optional embodiment, in which the above virtual machine migration method is described in detail.

[0117] like Figure 7 The method for writing health status information, as shown, determines whether a host machine has joined the blockchain. If so, multiple host machines compete for the right to record the block through a consensus algorithm. Then, it checks if the consensus algorithm has completed its calculation. If so, the host machine that wins the right to record the latest block can publish information such as CPU and memory size, network status, number of failures, and time since the last failure to the corresponding block address of each host machine through a smart contract. All host machines can then obtain the health status information of other host machines through the blockchain. Taking a blockchain with three host machines as an example, the health status information published by the three host machines after joining the blockchain is shown in Table 1.

[0118] Table 1

[0119]

[0120] In the event of a failure in host machine C, the corresponding compatibility of the other two host machines can be calculated using the health status information and compatibility calculation formulas for each host machine in Table 1, as shown in Table 2.

[0121] Table 2

[0122]

[0123] As shown in Table 2, host machine A is more suitable for migrating host machine C. Therefore, host machine A can be used as the target host machine for adapting to host machine C.

[0124] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0125] Based on the same inventive concept, this application also provides a virtual machine migration apparatus for implementing the virtual machine migration method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more virtual machine migration apparatus embodiments provided below can be found in the limitations of the virtual machine migration method described above, and will not be repeated here.

[0126] In one exemplary embodiment, such as Figure 8 As shown, a virtual machine migration apparatus is provided, including: an acquisition module 810, a selection module 820, and a migration module 830, wherein:

[0127] The acquisition module 810 is used to acquire the health status information of each host in the blockchain in response to a failure of the first host in the blockchain; each host includes the first host and at least one second host other than the first host.

[0128] The selection module 820 is used to select a target host machine that is compatible with the first host machine from at least one second host machine based on the health status information of each host machine.

[0129] Migration module 830 is used to migrate virtual machines running on the first host machine to the target host machine.

[0130] In one embodiment, the health status information includes the number of remaining resources; accordingly, the selection module 820 is specifically used to: select a second host machine from at least one second host machine whose second remaining resource number is not less than the first remaining resource number, based on the first remaining resource number of the first host machine and the second remaining resource number of each second host machine, as the target host machine adapted to the first host machine.

[0131] In one embodiment, the health status information further includes network status information and fault details information; correspondingly, the selection module 820 is specifically used to: select a second host machine from at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity as a candidate host machine; for each candidate host machine, determine the compatibility between the candidate host machine and the first host machine based on the network status information and fault details information corresponding to the candidate host machine; and select the candidate host machine whose compatibility meets the preset requirements as the target host machine that is compatible with the first host machine.

[0132] In one embodiment, module 820 is specifically used to: determine the adaptation weight information corresponding to the candidate host based on the network status information and fault details information corresponding to the candidate host; and determine the degree of adaptation between the candidate host and the first host based on the adaptation weight information and the difference between the second remaining resource quantity and the first remaining resource quantity of the candidate host.

[0133] In one embodiment, the selection module 820 is specifically used to: determine the total number of remaining resources of at least one second host machine based on the second remaining resource quantity of at least one second host machine; and, if the total number of remaining resources is not less than the first remaining resource quantity, select a second host machine from the at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity as the target host machine adapted to the first host machine.

[0134] In one embodiment, the acquisition module 810 is specifically used to: receive health status information of each host machine sent by a third host machine with accounting authority in at least one second host machine; the health status information of each host machine is sent to the third host machine by at least one other second host machine other than the third host machine after obtaining the corresponding health status information from the block address of each host machine, or the third host machine obtains it from the block address corresponding to each host machine.

[0135] The modules in the aforementioned virtual machine migration device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.

[0136] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data such as health status information. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a virtual machine migration method.

[0137] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0138] In one exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the virtual machine migration method provided in any of the above embodiments or to implement the following steps:

[0139] In response to a failure of the first host in the blockchain, the system obtains the health status information of each host in the blockchain; each host includes the first host and at least one second host other than the first host.

[0140] Based on the health status information of each host machine, select a target host machine that is compatible with the first host machine from at least one second host machine;

[0141] Migrate the virtual machine running on the first host machine to the target host machine.

[0142] In one embodiment, the health status information includes the number of remaining resources; accordingly, when the processor executes the computer program, it also performs the following steps: based on the first remaining resource quantity of the first host machine and the second remaining resource quantity of each second host machine, select a second host machine from at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity as the target host machine adapted to the first host machine.

[0143] In one embodiment, the health status information further includes: network status information and fault details information; when the processor executes the computer program, it also performs the following steps: selecting a second host machine from at least one second host machine whose corresponding second remaining resource quantity is not less than the first remaining resource quantity as a candidate host machine; for each candidate host machine, determining the compatibility between the candidate host machine and the first host machine based on the network status information and fault details information corresponding to the candidate host machine; and selecting the candidate host machine whose compatibility meets the preset requirements as the target host machine that is compatible with the first host machine.

[0144] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining the adaptation weight information corresponding to the candidate host based on the network status information and fault details information corresponding to the candidate host; and determining the degree of adaptation between the candidate host and the first host based on the adaptation weight information and the difference between the second remaining resource quantity and the first remaining resource quantity of the candidate host.

[0145] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining the total number of remaining resources of at least one second host machine based on the second remaining resource quantity of at least one second host machine; if the total number of remaining resources is not less than the first remaining resource quantity, selecting a second host machine from the at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity as the target host machine adapted to the first host machine.

[0146] In one embodiment, when the processor executes the computer program, it further implements the following steps: receiving health status information of each host machine sent by at least one third host machine with accounting authority in at least one second host machine; the health status information of each host machine is sent to the third host machine by at least one other second host machine other than the third host machine after obtaining the corresponding health status information from the block address of each host machine, or the third host machine obtains it from the block address corresponding to each host machine.

[0147] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements the steps of the virtual machine migration method provided in any of the above embodiments, or implements the following steps:

[0148] In response to a failure of the first host in the blockchain, the system obtains the health status information of each host in the blockchain; each host includes the first host and at least one second host other than the first host.

[0149] Based on the health status information of each host machine, select a target host machine that is compatible with the first host machine from at least one second host machine;

[0150] Migrate the virtual machine running on the first host machine to the target host machine.

[0151] In one embodiment, the health status information includes the number of remaining resources; correspondingly, when the computer program is executed by the processor, it also performs the following steps: based on the first remaining resource number of the first host machine and the second remaining resource number of each second host machine, select a second host machine from at least one second host machine whose second remaining resource number is not less than the first remaining resource number as the target host machine adapted to the first host machine.

[0152] In one embodiment, the health status information further includes: network status information and fault details information; when the computer program is executed by the processor, it also performs the following steps: selecting a second host machine from at least one second host machine whose corresponding second remaining resource quantity is not less than the first remaining resource quantity as a candidate host machine; for each candidate host machine, determining the compatibility between the candidate host machine and the first host machine based on the network status information and fault details information corresponding to the candidate host machine; and selecting the candidate host machine whose compatibility meets the preset requirements as the target host machine that is compatible with the first host machine.

[0153] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the adaptation weight information corresponding to the candidate host based on the network status information and fault details information corresponding to the candidate host; and determining the degree of adaptation between the candidate host and the first host based on the adaptation weight information and the difference between the second remaining resource quantity and the first remaining resource quantity of the candidate host.

[0154] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the total number of remaining resources of at least one second host machine based on the second remaining resource quantity of at least one second host machine; if the total number of remaining resources is not less than the first remaining resource quantity, selecting a second host machine from the at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity as the target host machine adapted to the first host machine.

[0155] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: receiving health status information of each host machine sent by a third host machine with accounting authority in at least one second host machine; the health status information of each host machine is sent to the third host machine by at least one other second host machine other than the third host machine after obtaining the corresponding health status information from the block address of each host machine, or the third host machine obtains it from the block address corresponding to each host machine.

[0156] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the virtual machine migration method provided in any of the above embodiments, or implements the following steps:

[0157] In response to a failure of the first host in the blockchain, the system obtains the health status information of each host in the blockchain; each host includes the first host and at least one second host other than the first host.

[0158] Based on the health status information of each host machine, select a target host machine that is compatible with the first host machine from at least one second host machine;

[0159] Migrate the virtual machine running on the first host machine to the target host machine.

[0160] In one embodiment, the health status information includes the number of remaining resources; correspondingly, when the computer program is executed by the processor, it also performs the following steps: based on the first remaining resource number of the first host machine and the second remaining resource number of each second host machine, select a second host machine from at least one second host machine whose second remaining resource number is not less than the first remaining resource number as the target host machine adapted to the first host machine.

[0161] In one embodiment, the health status information further includes: network status information and fault details information; when the computer program is executed by the processor, it also performs the following steps: selecting a second host machine from at least one second host machine whose corresponding second remaining resource quantity is not less than the first remaining resource quantity as a candidate host machine; for each candidate host machine, determining the compatibility between the candidate host machine and the first host machine based on the network status information and fault details information corresponding to the candidate host machine; and selecting the candidate host machine whose compatibility meets the preset requirements as the target host machine that is compatible with the first host machine.

[0162] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the adaptation weight information corresponding to the candidate host based on the network status information and fault details information corresponding to the candidate host; and determining the degree of adaptation between the candidate host and the first host based on the adaptation weight information and the difference between the second remaining resource quantity and the first remaining resource quantity of the candidate host.

[0163] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the total number of remaining resources of at least one second host machine based on the second remaining resource quantity of at least one second host machine; if the total number of remaining resources is not less than the first remaining resource quantity, selecting a second host machine from the at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity as the target host machine adapted to the first host machine.

[0164] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: receiving health status information of each host machine sent by a third host machine with accounting authority in at least one second host machine; the health status information of each host machine is sent to the third host machine by at least one other second host machine other than the third host machine after obtaining the corresponding health status information from the block address of each host machine, or the third host machine obtains it from the block address corresponding to each host machine.

[0165] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0166] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0167] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A virtual machine migration method, characterized in that, The method includes: In response to a failure of the first host machine in the blockchain, the health status information of each host machine in the blockchain is obtained; each host machine includes the first host machine and at least one second host machine other than the first host machine. Based on the health status information of each host machine, a target host machine that is compatible with the first host machine is selected from the at least one second host machine; The virtual machine running on the first host machine is migrated to the target host machine.

2. The method according to claim 1, characterized in that, The health status information includes the amount of remaining resources; Accordingly, selecting a target host machine compatible with the first host machine from the at least one second host machine based on the health status information of each host machine includes: Based on the first remaining resource quantity of the first host machine and the second remaining resource quantity of each second host machine, a second host machine with a second remaining resource quantity not less than the first remaining resource quantity is selected from the at least one second host machine as the target host machine adapted to the first host machine.

3. The method according to claim 2, characterized in that, The health status information also includes: network status information and fault details information; Accordingly, selecting a second host machine from the at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity as a target host machine adapted to the first host machine includes: Select a second host machine from the at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity, as a candidate host machine; For each candidate host, the compatibility between the candidate host and the first host is determined based on the network status information and fault details information corresponding to the candidate host. Candidate host machines that meet the preset adaptation requirements are selected as target host machines that are compatible with the first host machine.

4. The method according to claim 3, characterized in that, The step of determining the compatibility between the candidate host and the first host based on the network status information and fault details information corresponding to the candidate host includes: Based on the network status information and fault details information corresponding to the candidate host, the adaptation weight information corresponding to the candidate host is determined; The compatibility between the candidate host and the first host is determined based on the adaptation weight information and the difference between the second remaining resource quantity and the first remaining resource quantity of the candidate host.

5. The method according to claim 2, characterized in that, The step of selecting a second host machine from the at least one second host machine whose second remaining resource quantity is not less than the first remaining resource quantity, based on the first remaining resource quantity of the first host machine and the second remaining resource quantity of the at least one second host machine, as the target host machine adapted to the first host machine includes: Based on the second remaining resource quantity of the at least one second host machine, determine the total remaining resource quantity of the at least one second host machine; If the total number of remaining resources is not less than the first number of remaining resources, a second host machine with a second number of remaining resources not less than the first number of remaining resources is selected from the at least one second host machine as the target host machine adapted to the first host machine.

6. The method according to any one of claims 1 to 5, characterized in that, Obtaining the health status information of each host in the blockchain includes: The system receives health status information of each host machine from a third host machine that has accounting permissions among the at least one second host machine; the health status information of each host machine is sent to the third host machine by at least one other second host machine other than the third host machine after obtaining the corresponding health status information from the block address of each host machine, or the third host machine obtains it from the block address corresponding to each host machine.

7. A virtual machine migration device, characterized in that, The device includes: The acquisition module is used to acquire the health status information of each host in the blockchain in response to a failure of the first host in the blockchain; each host includes the first host and at least one second host other than the first host. The selection module is used to select a target host machine that is compatible with the first host machine from the at least one second host machine based on the health status information of each host machine. The migration module is used to migrate virtual machines running on the first host machine to the target host machine.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.