Fault processing method, device and equipment
By obtaining the scheduling policies and affinity groups of virtual machines and selecting the appropriate physical host for migration, the problem of not taking priority into account when creating and migrating virtual machines in the cloud computing platform, and improving high availability and business stability.
Patent Information
- Application Number
- CN202411555489.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-11-04
AI Technical Summary
In cloud computing platforms, virtual machines are not prioritized when creating and migrating virtual machines, which can have a significant impact on business when failure occurs.
By obtaining the scheduling policy of the pending host and its affiliated affinity group, selecting the appropriate physical host for evacuation and migration, ensuring that the high-priority virtual machines are not on the same physical host, reducing the impact of failure on the business.
It improves the high availability of cloud computing platforms, reduces the impact on business when a single physical host fails, and ensures the stability of high-priority virtual machines.
Smart Images

Figure CN119065888A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to fault handling methods, devices, and equipment. Background Art
[0002] A cloud computing platform is a platform that uses cloud computing software to form a resource pool of one or more hardware devices to provide computing, storage and network resources. High availability is an important feature of the cloud computing platform. High availability means that when a physical host in the host cluster of the cloud computing platform fails and can no longer provide services, the virtual machines (also called cloud hosts) running on the physical host will be evacuated and migrated to other normal physical hosts to ensure the normal use of the virtual machines and unaffected business.
[0003] In related high-availability technologies, virtual machines are not scheduled according to priority when they are created, and multiple high-priority virtual machines may be scheduled to the same physical host. When the physical host fails, there are many high-priority core virtual machines, and their failure recovery time is also longer, which has a greater impact on the business. In addition, during migration, the priority scheduling of each virtual machine is still not taken into consideration. During migration, high-priority core virtual machines may still be migrated to the same physical host. If the physical host fails again after migration, it will again have a greater impact on the business. Summary of the Invention
[0004] The main purpose of this application is to provide a fault handling method, device and equipment, which aims to solve the technical problem that the priority of virtual machines is not taken into consideration when creating and migrating virtual machines in a cloud computing platform, which will cause a significant impact on the business of the cloud computing platform when a fault occurs.
[0005] To achieve the above objectives, the present application proposes a fault handling method, which includes: Obtaining a scheduling policy and an affinity group corresponding to a pending host, wherein the pending host is a virtual machine set in a faulty host, and the faulty host is a physical host that has a fault in a host cluster, and the scheduling policy is an affinity policy or an anti-affinity policy; Selecting a target physical host from a host cluster based on the scheduling policy and the affinity group to which it belongs; Migrate the host to be processed to the target physical host.
[0006] In a possible implementation of the present application, at least one virtual machine is provided in the faulty host; The step of obtaining the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs includes: Obtaining the host priority corresponding to each virtual machine in the faulty host, where the host priority is used to represent the importance of each virtual machine; Sort the virtual machines in the faulty host based on the host priority and generate a host processing sequence; Extracting a host to be processed from the host processing sequence; Obtain the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs.
[0007] In a possible implementation of the present application, before obtaining the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs, the process further includes: Monitor the performance of each physical host in the host cluster; When any physical host in the host cluster is detected to have abnormal performance, the physical host with abnormal performance is used as a host to be judged; Get the historical exception count of the host to be judged; Updating the historical exception count to obtain a current exception count; If the current exception count is greater than the exception count threshold, the host to be judged is regarded as a faulty host; A host to be processed is determined based on the virtual machines in the faulty host.
[0008] In a possible implementation of the present application, obtaining the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs includes: Obtaining the host priority and / or policy identifier corresponding to the host to be processed, and obtaining the host identification information of the host to be processed; The scheduling policy corresponding to the host to be processed is determined according to the host priority and / or policy identifier, and the affinity group corresponding to the host to be processed is searched based on the host identification information.
[0009] In a possible implementation of the present application, selecting a target physical host from a host cluster based on the scheduling policy and the affinity group to which the host belongs includes: If the scheduling policy is an affinity policy, searching for candidate physical hosts in the host cluster that are configured with virtual machines belonging to the affinity group, and selecting a target physical host from the candidate physical hosts; or, If the scheduling policy is an anti-affinity policy, a candidate physical host in the host cluster that is not provided with any virtual machine belonging to the affinity group is searched, and a target physical host is selected from the candidate physical hosts.
[0010] In a possible implementation of the present application, after migrating the host to be processed to the target physical host, the method further includes: When the migration fails, a low-priority host among normal physical hosts in the host cluster is obtained, where the normal physical host is a physical host with normal performance in the host cluster; Building a host holding queue according to the low-priority host and putting the low-priority host on hold; After the processing is completed, the process returns to the step of selecting a target physical host in the host cluster based on the scheduling policy and the affinity group to which the host belongs.
[0011] In a possible implementation of the present application, the step of putting the low-priority host on hold includes: The device resources occupied by the low-priority host are released, and the host disk data of the low-priority host is saved.
[0012] In a possible implementation of the present application, after migrating the host to be processed to the target physical host, the method further includes: Extracting a host to be restored from the host hold queue and obtaining cluster resource information of the host cluster; If the cluster resource information meets the recovery resource requirements of the host to be recovered, performing an anti-holding process on the host to be recovered; When the processing is completed, the process returns to the step of extracting the host to be restored from the host hold queue and obtaining cluster resource information of the host cluster.
[0013] In addition, to achieve the above objectives, the present application also proposes a fault handling device, which includes: An acquisition module is used to obtain a scheduling policy corresponding to a host to be processed and an affinity group to which it belongs, wherein the host to be processed is a virtual machine set in a faulty host, and the faulty host is a physical host that has a fault in a host cluster, and the scheduling policy is an affinity policy or an anti-affinity policy; A selection module, configured to select a target physical host from a host cluster based on the scheduling policy and the affinity group to which the host belongs; A migration module is used to migrate the host to be processed to the target physical host.
[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a fault handling device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the fault handling method described above.
[0015] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium, and when the computer program is executed by the processor, the steps of the fault handling method described above are implemented.
[0016] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the fault handling method described above are implemented.
[0017] One or more technical solutions proposed in this application have at least the following technical effects: Since scheduling will be performed based on the scheduling policy set when each virtual machine is created and the affinity group to which it belongs, and appropriate physical hosts will be selected for evacuation and migration, it can be ensured that high-priority virtual machines are not in the same physical host as much as possible, ensuring that when a single physical host fails, the impact on the business can be minimized as much as possible, thereby improving the high availability of the cloud computing platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] Figure 1 A flowchart of the first embodiment of the troubleshooting method of this application is provided; Figure 2 This is a schematic diagram of the functional modules of a fault handling device according to an embodiment of the present application; Figure 3 A schematic diagram of the cloud host creation process according to an embodiment of the present application; Figure 4 A schematic diagram of creating a group for hosts according to an embodiment of the present application; Figure 5 A flowchart of the second embodiment of the troubleshooting method of this application is provided; Figure 6 This is a schematic diagram of the overall fault handling process of an embodiment of the present application; Figure 7 A schematic diagram of a process for restoring a suspended host according to an embodiment of the present application; Figure 8 This is a schematic diagram of the module structure of the fault handling device according to an embodiment of the present application; Figure 9 Schematic diagram of the device structure of the hardware operating environment involved in the fault handling method in the embodiment of the present application.
[0021] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0022] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0023] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0024] Based on this, the present application embodiment provides a fault handling method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the fault handling method of this application.
[0025] In this embodiment, the fault handling method includes steps S10 to S30: Step S10: Obtain the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs.
[0026] It should be noted that the executing entity of this embodiment can be a cloud computing platform, or a fault handling device set in the cloud computing platform, or a fault handling device that is independent of the cloud computing platform but can monitor and control the cloud computing platform. The fault handling device can be a personal computer, server and other electronic devices, or other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment and the following embodiments, the fault handling method of this application is explained by taking the fault handling device as an example.
[0027] It should be noted that the host to be processed can be a virtual machine (also called a cloud host) configured on a faulty host. The faulty host is a physical host that has experienced a fault in a host cluster that constitutes a cloud computing platform. The scheduling policy can be an affinity policy or an anti-affinity policy. The affinity group corresponding to the host to be processed can be the affinity group to which the host to be processed is assigned.
[0028] Among them, the role of affinity groups varies depending on the scheduling policy. For example, if the scheduling policy is affinity, virtual machines assigned to the same affinity group will be set on the same physical host as much as possible; if the scheduling policy is anti-affinity, virtual machines assigned to the same affinity group will be assigned to different physical hosts as much as possible.
[0029] In a specific implementation, the affinity policy and the affinity group to which it belongs are set for a virtual machine when it is first created. For example, when a new virtual machine is added to a cloud computing platform, the corresponding affinity policy and affinity group need to be set for it when the virtual machine is created.
[0030] In a possible implementation of this embodiment, the scheduling policy may be set based on the host priority and / or the policy identifier. In this case, step S10 of this embodiment may include: Obtaining the host priority and / or policy identifier corresponding to the host to be processed, and obtaining the host identification information of the host to be processed; The scheduling policy corresponding to the host to be processed is determined according to the host priority and / or policy identifier, and the affinity group corresponding to the host to be processed is searched based on the host identification information.
[0031] It should be noted that a corresponding scheduling policy can be set for each virtual machine. In order to distinguish the scheduling policies of each virtual machine, a corresponding policy identifier can be set for each virtual machine. The scheduling policy corresponding to the virtual machine can be distinguished by the policy identifier. For example: if the policy identifier is 0, the scheduling policy is determined to be an affinity policy; if the policy identifier is 1, the scheduling policy is determined to be an anti-affinity policy.
[0032] In actual application, the more anti-affinity policies are applied, the more difficult it is to schedule virtual machines and determine the physical host on which the virtual machines should be set. Therefore, the scheduling policy of high-priority virtual machines can be set to anti-affinity policy. For example, high-priority virtual machines will automatically join anti-affinity and set up anti-affinity groups for them to ensure that high-priority virtual machines are scheduled on different hosts as much as possible to reduce the impact of failures.
[0033] In this case, there is no need to use the policy identifier, but instead the scheduling policy of the host to be processed can be determined directly based on the host priority corresponding to the host to be processed. For example: if the host priority is greater than level s, the scheduling policy is determined to be an anti-affinity policy; if the host priority is less than or equal to level s, the scheduling policy is determined to be an affinity policy, where s is the preset priority threshold.
[0034] Of course, in some cases, some high-priority virtual machines may need to be in the same physical host as other high-priority virtual machines due to business needs. In order to ensure that this situation can be handled, the host priority can be combined with the policy identifier to determine the scheduling policy. For example: first determine whether the host priority is greater than level s. If it is less than or equal to level s, the scheduling policy is determined to be an affinity policy; if it is greater than level s, further detect the policy identifier. If the policy identifier is 0, the scheduling policy is determined to be an affinity policy. If the policy identifier is 1, the scheduling policy is determined to be an anti-affinity policy.
[0035] Step S20: Select a target physical host from the host cluster based on the scheduling policy and the affinity group to which it belongs.
[0036] It should be noted that the target physical host may be a migration target when migrating the host to be processed.
[0037] In actual use, based on the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs, it can be determined which part of the virtual machines the host to be processed should be on the same physical host or which part of the virtual machines should be on different physical hosts. Based on this, the physical hosts in the host cluster that can currently be selected as migration targets can be determined and selected as the target physical host.
[0038] There may be multiple physical hosts that can be selected as the migration target of the host to be processed. In this case, a random selection method can be adopted to select one as the target physical host, or a physical host with the lowest current load can be selected as the target physical host.
[0039] In a possible implementation of the present application, in order to ensure reasonable selection of the target physical host, step S20 in this embodiment may include: If the scheduling policy is an affinity policy, searching for candidate physical hosts in the host cluster that are configured with virtual machines belonging to the affinity group, and selecting a target physical host from the candidate physical hosts; or, If the scheduling policy is an anti-affinity policy, a candidate physical host in the host cluster that is not provided with any virtual machine belonging to the affinity group is searched, and a target physical host is selected from the candidate physical hosts.
[0040] It should be noted that if the scheduling policy of the host to be processed is an affinity policy, it means that the virtual machine needs to be on the same physical host as the virtual machines in the affinity group as much as possible. At this time, you can search the host cluster for physical hosts that are equipped with virtual machines belonging to the affinity group, and use the found physical hosts as candidate physical hosts, and then select one of them as the target physical host.
[0041] Among them, when selecting, one can be randomly selected from the candidate physical hosts as the target physical host, or the candidate physical host with the largest number of virtual machines belonging to the affinity group can be selected as the target physical host. Of course, the physical host with the lowest current load (such as the lowest CPU resource occupancy ratio, the lowest memory occupancy ratio, or the lowest combined CPU and memory occupancy ratio) among the candidate physical hosts can also be selected as the target physical host.
[0042] In actual use, if the scheduling policy of the host to be processed is an anti-affinity policy, it means that the virtual machine needs to be on a physical host that is as different as possible from the virtual machines in the affinity group. Therefore, a physical host in the host cluster that does not have any virtual machine belonging to the affinity group to which it belongs can be searched, and the found physical host can be used as the candidate physical host.
[0043] When selecting, random selection or selection of the candidate physical host with the lowest current load may be adopted as the target physical host.
[0044] In specific implementations, in some cases, due to the limitation on the number of physical hosts in the host cluster corresponding to the cloud computing platform, all physical hosts may be set with candidate physical hosts for virtual machines belonging to their affinity groups. At this time, in order to ensure that the hosts to be processed can be migrated, the physical host with the least number of virtual machines belonging to its affinity groups can be used as the candidate physical host.
[0045] Step S30: Migrate the host to be processed to the target physical host.
[0046] It should be noted that after the target physical host is determined, the host to be processed can be migrated to the target physical host.
[0047] During the migration process, if the data in the failed physical host where the host to be processed was originally located can be read, the host data of the host to be processed (such as disk data, configuration data, etc.) can be read from it, and migration can be performed based on the read host data; if the data in the failed physical host where the host to be processed was originally located cannot be read, the most recent backup data of the host to be processed can be obtained, and migration can be performed based on the backup data.
[0048] In a possible implementation of this embodiment, in order to avoid misjudgment of a fault, before step S10 in this embodiment, the following steps may be further included: Monitor the performance of each physical host in the host cluster; When any physical host in the host cluster is detected to have abnormal performance, the physical host with abnormal performance is used as a host to be judged; Get the historical exception count of the host to be judged; Updating the historical exception count to obtain a current exception count; If the current exception count is greater than the exception count threshold, the host to be judged is regarded as a faulty host; A host to be processed is determined based on the virtual machines in the faulty host.
[0049] It should be noted that the judgment conditions for detecting physical host performance abnormalities can be pre-set by the administrator of the fault handling device, for example: the network speed is lower than the preset threshold, the CPU usage ratio is higher than the preset ratio, the response time is longer than the preset time, etc.
[0050] In actual use, since the network may fluctuate and the equipment calculation may be suddenly occupied, this situation may also lead to the detection of physical host performance abnormalities. If a fault is determined to occur after one detection, it may lead to misjudgment. In order to avoid this situation, each time an abnormality is detected, an abnormality count can be performed on the physical host. Therefore, when a performance abnormality is detected in any physical host in the host cluster, the physical host with the performance abnormality can be used as the host to be judged. Afterwards, the historical abnormality count of the host to be judged is obtained and then updated (such as adding 1. Of course, different values can also be updated according to the different types of abnormalities detected, such as adding 1 for network abnormalities and adding 2 for response abnormalities). The current abnormality count is determined, that is, the total number of times the physical host has been detected with performance abnormalities at the current moment. If the current abnormality count is greater than the abnormality count threshold, it means that the performance abnormality of the host to be judged has been detected multiple times. Therefore, the host to be judged can be regarded as a faulty host.
[0051] The host to be processed is determined according to the virtual machine in the faulty host, and one of the virtual machines set in the faulty host can be selected as the host to be processed.
[0052] For ease of understanding, now combined Figure 2 、 3 , 4 are used to illustrate, but do not limit this solution. Figure 2 This is a schematic diagram of the functional modules of the fault handling device of this embodiment. Figure 3 This is a schematic diagram of the cloud host creation process in this embodiment. Figure 4 A schematic diagram of grouping is created for the hosts in this embodiment.
[0053] like Figure 2 As shown, the fault handling device described in this embodiment may include four modules, which cooperate to perform fault handling. The four modules include: a host monitoring module, a fault handling module, a cloud host management module and a cloud host scheduling module.
[0054] The purpose of each module is as follows: Host monitoring module: This module checks the physical host, including the physical network, CPU, memory, power status, operating system, etc. It supports setting the interval and number of tests. To prevent network jitter, the physical host is considered faulty only when the number of consecutive failures exceeds N times. Fault handling module: After detecting a physical host failure, it performs fault handling operations on the cloud hosts (i.e., virtual machines) on the physical host, including obtaining priority, sorting by priority, and initiating evacuation instructions; Virtual machine management: Manage specific cloud hosts, including creating cloud hosts, setting priorities, and executing evacuation operations; Virtual machine scheduling: Schedule virtual machines, including the collection and update of total cluster resources, used resources, and remaining resources, as well as resource judgment during virtual machine creation and evacuation operations.
[0055] And as Figure 3 As shown, by default, cloud hosts are created using normal resource scheduling. You must specify an affinity group and set a corresponding affinity or anti-affinity policy. Scheduling is performed based on the configured scheduling policy. The cloud host creation process is as follows: create a cloud host and set its priority; create an anti-affinity group based on the priority; add high-priority cloud hosts to the corresponding anti-affinity group; and then create the cloud host using the specified anti-affinity group. You can schedule only high-priority cloud hosts using the anti-affinity policy, while ignoring low-priority cloud hosts.
[0056] Based on this, the settings of the created cloud host are distributed as follows Figure 4 As shown, high-priority hosts belonging to the same anti-affinity group will be set in different physical hosts. As shown in the figure, cloud host 1, cloud host 2 and cloud host 3 all have a corresponding host priority of 10 and are assigned to the same anti-affinity group (that is, they belong to the same affinity group), and the scheduling policy is the anti-affinity policy. At this time, cloud host 1, cloud host 2 and cloud host 3 will be scheduled to different physical hosts, as shown in the figure. Figure 4 As shown, cloud host 1 is in physical host 1, cloud host 2 is in physical host 2, and cloud host 3 is in physical host 3.
[0057] This embodiment provides a fault handling method. Since scheduling is performed based on the scheduling policy set when each virtual machine is created and the affinity group to which it belongs, and a suitable physical host is selected for evacuation and migration, it can ensure that high-priority virtual machines are not in the same physical host as much as possible, and ensure that when a single physical host fails, the impact on the business can be minimized as much as possible, thereby improving the high availability of the cloud computing platform.
[0058] In a feasible implementation, step S10 may include steps S101 to S104: Step S101: Obtain the host priority corresponding to each virtual machine in the faulty host; Step S102: Sort the virtual machines in the faulty host based on the host priority and generate a host processing sequence; Step S103: extracting a host to be processed from the host processing sequence; Step S104: Obtain the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs.
[0059] It should be noted that the faulty host may have at least one virtual machine configured. To ensure that high-priority virtual machines are migrated first and minimize the impact on services, the host priority represents the importance of each virtual machine, that is, its impact on services. The more impactful a virtual machine is, the higher its host priority. The administrator of the fault handling device can pre-set the host priority of each virtual machine based on actual service needs, such as when the virtual machine is created, or even before the virtual machine is actually created, when the creation requirement is met.
[0060] It is understandable that if there are multiple virtual machines set up in the faulty host, in order to ensure that high-priority virtual machines are migrated first, it is necessary to ensure that the virtual machines with higher host priorities are taken out of the sequence earlier. Therefore, the virtual machines in the faulty host can be sorted from high to low based on the host priority to generate a host processing sequence. Then, based on the sequence sorting in the host processing sequence, the virtual machines are sequentially extracted as hosts to be processed. Then, the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs are obtained.
[0061] Correspondingly, after step S30 in this embodiment, it is further possible to detect whether there are any unextracted elements in the host processing sequence. If so, the process returns to step S103.
[0062] Based on this implementation, when multiple virtual machines are set in a faulty host, high-priority virtual machines can be migrated first to minimize the impact on services.
[0063] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 5 After step S30, the fault handling method further includes steps S40 to S60: Step S40: When the migration fails, obtain a low-priority host from among the normal physical hosts in the host cluster.
[0064] It should be noted that the normal physical host may be a physical host with normal performance in the host cluster corresponding to the cloud computing platform, and the low-priority host may be a virtual machine whose corresponding host priority is lower than a preset low-priority threshold.
[0065] In actual use, after a physical host fails, the virtual machines on the failed physical host need to be evacuated and migrated to other normal physical hosts. Migration requires ensuring that there are sufficient resources on other normal physical hosts. Insufficient resources will cause evacuation failure, and the virtual machines cannot be restored normally, and will fail no matter how they are retried. At this time, in order to ensure that high-priority virtual machines can be restored first, you can try to put low-priority hosts among other normal physical hosts on hold first to release resources and ensure that high-priority virtual machines can be restored first through migration.
[0066] It can be understood that, in order to ensure that high-priority virtual machines are restored first, step S40 and subsequent steps of this embodiment can be executed only when the migration of a high-priority virtual machine fails. For example: the host priority is divided into levels 1-10, and step S40 and subsequent steps can be executed only when the migration of a virtual machine with a host priority greater than or equal to level 8 fails.
[0067] Step S50: constructing a host holding queue according to the low-priority host, and holding the low-priority host.
[0068] It should be noted that in order to ensure that high-priority virtual machines can be restored, sufficient resources need to be released. At this time, in order to ensure that the suspended virtual machines can be restored later, a host suspension queue can be constructed based on the low-priority hosts. The suspended virtual machines can be recorded through the host suspension queue, and the low-priority hosts can be suspended at the same time.
[0069] In a specific implementation, in order to ensure that the suspended virtual machine can be restored normally later, the step of suspending the low-priority host in this embodiment may include: The device resources occupied by the low-priority host are released, and the host disk data of the low-priority host is saved.
[0070] It should be noted that device resources may include CPU resources, memory resources, or other types of device resources. To ensure sufficient resources are available for recovering high-priority virtual machines, the device resources occupied by low-priority hosts may be released. To ensure that suspended virtual machines can be directly recovered later, data loss must be avoided. Therefore, the host disk data of low-priority hosts may be preserved.
[0071] Among them, when saving the host disk data of the low-priority host, it can be saved on the physical host where it is located to facilitate subsequent rapid recovery. Of course, since it is saved on the physical host, it may also occupy the storage resources of the physical host and cause the high-priority host to fail to recover. In order to avoid this situation, the host disk data of the low-priority host can also be sent to other devices or systems for storage. This embodiment does not limit this.
[0072] Step S60: After the processing is completed, return to the step of selecting a target physical host in the host cluster based on the scheduling policy and the affinity group.
[0073] It is understandable that after the suspension process is completed, certain resources will be released in each normal physical host in the host cluster. At this time, the migration recovery of the host to be processed can be attempted again. Therefore, the process can return to step S20.
[0074] In a possible implementation of this embodiment, in order to ensure that the suspended virtual machine can be restored normally later, after step S30 described in this embodiment, the following steps may be further included: Extracting a host to be restored from the host hold queue and obtaining cluster resource information of the host cluster; If the cluster resource information meets the recovery resource requirements of the host to be recovered, performing an anti-holding process on the host to be recovered; When the processing is completed, the process returns to the step of extracting the host to be restored from the host hold queue and obtaining cluster resource information of the host cluster.
[0075] It should be noted that the cluster resource information may include resource information of each physical host in the host cluster, such as CPU resources, memory resources, storage resources, etc. The recovery resource requirements of the host to be recovered may be the device resources required to restore the host to be recovered to normal operation.
[0076] It can be understood that if the cluster resource information meets the recovery resource requirements of the host to be recovered, it means that the host cluster has the ability to recover the host to be recovered at this time. Therefore, the host to be recovered can be de-suspended. After that, the host cluster continues to monitor whether it can recover the virtual machines in the host suspension queue. Therefore, it is possible to return to the step of extracting the host to be recovered from the host suspension queue and obtaining the cluster resource information of the host cluster.
[0077] The anti-hold processing may be a reverse operation of the holding processing, that is, creating a virtual machine according to the host disk data and allocating corresponding device resources thereto.
[0078] For ease of understanding, now combined Figure 6 and 7 This is for illustration only, but not for limitation. Figure 6 This is a schematic diagram of the overall fault handling process of this embodiment. Figure 7 Schematic diagram of the idle host recovery process in this embodiment.
[0079] like Figure 6As shown, the overall fault handling process is as follows: create a cloud host in the host cluster and set the priority of the cloud host. Then, monitor the host cluster and detect the faulty host. Then, sort the cloud hosts on the faulty host according to priority, and evacuate and migrate the cloud hosts on the faulty host to other normal physical hosts in sequence according to the priority queue. If the evacuation is successful, the process ends. If the evacuation fails, the low-priority cloud hosts on other normal nodes in the cluster can be put on hold, and an automatic put-aside queue (i.e., host put-aside queue) can be built. Then, the evacuation can be retried. When the number of retries exceeds the preset limit threshold, the process ends.
[0080] And later, as Figure 7 As shown, the previously shelved host can be restored, that is, the automatically shelved virtual machines can be monitored regularly. When the cluster resources of the host cluster are sufficient (for example, capacity expansion is performed, or other virtual machines are deleted to release resources), the automatically shelved virtual machines can be un-shelved to restore low-priority services.
[0081] This embodiment provides a fault handling method. When evacuation fails, some low-priority virtual machines can be put on hold to release some resources, and then the evacuation migration of the host to be processed can be re-attempted, thereby ensuring that the abnormal virtual machine can be recovered through migration and minimizing the impact on the business.
[0082] This application also provides a fault handling device, please refer to Figure 8 , the fault handling device includes: An acquisition module 10 is configured to acquire a scheduling policy corresponding to a pending host and an affinity group to which the pending host belongs, wherein the pending host is a virtual machine set in a faulty host, and the faulty host is a physical host that has failed in a host cluster, and the scheduling policy is an affinity policy or an anti-affinity policy; A selection module 20 is configured to select a target physical host from a host cluster based on the scheduling policy and the affinity group to which the host belongs; The migration module 30 is configured to migrate the host to be processed to the target physical host.
[0083] The fault handling device provided in this application, which utilizes the fault handling method of the aforementioned embodiment, can resolve the technical issue that related technologies fail to consider the priority of virtual machines when creating and migrating virtual machines on a cloud computing platform, resulting in a significant impact on the cloud computing platform's services when a fault occurs. Compared to the prior art, the beneficial effects of the fault handling device provided in this application are the same as those of the fault handling method of the aforementioned embodiment, and the other technical features of the fault handling device are the same as those disclosed in the aforementioned embodiment method, and are not further described here.
[0084] The present application provides a fault handling device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the fault handling method in the above-mentioned embodiment one.
[0085] Reference below Figure 9 , which shows a schematic diagram of the structure of a fault handling device suitable for implementing the embodiments of the present application. The fault handling device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 9 The fault handling device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0086] like Figure 9 As shown, the fault handling device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the fault handling device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to I / O interface 1006: input devices 1007, such as a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008, such as a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 1003, such as a magnetic tape or hard disk; and communication device 1009. Communication device 1009 can allow the fault handling device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a fault handling device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0087] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0088] The fault handling device provided in this application, utilizing the fault handling method of the aforementioned embodiment, can resolve the technical issue of related technologies failing to consider the priority of virtual machines when creating and migrating virtual machines on a cloud computing platform, resulting in significant impacts on the cloud computing platform's services when a fault occurs. Compared to the prior art, the beneficial effects of the fault handling device provided in this application are the same as those of the fault handling method provided in the aforementioned embodiment, and the other technical features of the fault handling device are the same as those disclosed in the aforementioned embodiment, and are not further elaborated here.
[0089] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0090] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0091] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, wherein the computer-readable program instructions are used to execute the fault handling method in the above embodiment.
[0092] The computer-readable storage medium provided herein may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, or infrared systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including, but not limited to, wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0093] The computer-readable storage medium may be included in the fault handling device, or may exist independently without being assembled into the fault handling device.
[0094] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the fault handling device, the fault handling device: obtains the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs, the host to be processed is a virtual machine set in the faulty host, the faulty host is a physical host that has a fault in the host cluster, and the scheduling policy is an affinity policy or an anti-affinity policy; selects a target physical host from the host cluster based on the scheduling policy and the affinity group to which it belongs; and migrates the host to be processed to the target physical host.
[0095] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0096] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0097] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0098] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned fault handling method. This computer-readable storage medium addresses the technical issue of related art failing to consider virtual machine priorities when creating and migrating virtual machines on a cloud computing platform, which can significantly impact the cloud computing platform's services when a fault occurs. Compared to existing technologies, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the fault handling method provided in the aforementioned embodiments, and are not further elaborated here.
[0099] The present application also provides a computer program product, comprising a computer program, which implements the steps of the above-mentioned fault handling method when executed by a processor.
[0100] The computer program product provided in this application can resolve the technical problem that related technologies fail to consider the priority of virtual machines when creating and migrating virtual machines on a cloud computing platform, resulting in significant impacts on the cloud computing platform's services when failures occur. Compared to existing technologies, the beneficial effects of the computer program product provided in this application are the same as those of the fault handling methods provided in the above-mentioned embodiments, and are not further elaborated here.
[0101] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A fault handling method, characterized in that: The method comprises: Obtaining a scheduling policy corresponding to a host to be processed and an affinity group to which it belongs, wherein the host to be processed is a virtual machine set in a faulty host, the faulty host is a physical host that fails in a host cluster, and the scheduling policy is an affinity policy or an anti-affinity policy; Selecting a target physical host from a host cluster based on the scheduling policy and the affinity group to which it belongs; Migrate the host to be processed to the target physical host.
2. The fault handling method according to claim 1, characterized in that: At least one virtual machine is configured in the faulty host; The step of obtaining the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs includes: Obtaining the host priority corresponding to each virtual machine in the faulty host, where the host priority is used to represent the importance of each virtual machine; Sort the virtual machines in the failed host based on the host priority and generate a host processing sequence; Extracting a host to be processed from the host processing sequence; Obtain the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs.
3. The fault handling method according to claim 1, characterized in that: Before obtaining the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs, the method further includes: Monitor the performance of each physical host in the host cluster; When any physical host in the host cluster is detected to have abnormal performance, the physical host with abnormal performance is used as a host to be determined; Get the historical abnormal count of the host to be judged; Updating the historical exception count to obtain a current exception count; If the current abnormality count is greater than the abnormality count threshold, the host to be judged is regarded as a faulty host; A host to be processed is determined according to the virtual machines in the faulty host.
4. The fault handling method according to claim 1, characterized in that: The step of obtaining the scheduling policy corresponding to the host to be processed and the affinity group to which it belongs includes: Obtaining a host priority and / or a policy identifier corresponding to a host to be processed, and obtaining host identification information of the host to be processed; The scheduling policy corresponding to the host to be processed is determined according to the host priority and / or the policy identifier, and the affinity group corresponding to the host to be processed is searched based on the host identification information.
5. The fault handling method according to claim 1, characterized in that: The selecting a target physical host from a host cluster based on the scheduling policy and the affinity group to which the host belongs includes: If the scheduling strategy is an affinity strategy, searching for a candidate physical host in the host cluster that is provided with a virtual machine belonging to the affinity group, and selecting a target physical host from the candidate physical hosts; or, If the scheduling policy is an anti-affinity policy, a candidate physical host is searched in the host cluster for which no virtual machine belonging to the affinity group is configured, and a target physical host is selected from the candidate physical hosts.
6. The fault handling method according to any one of claims 1 to 5, characterized in that: After migrating the host to be processed to the target physical host, the method further includes: When the migration fails, a low-priority host among normal physical hosts in the host cluster is obtained, where the normal physical host is a physical host with normal performance in the host cluster; Building a host shelving queue according to the low-priority host, and shelving the low-priority host; After the processing is completed, return to the step of selecting a target physical host in the host cluster based on the scheduling policy and the affinity group.
7. The fault handling method according to claim 6, characterized in that: The step of putting the low-priority host on hold includes: The device resources occupied by the low-priority host are released, and the host disk data of the low-priority host is saved.
8. The fault handling method according to claim 6, characterized in that: After migrating the host to be processed to the target physical host, the method further includes: Extracting a host to be restored from the host hold queue, and obtaining cluster resource information of the host cluster; If the cluster resource information meets the recovery resource requirement of the host to be recovered, then performing an anti-holding process on the host to be recovered; When the processing is completed, return to the step of extracting the host to be restored from the host holding queue and obtaining the cluster resource information of the host cluster.
9. A fault handling device, characterized in that: The device comprises: An acquisition module is used to acquire a scheduling policy corresponding to a host to be processed and an affinity group to which it belongs, wherein the host to be processed is a virtual machine set in a faulty host, the faulty host is a physical host that fails in a host cluster, and the scheduling policy is an affinity policy or an anti-affinity policy; A selection module, used for selecting a target physical host from a host cluster based on the scheduling policy and the affinity group to which it belongs; A migration module is used to migrate the host to be processed to the target physical host.
10. A fault handling device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the fault handling method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Cloud computing platform management method
CN105743696A
Virtual machine high-availability batch scheduling method and device, equipment and storage medium
CN114048004A
Resource processing method and resource scheduling method
CN114598666A
Anti-affinity scheduling method and device for creating cloud host and medium
CN115061823A
Virtual machine configuration method and system and electronic equipment
CN115480881A
