Resource scheduling method and device for server cluster, equipment, medium and product
By obtaining the target scheduling mode and sensitivity thresholds in the server cluster, generating migration scheduling strategies, optimizing the virtual machine migration path, solving the resource competition and waste caused by load imbalance, and achieving diversified scheduling needs and performance improvements.
Patent Information
- Application Number
- CN202411164480.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-22
AI Technical Summary
When the load is unbalanced, the resource scheduling method of existing server clusters is single, which cannot meet the diverse scheduling needs of users, resulting in fierce competition for high-load host resources and waste of low-load host resources, affecting the performance of virtual machines.
Provide a resource scheduling method for server clusters. By obtaining target scheduling mode and sensitivity thresholds, a migration scheduling strategy is generated based on the host's computing resource data, priority migration of virtual machines to cost-first or performance-first destination hosts, ensuring load balancing, and considering Migration benefits and performance scores for virtual machines.
On the basis of meeting cost and performance requirements, it enriches the resource scheduling method of the server cluster, improves the virtual machine migration efficiency and overall performance, and meets the diverse scheduling needs of users.
Smart Images

Figure CN119003126A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of server clusters, and in particular to a resource scheduling method, device, equipment, medium and product for a server cluster. Background Art
[0002] When the load in the server cluster is unbalanced, there will be many high-load hosts and low-load hosts. The virtual machines running on the high-load hosts may have serious resource competition problems, thereby affecting the performance of the virtual machines and, in turn, affecting customer business. On the other hand, the resources of the virtual machines running on the low-load hosts appear to be too abundant.
[0003] In the related art, resource scheduling within a server cluster is usually performed based on computing resources such as CPU and memory, and virtual machines running on hosts with insufficient computing resources are migrated to hosts with sufficient computing resources.
[0004] However, this resource scheduling method is relatively simple and cannot meet the diverse scheduling needs of users. Summary of the invention
[0005] In view of this, embodiments of the present application provide a resource scheduling method, apparatus, device, medium and product for a server cluster, aiming to meet the scheduling requirements of a variety of server cluster resource scheduling methods.
[0006] The technical solution of the embodiment of the present application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a resource scheduling method for a server cluster, the method comprising:
[0008] Acquire a target scheduling mode and a target sensitivity threshold; the types of the target scheduling mode include at least a cost priority mode and a performance priority mode, and the target sensitivity threshold corresponds to the target scheduling mode;
[0009] Obtaining current usage data of computing resources of each host in the server cluster;
[0010] Generate a migration scheduling strategy based on current usage data of computing resources of each of the hosts, the target scheduling mode and the target sensitivity threshold, wherein the migration scheduling strategy includes a migration path for migrating a virtual machine to be migrated on at least one starting host in the server cluster to a corresponding destination host, wherein the starting host represents a source host for the virtual machine migration;
[0011] Based on the migration scheduling policy, the virtual machine to be migrated on the at least one starting host is migrated to the corresponding destination host.
[0012] In the above solution, the generation of the migration scheduling strategy based on the current usage data of the computing resources of each host, the target scheduling mode and the target sensitivity threshold includes:
[0013] If it is determined that the target scheduling mode is the cost priority mode, then based on a preset host determination strategy, the target sensitivity threshold and current usage data of computing resources of each of the hosts, at least one starting host is determined, and a migration path is generated for migrating the virtual machine to be migrated on the at least one starting host to the corresponding destination host;
[0014] If the target scheduling mode is determined to be the performance priority mode, at least one starting host is determined based on the target sensitivity threshold and the current usage data of the computing resources of each of the hosts, and the virtual machine information on the at least one starting host is obtained; based on the virtual machine information on the at least one starting host, a migration path is generated for the virtual machines to be migrated on at least one starting host to migrate to the corresponding destination host.
[0015] In the above solution, the virtual machine information includes usage data of computing resources of the virtual machine; the step of generating a migration path for migrating the virtual machine to be migrated on at least one starting host to a corresponding destination host based on the virtual machine information on the at least one starting host includes:
[0016] For the virtual machine information on the at least one starting host, sort the virtual machines from high to low according to the usage data of the computing resources of the virtual machines, simulate the migration of the virtual machines to the corresponding destination hosts in sequence according to the sorting, until the load data of all hosts are less than the target sensitivity threshold, and determine the simulated migration virtual machine as the virtual machine to be migrated in the at least one starting host;
[0017] Based on the virtual machines to be migrated and the corresponding destination hosts, a migration path for migrating the virtual machines to be migrated on at least one starting host to the corresponding destination host is generated.
[0018] In the above solution, the step of simulating the migration of virtual machines to corresponding destination hosts in sequence according to the sequence includes:
[0019] Selecting a virtual machine to be migrated according to the ranking, and obtaining a migration benefit score of the virtual machine to be migrated to each candidate host and a performance score of each candidate host;
[0020] Determining a destination host to which the virtual machine to be migrated is to be migrated based on the migration benefit scores of the virtual machine to be migrated to each candidate host and the performance scores of each candidate host;
[0021] Based on the usage data of the computing resources after the destination host simulates the migration of the virtual machine to be migrated, updating the usage data of the computing resources of the destination host;
[0022] The candidate hosts are hosts in the server cluster except the starting host.
[0023] In the above solution, obtaining the performance score of each candidate host includes:
[0024] Obtaining reliability data and affinity data of each candidate host, wherein the reliability data indicates the probability that the candidate host does not have a hardware failure when migrating the virtual machine to be migrated, and the affinity data indicates whether the virtual machine to be migrated and the candidate host and the virtual machines on the candidate host are mutually exclusive;
[0025] Obtaining remaining data of computing resources of each of the candidate hosts and network load data of the server cluster;
[0026] A performance score of each of the candidate hosts is determined based on the network load data, the remaining data of the computing resources of each of the candidate hosts, the reliability data, and the affinity data.
[0027] In the above solution, the obtaining of the remaining data of the computing resources of each candidate host includes:
[0028] Determine whether the resource forecasting function is enabled;
[0029] If it is determined that the resource prediction function is enabled, the predicted remaining data of the computing resources of each of the candidate hosts is determined based on the trained resource prediction model, and the remaining data of the computing resources of each of the candidate hosts is determined based on the predicted remaining data of the computing resources of each of the candidate hosts;
[0030] If it is determined that the resource prediction function is not enabled, the remaining data of the computing resources of each candidate host is determined based on the current usage data and initial resource data of the computing resources of each candidate host.
[0031] In the above solution, the step of determining the predicted remaining data of the computing resources of each candidate host based on the trained resource prediction model includes:
[0032] Obtaining remaining data of computing resources of the candidate host within a historical preset time period;
[0033] The remaining data of the computing resources of the candidate host within the historical preset time period is input into the trained resource prediction model to obtain the predicted remaining data of the computing resources of the candidate host, and the predicted remaining data of the computing resources is the remaining data of the computing resources of the candidate host within the future preset time period.
[0034] In the above solution, migrating the virtual machine to be migrated on the at least one starting host to the corresponding destination host based on the migration scheduling policy includes:
[0035] Get the target migration mode;
[0036] If it is determined that the target migration mode is the automatic migration mode, then based on the migration scheduling policy, the virtual machine to be migrated in the at least one starting host is migrated to the corresponding destination host.
[0037] In the above scheme, the method further comprises:
[0038] If it is determined that the target migration mode is the manual migration mode, the migration scheduling policy is sent to the front end for display;
[0039] Obtaining user's execution requirement information for the migration scheduling strategy;
[0040] The virtual machine to be migrated is migrated according to the execution requirement information.
[0041] In the above solution, the step of obtaining the target sensitivity threshold comprises:
[0042] Obtaining input information representing the frequency of target scheduling;
[0043] The target sensitivity threshold is determined based on the target dispatch mode and the input information.
[0044] In a second aspect, an embodiment of the present application further provides a resource scheduling device for a server cluster, the device comprising:
[0045] A first data acquisition module is used to acquire a target scheduling mode and a target sensitivity threshold; the types of the target scheduling mode include at least a cost priority mode and a performance priority mode, and the target sensitivity threshold corresponds to the target scheduling mode;
[0046] A second data acquisition module is used to acquire current usage data of computing resources of each host in the server cluster;
[0047] A scheduling strategy generation module, configured to generate a migration scheduling strategy based on current usage data of computing resources of each of the hosts, the target scheduling mode and the target sensitivity threshold, wherein the migration scheduling strategy includes a migration path for migrating a virtual machine to be migrated on at least one starting host in the server cluster to a corresponding destination host, wherein the starting host represents a source host for virtual machine migration;
[0048] The migration scheduling module is used to migrate the virtual machine to be migrated on the at least one starting host to the corresponding destination host based on the migration scheduling policy.
[0049] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor, when running the computer program, executes the steps of the method described in the first aspect above.
[0050] In a fourth aspect, an embodiment of the present application further provides a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first aspect are performed.
[0051] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, performs the steps of the method described in the first aspect above.
[0052] The technical solution provided in the embodiment of the present application obtains a target scheduling mode and a target sensitivity threshold; the types of the target scheduling mode include at least a cost priority mode and a performance priority mode, and the target sensitivity threshold corresponds to the target scheduling mode; the current usage data of the computing resources of each host in the server cluster is obtained; based on the current usage data of the computing resources of each host, the target scheduling mode and the target sensitivity threshold, a migration scheduling strategy is generated, and the migration scheduling strategy includes a migration path for migrating the virtual machine to be migrated on at least one starting host in the server cluster to the corresponding destination host, and the starting host represents the source host for the virtual machine migration; based on the migration scheduling strategy, the virtual machine to be migrated on the at least one starting host is migrated to the corresponding destination host.
[0053] The types of target scheduling modes of the present application include at least a cost priority mode and a performance priority mode. When performing resource scheduling, a migration scheduling strategy can be generated based on the acquired target scheduling mode, target sensitivity threshold, and current usage data of computing resources of each host in the server cluster; and then the virtual machines to be migrated are migrated based on the generated migration scheduling strategy to implement resource scheduling of the server cluster. Since the present application can implement resource scheduling not only based on the performance of the cluster but also based on the cost of scheduling when implementing resource scheduling of the server cluster, it enriches the resource scheduling method of the server cluster to a certain extent, thereby meeting the diverse scheduling needs of users. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of a flow chart of a resource scheduling method for a server cluster according to an embodiment of the present application;
[0055] Figure 2 A schematic diagram of a front-end interface of an electronic device in an embodiment of the present application;
[0056] Figure 3 A flow chart of a resource scheduling method for a server cluster according to an application embodiment of the present application;
[0057] Figure 4 This is a diagram of the external architecture of DRS service deployment in one embodiment of the present application;
[0058] Figure 5 This is a schematic diagram of a DRS performance balancing mode scheduling case according to an embodiment of the present application;
[0059] Figure 6 This is a performance comparison chart of the virtual machine before and after migration in the manual migration mode of an embodiment of the present application;
[0060] Figure 7 This is a performance comparison diagram of the virtual machine before and after migration in the automatic migration mode of an embodiment of the present application;
[0061] Figure 8 This is a schematic diagram of the structure of a resource scheduling device for a server cluster according to an embodiment of the present application;
[0062] Fig. 9 It is a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0063] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0065] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:
[0066] Dynamic Resource Scheduling (DRS): is an automated resource management technology used to dynamically allocate and balance the computing resources of virtual machines in a cluster. It can automatically migrate virtual machines to the most suitable hosts based on the resource requirements of the virtual machines and the available resources in the cluster, combined with user-configured scheduling policies and options, to achieve optimal resource utilization and load balancing.
[0067] Host: relative to the virtual machine, it refers to the carrier that runs the virtual machine program, usually a physical server.
[0068] Cluster: A system consisting of multiple physical servers connected through a network.
[0069] Virtual Machine (VM): A special program running on a host computer that appears as a special process to the underlying physical machine and as a virtual server environment to the upper-level users.
[0070] VM Migration: refers to the process of changing the location of the host where a virtual machine runs, migrating a virtual machine from one host to another, for example, migrating a virtual machine from host A to host B. Host A is called the starting host and host B is called the destination host.
[0071] Affinity: also known as scheduling policy, which refers to the migration restriction policy configured by the user, such as configuring one or several virtual machines to run on a certain host, or one or several virtual machines to run on certain hosts.
[0072] VM Migration Evaluation Score: It is the score of the virtual machine after it is migrated from the starting host to the destination host based on the migration path in the cluster, the load data and configuration information of the starting host and the destination host, and the load data and configuration information of the virtual machine.
[0073] VM Migration Benefit: refers to the estimated benefit that a VM can bring to it after it is migrated from the starting host to the destination host, i.e., performance improvement. This benefit is reflected in the change between the VM score before migration and the estimated score after migration. If the estimated score after migration is subtracted from the score before migration, the larger the difference, the higher the migration benefit, and the smaller the difference, the smaller the migration benefit.
[0074] Host Resource Forecast: refers to the prediction of host resources for a period of time in the future based on AI models and time series prediction algorithms, using a long period of historical host resource data.
[0075] Hardware Reliability: refers to whether the hardware such as memory, disk, RAID (Redundant Array of Independent Disks) card is reliable, whether there are hidden dangers in the hardware, that is, whether the migration of the virtual machine will have an impact on the business. Due to many factors, in actual scheduling, hardware reliability will be judged based on reliability scores.
[0076] Reliability Score: refers to a reliability score based on a percentage system obtained by checking whether the memory, disk, RAID card and other hardware have a risk of failure or have already failed, grading the severity of the failure through segmented scores, and then deducting points.
[0077] Resource Score: It is a percentage score calculated by combining CPU, memory, network, storage and other resource indicators to represent the current resource usage status and whether the remaining resources are sufficient.
[0078] Network Resource: Also known as network load, it refers to whether network resources such as network bandwidth and sessions are sufficient.
[0079] Performance Priority: Also known as performance balancing mode, this refers to a scheduling mode in which virtual machines are migrated when the cluster load is unbalanced, with the goal of optimizing the performance of cluster servers and virtual machines.
[0080] Cost Priority: Also known as the cost-optimal mode, it refers to a scheduling mode that frees up idle servers that can be shut down in order to save costs.
[0081] The embodiment of the present application provides a resource scheduling method for a server cluster. The execution subject of the resource scheduling method for the server cluster may be an electronic device, and the electronic device may be a scheduler of the server cluster. Figure 1 As shown, the resource scheduling method of the server cluster includes:
[0082] Step 101, obtaining a target scheduling mode and a target sensitivity threshold; the types of target scheduling modes include at least a cost priority mode and a performance priority mode, and the target sensitivity threshold corresponds to the target scheduling mode.
[0083] Among them, the target scheduling mode can be determined by the user in the front-end operation, and the types of target scheduling modes include at least cost priority mode and performance priority mode. In addition, other priority modes can also be expanded according to needs. It can be understood that the cost priority mode means that when performing resource scheduling, the lowest migration cost is given priority. The performance priority mode means that when performing resource scheduling, the load balance of each host in the server cluster is given priority. In the cost priority mode, in order to minimize the migration cost, the virtual machine needs to be migrated to the host that already has the virtual machine running as much as possible, so as to free up more hosts in the server cluster. In the performance priority mode, in order to balance the load within the server cluster, the virtual machines need to be evenly distributed to all hosts.
[0084] The target sensitivity threshold corresponds to the target scheduling mode, and different target scheduling modes may have different target sensitivity thresholds.
[0085] Step 102, obtaining current usage data of computing resources of each host in the server cluster.
[0086] Here, the computing resources in the current usage data of the computing resources of each host in the server cluster include at least resources such as CPU and memory. The current usage data of computing resources can represent the current usage status of the computing resources of the host. The current usage data of computing resources can include specific CPU and memory usage data. For example, host A has 3 CPUs and 600GB of memory. If 2 CPUs are currently used and 80GB are used, the current usage data of computing resources can be expressed as (2CPU, 80GB).
[0087] Step 103, based on the current usage data of the computing resources of each host, the target scheduling mode and the target sensitivity threshold, a migration scheduling strategy is generated. The migration scheduling strategy includes a migration path for migrating the virtual machine to be migrated on at least one starting host in the server cluster to the corresponding destination host. The starting host represents the source host for the virtual machine migration.
[0088] Among them, based on the current usage data of the computing resources of each host, the target scheduling mode and the target sensitivity threshold, a migration scheduling strategy can be generated.
[0089] Based on the comparison result of the current usage data of the computing resources of each host in the server cluster and the target sensitivity threshold, a high-load host in the server cluster can be determined, where the high-load host refers to a host whose current usage data of the computing resources is greater than or equal to the target sensitivity threshold. The starting host may include a high-load host.
[0090] The migration scheduling strategy includes a migration path for migrating a virtual machine to be migrated on at least one starting host in a server cluster to a corresponding destination host. The migration path in the migration scheduling strategy can be represented by an identifier indicating the starting host, an identifier indicating the virtual machine to be migrated, and an identifier indicating the destination host. Exemplarily, the migration scheduling strategy includes a migration path S1, and the migration path S1 is to migrate the virtual machine X1 to be migrated on the starting host A1 to the destination host B1, then the migration path S1 in the migration scheduling strategy can be represented as (A1, X1)→B1.
[0091] Step 104: Based on the migration scheduling policy, migrate the virtual machine to be migrated on at least one starting host to the corresponding destination host.
[0092] Wherein, based on the migration scheduling policy, a virtual machine to be migrated on at least one starting host may be migrated to a corresponding destination host.
[0093] The starting host represents the source host of the virtual machine migration. It can be understood that the types of target scheduling modes of the present application include at least a cost priority mode and a performance priority mode. When performing resource scheduling, a migration scheduling strategy can be generated based on the acquired target scheduling mode, the target sensitivity threshold, and the current usage data of the computing resources of each host in the server cluster; and then the virtual machine to be migrated is migrated based on the generated migration scheduling strategy to realize resource scheduling of the server cluster. Since the present application can realize resource scheduling not only according to the performance of the cluster but also according to the scheduling cost when realizing resource scheduling of the server cluster, it enriches the resource scheduling method of the server cluster to a certain extent, thereby meeting the diverse scheduling needs of users.
[0094] In one embodiment, based on the current usage data of the computing resources of each of the hosts, the target scheduling mode and the target sensitivity threshold, a migration scheduling strategy is generated, including:
[0095] If it is determined that the target scheduling mode is the cost priority mode, then based on a preset host determination strategy, the target sensitivity threshold and current usage data of computing resources of each of the hosts, at least one starting host is determined, and a migration path is generated for migrating the virtual machine to be migrated on the at least one starting host to the corresponding destination host;
[0096] If the target scheduling mode is determined to be the performance priority mode, at least one starting host is determined based on the target sensitivity threshold and the current usage data of the computing resources of each of the hosts, and the virtual machine information on the at least one starting host is obtained; based on the virtual machine information on the at least one starting host, a migration path is generated for the virtual machines to be migrated on at least one starting host to migrate to the corresponding destination host.
[0097] Among them, according to the situation of the host running a virtual machine, each host in the server cluster can be divided into an idle host, a first non-idle host and a second non-idle host. Idle hosts and non-idle hosts can be determined by whether a virtual machine is running. For example, a host that does not run a virtual machine can be determined as an idle host, and a host that runs a virtual machine can be determined as a non-idle host. The first non-idle host and the second non-idle host can be determined by the usage data of computing resources. For example, based on the comparison result of the usage data of the computing resources of the host and the preset value, if it is determined that the usage data of the computing resources of the host is greater than or equal to the preset value, the host is determined as the first non-idle host; if it is determined that the usage data of the computing resources of the host is less than the preset value, the host is determined as the second non-idle host. The first non-idle host corresponds to a non-idle host with a higher load, and the second non-idle host corresponds to a non-idle host with a lower load.
[0098] Here, after the target scheduling mode is acquired, for the case where the target scheduling mode is the cost priority mode, at least one starting host is determined based on the preset host determination strategy, the target sensitivity threshold, and the current usage data of the computing resources of each host. In the cost priority mode, the goal is to free up as many hosts as possible, and the pre-set host determination strategy can be to ensure that the number of idle hosts freed up is greater than the preset number. Based on the target sensitivity threshold and the current usage data of the computing resources of each host, a host whose current usage data of the computing resources is greater than or equal to the target sensitivity threshold can be determined as the starting host, and based on the preset host determination strategy, a second non-idle host can be determined as the starting host. Among them, the target sensitivity threshold is greater than the preset value.
[0099] In the cost priority mode, the end condition of migration should be that all hosts in the server cluster are less than the target sensitivity threshold after migration, and the number of idle hosts after migration should meet the requirements of the preset host determination policy.
[0100] When the target scheduling mode is the performance priority mode, at least one starting host can be determined based on the target sensitivity threshold and the current usage data of the computing resources of each host, and the virtual machine information on at least one starting host can be obtained; based on the virtual machine information on at least one starting host, a migration path for the virtual machines to be migrated on at least one starting host to the corresponding destination host can be generated.
[0101] In one embodiment, the virtual machine information includes usage data of computing resources of the virtual machine; the step of generating a migration path for migrating the virtual machine to be migrated on at least one starting host to a corresponding destination host based on the virtual machine information on the at least one starting host includes:
[0102] For the virtual machine information on the at least one starting host, sort the virtual machines from high to low according to the usage data of the computing resources of the virtual machines, simulate the migration of the virtual machines to the corresponding destination hosts in sequence according to the sorting, until the load data of all hosts are less than the target sensitivity threshold, and determine the simulated migration virtual machine as the virtual machine to be migrated in the at least one starting host;
[0103] Based on the virtual machines to be migrated and the corresponding destination hosts, a migration path for migrating the virtual machines to be migrated on at least one starting host to the corresponding destination host is generated.
[0104] The usage data of the computing resources of the virtual machine refers to the computing resource data of the host occupied by the virtual machine when running on the host.
[0105] For the virtual machine information on at least one starting host, sort the virtual machine's computing resource usage data from high to low, and simulate migrating the virtual machines to the corresponding destination hosts in sequence according to the sorting until the load data of all hosts in the server cluster are less than the target sensitivity threshold. At this time, all hosts in the server cluster do not have high loads, and the hosts in the server cluster reach a relatively balanced load state. For virtual machines simulated to be migrated from at least one starting host, they can be determined as virtual machines to be migrated in at least one starting host.
[0106] Exemplarily, after the starting host A simulates the migration of the first N virtual machines, the load data of the starting host A is less than the target sensitivity threshold, then the first N virtual machines can be used as virtual machines to be migrated in the starting host A, where N is a natural number.
[0107] It should be noted that the simulated migration of virtual machines is different from the actual migration of virtual machines. The simulated migration can be used to estimate how many virtual machines need to be migrated from at least one starting host, so that the load data of at least one starting host is less than the target sensitivity threshold.
[0108] Based on each virtual machine to be migrated and the corresponding destination host, a migration path for migrating the virtual machine to be migrated on at least one starting host to the corresponding destination host may be generated.
[0109] In this embodiment, according to the sorting of the usage data of the computing resources of the virtual machines from high to low, the migration of the virtual machines to the corresponding destination hosts is simulated in sequence until the load data of all hosts are less than the target sensitivity threshold, and the virtual machine simulated for migration is determined as the virtual machine to be migrated in at least one starting host.
[0110] Based on this, the number of virtual machines to be migrated can be guaranteed to be within a reasonable range, so that the load data of all hosts in the server cluster are less than the target sensitivity threshold, while not increasing the workload of virtual machine migration. For example, if the load data of a host is already less than the target sensitivity threshold, if another virtual machine is migrated out according to the sorting simulation, another migration path will be obtained, which may increase the workload of subsequent migration tasks.
[0111] In one embodiment, simulating the migration of virtual machines to corresponding destination hosts in sequence according to the sequence includes:
[0112] Selecting a virtual machine to be migrated according to the ranking, and obtaining a migration benefit score of the virtual machine to be migrated to each candidate host and a performance score of each candidate host;
[0113] Determining a destination host to which the virtual machine to be migrated is to be migrated based on the migration benefit scores of the virtual machine to be migrated to each candidate host and the performance scores of each candidate host;
[0114] Based on the usage data of the computing resources after the destination host simulates the migration of the virtual machine to be migrated, updating the usage data of the computing resources of the destination host;
[0115] The candidate host is a host in the server cluster except the starting host. A virtual machine to be migrated is selected according to the ranking, and a migration benefit score of the virtual machine to be migrated to each candidate host is obtained. The migration benefit score can represent the migration benefit of the virtual machine to be migrated to the candidate host. The migration benefit can be reflected in the degree to which the performance of the virtual machine to be migrated is improved after it is migrated to the candidate host. The higher the migration benefit score, the better the migration benefit of the virtual machine to be migrated to the candidate host, and the greater the degree to which the performance of the virtual machine to be migrated is improved after it is migrated to the candidate host.
[0116] The migration benefit score of the virtual machine to each candidate host can be determined by a scoring plug-in. The scoring plug-in obtains the performance parameters of the virtual machine before migration to the candidate host to obtain a pre-migration score, obtains the performance parameters of the virtual machine after migration to the candidate host to obtain a post-migration score, and obtains the migration benefit score of the virtual machine to the candidate host based on the post-migration score and the pre-migration score.
[0117] The performance score of the candidate host can represent the performance status of the candidate host. The performance score of the candidate host is positively correlated with the performance status of the candidate host.
[0118] Based on the migration benefit scores of the virtual machine to be migrated to each candidate host and the performance scores of each candidate host, the destination host to which the virtual machine to be migrated is to be migrated can be determined. Specifically, filtering can be performed based on the performance scores of each candidate host to obtain a destination host list for the virtual machine. Based on the migration benefit scores of the virtual machine to each candidate host in the destination host list, a candidate host with the highest migration benefit score is selected from the destination host list as the destination host to which the virtual machine to be migrated is to be migrated.
[0119] In actual migration, after the destination host migrates the virtual machine to be migrated, the usage data of the destination host's computing resources will change. In order to ensure that the subsequent actual migration can learn from the simulated migration, in the simulated migration, after the destination host simulates the migration of the virtual machine to be migrated, the usage data of the destination host's computing resources will be updated. Exemplarily, before the destination host simulates the migration of the virtual machine to be migrated, the usage data of its computing resources is 50%. After the destination host simulates the migration of the virtual machine to be migrated, the usage data of its computing resources is updated, and it can be determined that the usage data of its computing resources is 60%.
[0120] This embodiment is explained by taking the migration of a virtual machine to be migrated to the corresponding destination host as an example, and the same applies to other virtual machines to be migrated on the same starting host. In the case where there are two or more starting hosts, the virtual machines to be migrated on each starting host can be simulated migrated in turn. For example, after migrating the first M virtual machines to be migrated in the starting host A to the corresponding destination host, the virtual machines to be migrated in the next starting host are migrated.
[0121] In one embodiment, obtaining the performance score of each candidate host includes:
[0122] Obtaining reliability data and affinity data of each of the candidate hosts;
[0123] Obtaining remaining data of computing resources of each of the candidate hosts and network load data of the server cluster;
[0124] A performance score of each of the candidate hosts is determined based on the network load data, the remaining data of the computing resources of each of the candidate hosts, the reliability data, and the affinity data.
[0125] The reliability data represents the probability that the candidate host does not have hardware failure when migrating the virtual machine to be migrated. Hardware failures may include potential or existing disk failures, memory failures, and Raid failures. The reliability data of each candidate host may be obtained by the candidate host itself and then sent to the electronic device, so that the electronic device can obtain the reliability data of each candidate host.
[0126] The affinity data indicates whether the virtual machine to be migrated and the candidate host and the virtual machines on the candidate host are mutually exclusive. Mutual exclusion can be understood as at least including mutual exclusion and non-mutual exclusion. Affinity is determined based on the scheduling policy configured by the user. The scheduling policy configured by the user can include mutually exclusive virtual machines, mutual exclusion of virtual machine groups, virtual machine groups to host groups, clustered virtual machines, and fixed running locations.
[0127] Mutually exclusive virtual machines refer to virtual machines in the mutually exclusive list that cannot run on the same host. During DRS scheduling, it determines whether the migrated virtual machine and the virtual machine on the destination host are in the mutually exclusive virtual machine list.
[0128] Virtual machine groups are mutually exclusive. Similar to mutually exclusive virtual machines, DRS scheduling determines whether the migrated virtual machine and the virtual machine on the destination host are in two mutually exclusive virtual machine groups. If they are mutually exclusive, the current destination host will not be used as the destination host.
[0129] From a virtual machine group to a host group means that the virtual machines in the virtual machine group can only run on the hosts in the host list. During DRS scheduling, it will determine whether the currently selected destination host for the migrated virtual machine is in the host list. If it is not in the host list, the currently selected destination host will not be used as the destination host.
[0130] Clustering virtual machines means running two or more virtual machines on the same host as much as possible. During DRS scheduling, you can bind the clustered virtual machines together for scheduling or not schedule such virtual machines.
[0131] Fixed running location means that the virtual machine can only run on a fixed host. During DRS scheduling, it will determine whether the currently selected destination host is a fixed host in the policy. If not, the current destination host will not be used as the destination host.
[0132] Here, mutually exclusive virtual machines and mutually exclusive virtual machine groups correspond to mutually exclusive situations, and virtual machine groups to host groups, clustered virtual machines, and fixed running locations correspond to non-mutually exclusive situations.
[0133] The network load data can characterize the network load status within the server cluster. The network load data can include network bandwidth and network sessions. The network load data cannot be too high, otherwise it will affect the success rate of scheduling migration. Therefore, the network load data can also be used as a factor in screening the destination host.
[0134] The network load data can be collected by the electronic device and can be obtained by averaging the historical network load data within the scheduling period. The scheduling period can be the time required for all virtual machines to be migrated to migrate to the destination host. For example, if the scheduling period is 10 minutes, the electronic device averages the historical network load data within the past 10 minutes, and the average value obtained is the network load data.
[0135] The remaining data of computing resources refers to the data of remaining and available computing resources. The more remaining data of computing resources of the candidate host, the less resource competition there is, and the candidate host can be given priority when determining the destination host.
[0136] Based on the remaining data, reliability data, affinity data of the computing resources of the candidate hosts, and the network load data in the server cluster, the performance score of each candidate host can be determined.
[0137] In this embodiment, the performance of the candidate host is scored from multiple dimensions such as the remaining data of the candidate host's computing resources, affinity data, reliability data, and network load data of the server cluster. The dimensions are considered more comprehensively, so the performance of the candidate host can be reflected more accurately. Dynamic resource scheduling of the server cluster based on performance balance not only solves the problem of fierce resource competition on high-load hosts, but also solves the problem of idle resources on low-load hosts. At the same time, it also enables business virtual machines with insufficient resources to be relieved in a timely manner, which is conducive to improving overall business performance and cluster resource utilization, and to a certain extent meets the needs of users who are more concerned about business performance.
[0138] In one embodiment, obtaining remaining data of computing resources of each candidate host includes:
[0139] Determine whether the resource forecasting function is enabled;
[0140] If it is determined that the resource prediction function is enabled, the predicted remaining data of the computing resources of each of the candidate hosts is determined based on the trained resource prediction model, and the remaining data of the computing resources of each of the candidate hosts is determined based on the predicted remaining data of the computing resources of each of the candidate hosts;
[0141] If it is determined that the resource prediction function is not enabled, the remaining data of the computing resources of each candidate host is determined based on the current usage data and initial resource data of the computing resources of each candidate host.
[0142] Among them, the resource prediction function can be used to predict the computing resources of the hosts in the server cluster. The resource prediction function can be triggered by the user's operation on the front end of the server cluster. The resource prediction function can be divided according to the prediction scale, including a variety of different prediction scales. The computing power required for each prediction scale is different, and the larger the prediction scale, the greater the computing power required. Take the resource prediction function with four prediction scales as an example, Figure 2 As shown, the name of the control for the predicted scale displayed on the front end can be less computing power, medium computing power, more computing power, and maximum computing power. In addition, the front end can also be set to display a control for disabling the resource prediction function, and the control name can be disabled.
[0143] If the resource prediction function is enabled, the predicted remaining data of the computing resources of the candidate hosts can be determined based on the trained resource prediction model. The predicted remaining data of the computing resources can be understood as the predicted remaining data of the computing resources. The resource prediction function can include multiple prediction scales. When the resource prediction function is enabled, if the resource prediction function is the first prediction scale, the remaining data of the computing resources of each host in the server cluster can be predicted to obtain the predicted remaining data of the computing resources of each candidate host. In this case, the predicted remaining data of the computing resources of each candidate host can be determined as the remaining data of the computing resources of each candidate host. Among them, the first prediction scale is the prediction scale corresponding to the maximum computing power.
[0144] If the resource prediction function is a prediction scale other than the first prediction scale, the remaining data of the computing resources of some candidate hosts corresponding to the prediction scale are predicted based on the trained resource prediction model to determine the predicted remaining data of the computing resources of this part of the candidate hosts. The predicted remaining data of the computing resources of this part of the candidate hosts are determined as the remaining data of the computing resources of this part of the candidate hosts. For another part of the candidate hosts, no prediction of the remaining data of the computing resources is performed, and this part is handled with reference to the case where the resource prediction function is not enabled. In addition, if it is determined based on the predicted remaining data of the computing resources of the candidate host that there will be resource competition after the virtual machine to be migrated is migrated to the candidate host, then when determining the destination host of the virtual machine to be migrated, other candidate hosts in the server cluster except the candidate host are given priority.
[0145] If it is determined that the resource prediction function is not enabled, the remaining data of the computing resources of each candidate host is determined based on the current usage data and initial resource data of the computing resources of each candidate host. The initial resource data refers to the initial resource data of the candidate host. Specifically, the difference between the initial resource data of each candidate host and the current usage data of the computing resources can be obtained, and the remaining data of the computing resources of each candidate host can be determined based on each difference. For example, the difference between the initial resource data of candidate host A and the current usage data of the computing resources is determined as the remaining data of the computing resources of candidate host A.
[0146] This embodiment adds a resource prediction function. When this function is enabled, the remaining data of the computing resources of the candidate host can be predicted to determine the remaining data of the computing resources of the candidate host, thereby increasing the diversity of ways to determine the remaining data of the computing resources of the candidate host.
[0147] In one embodiment, based on the trained resource prediction model, determining the predicted remaining data of the computing resources of each candidate host includes:
[0148] Obtaining remaining data of computing resources of the candidate host within a historical preset time period;
[0149] The remaining data of the computing resources of the candidate host within the historical preset time period is input into the trained resource prediction model to obtain the predicted remaining data of the computing resources of the candidate host, and the predicted remaining data of the computing resources is the remaining data of the computing resources of the candidate host within the future preset time period.
[0150] Here, when predicting the remaining data of the computing resources of the candidate host, it can be to predict the remaining data of the computing resources of the candidate host within a period of time in the future. The remaining data of the computing resources of the candidate host within a period of time can characterize the changing trend of the remaining data of the computing resources of the candidate host within this period of time. For example, the remaining data of the computing resources of the candidate host within a preset time period in the future can characterize the changing trend of the remaining data of the computing resources of the candidate host within the preset time period in the future. Based on the changing trend of the remaining data of the computing resources of the candidate host within the historical preset time period, which is input into the trained resource prediction model, the changing trend of the remaining data of the computing resources of the candidate host within the preset time period in the future can be predicted.
[0151] In order to enable the trained resource prediction model to predict the remaining data of computing resources within a preset time in the future, the training samples in the training sample set constructed during model training may be the remaining data of computing resources within the first historical preset time, and the labels may be the remaining data of computing resources within the second historical preset time. The resource prediction model is trained based on the training sample set until a trained resource prediction model is obtained. The first historical preset time is earlier than the second historical preset time. For example, the training sample may be the remaining data of the computing resources of the candidate host from March 1 to March 3, 2024 (the first historical preset time), and the label may be the remaining data of the computing resources of the candidate host from March 4 to March 6, 2024 (the second historical preset time).
[0152] In this embodiment, the remaining data of the computing resources of the candidate host within a preset historical period of time and the trained resource prediction model are used to predict the remaining data of the computing resources of the candidate host within a preset future period of time, thereby improving the prediction accuracy of the remaining data of the computing resources of the candidate host.
[0153] In one embodiment, based on the migration scheduling policy, migrating the virtual machine to be migrated on the at least one starting host to the corresponding destination host includes:
[0154] Get the target migration mode;
[0155] If it is determined that the target migration mode is the automatic migration mode, then based on the migration scheduling policy, the virtual machine to be migrated in the at least one starting host is migrated to the corresponding destination host.
[0156] The migration mode may include an automatic migration mode and a manual migration mode. The migration mode may be displayed on the front end for the user to select, and the default is the automatic migration mode. If the user selects the manual migration mode on the front end, the virtual machine is migrated based on the manual migration mode first.
[0157] If it is determined that the target migration mode is the automatic migration mode, then based on the migration scheduling policy, the virtual machine to be migrated in at least one starting host in the migration scheduling policy is automatically migrated to the corresponding destination host.
[0158] In the automatic migration mode, the electronic device will migrate all virtual machines to be migrated in the migration scheduling policy to the corresponding destination host.
[0159] like Figure 2 As shown, the content displayed on the front-end interface also includes a scheduling mode. The scheduling mode is the automatic migration mode or manual migration mode used for resource scheduling in this embodiment. When the scheduling mode is disabled, the scheduling engine will not give a scheduling suggestion, that is, no scheduling migration strategy will be generated.
[0160] In one embodiment, if the target migration mode is determined to be a manual migration mode, the migration scheduling policy is sent to the front end for display; the user's execution requirement information for the migration scheduling policy is obtained; and the virtual machine to be migrated is migrated according to the execution requirement information.
[0161] In manual migration mode, the electronic device will migrate the virtual machines to be migrated to the destination host according to the user's choice. For example, if the user chooses to migrate all virtual machines to be migrated in the migration scheduling policy to the corresponding destination host, the electronic device will migrate all virtual machines to be migrated to the corresponding destination host. If the user chooses to migrate all virtual machines to be migrated on the starting host A to the corresponding destination host, the electronic device will migrate all virtual machines to be migrated on the starting host A to the corresponding destination host.
[0162] Specifically, if it is determined that the target migration mode is the manual migration mode, the migration scheduling policy is sent to the front end for display, so that the user can choose which virtual machines to migrate according to the migration scheduling policy. After the user makes a selection, the electronic device generates execution requirement information indicating the user's execution requirement for the migration scheduling policy, and the execution requirement information represents the user's execution requirement for the virtual machine. The execution requirement information can be understood as the target virtual machine to be migrated determined by the user based on the migration scheduling policy, and the target virtual machine to be migrated is the virtual machine to be migrated that actually performs the migration later.
[0163] Based on the information indicating the user's execution requirement for the migration scheduling policy, the electronic device can obtain the user's execution requirement information for the migration scheduling policy, thereby migrating the virtual machine to be migrated according to the execution requirement information.
[0164] In this embodiment, when migrating the virtual machine to be migrated, the virtual machine to be migrated can also be manually migrated based on user selection, thereby enriching the way of migrating the virtual machine to be migrated.
[0165] In one embodiment, obtaining a target sensitivity threshold includes:
[0166] Obtaining input information representing the frequency of target scheduling;
[0167] The target sensitivity threshold is determined based on the target dispatch mode and the input information.
[0168] like Figure 2 As shown, the content displayed on the front-end interface also includes scheduling mode and scheduling sensitivity. The scheduling mode includes performance balance mode and cost optimization mode. The performance balance mode corresponds to the aforementioned performance priority mode, and the cost optimization mode corresponds to the aforementioned cost priority mode. Scheduling sensitivity corresponds to the aforementioned scheduling frequency. The scheduling frequency can include at least 3 levels, and the corresponding front-end control name can be displayed as: conservative, intermediate and aggressive. Conservative corresponds to less frequent scheduling, intermediate corresponds to generally frequent scheduling, and aggressive corresponds to more frequent scheduling.
[0169] The user selects the target scheduling frequency and the target scheduling mode at the front end, and the electronic device can obtain input information representing the target scheduling frequency and the target scheduling mode. Based on the target scheduling mode and the input information, the target sensitivity threshold can be determined.
[0170] In this embodiment, the target sensitivity threshold can be determined based on the scheduling frequency and the target scheduling mode, so that the target sensitivity threshold is adapted to the target scheduling mode, and the setting is relatively flexible, which can meet the diverse scheduling needs of users.
[0171] The present application is further described in detail below in conjunction with application examples.
[0172] This application embodiment provides a resource scheduling method for a server cluster, such as Figure 3 As shown, the following steps are included:
[0173] Step 301, obtaining the current load of each host in the server cluster.
[0174] The current load refers to the current usage data of the aforementioned computing resources, and the computing resources include at least CPU and memory.
[0175] Step 302: Based on the current load of each host, determine whether the server cluster currently meets the triggering condition for resource scheduling.
[0176] The triggering condition for resource scheduling may be that there is a host in the server cluster whose current load is greater than or equal to a load threshold, and that the current load difference of the server cluster is greater than or equal to a load difference threshold.
[0177] The load difference is the load difference between the host with the highest load and the host with the lowest load in the server cluster. The load threshold corresponds to the target sensitivity threshold described in the above embodiment.
[0178] For example, if the scheduling frequency is conservative, the load threshold can be 70%, and the load difference threshold can be 30%. When the current load of any host in the server cluster is greater than or equal to 70%, and the current load difference of the server cluster is greater than or equal to 30%, it can be determined that the server cluster currently meets the trigger conditions for resource scheduling.
[0179] If it is determined that the triggering condition for resource scheduling is met, step 303 is executed to determine at least one high-load host and obtain the usage data of computing resources of the virtual machines on at least one high-load host. Otherwise, step 301 is continued to obtain the current load of each host in the server cluster.
[0180] Step 304, sorting the usage data of computing resources of the virtual machines on at least one high-load host from high to low, and determining a destination host corresponding to the virtual machines to be migrated on at least one high-load host according to the filtering conditions and the scoring plug-in.
[0181] Specifically, a list of destination hosts that can run the virtual machine to be migrated can be screened out according to the filtering conditions. The list of destination hosts includes candidate hosts that can run the virtual machine to be migrated. The filtering conditions may include hardware resources, network load, reliability data, and affinity data. Hardware resources may include CPU, memory resources, host status, and GPU (graphics processing unit).
[0182] Afterwards, based on the scoring plug-in, each candidate host in the destination host list is scored according to the migration benefit of the virtual machine to be migrated to the candidate host, and finally the candidate host with the highest migration benefit score is determined as the destination host of the virtual machine to be migrated.
[0183] Step 305 , simulating the migration of the virtual machines to the corresponding destination hosts in sequence according to the order, until the load data of all hosts are less than the load threshold, and the load difference of the server cluster is less than the load difference threshold.
[0184] Among them, when the load data of all hosts in the server cluster are less than the load threshold, and the load difference of the server cluster is less than the load difference threshold, the performance of the server cluster reaches a relatively balanced state. If any of the hosts cannot achieve a load less than the target sensitivity threshold, performance balance is not achieved.
[0185] Step 306: Generate a migration scheduling strategy based on each virtual machine to be migrated and the corresponding destination host. The migration scheduling strategy includes a migration path for migrating the virtual machine to be migrated on at least one starting host in the server cluster to the corresponding destination host.
[0186] Step 307: Obtain the target migration mode and determine whether it is the automatic migration mode or the manual migration mode.
[0187] If it is determined that the target migration mode is the automatic migration mode, step 308 is executed to migrate the virtual machine to be migrated in the at least one starting host to the corresponding destination host based on the migration scheduling policy.
[0188] If it is determined that the target migration mode is the manual migration mode, step 309 is executed to send the migration scheduling policy to the front end for display.
[0189] Step 310: Obtain the user's execution requirement information for the migration scheduling strategy.
[0190] Step 311: Migrate the virtual machine to be migrated according to the execution requirement information.
[0191] It should be noted that the actual migration scheduling may fail. The reasons for scheduling failure can be divided into cluster resource reasons, host resource reasons, scheduling policy reasons, network resource reasons, virtual machine reasons, host reliability reasons, etc. Cluster resource reasons may generally be due to the cluster being a single node and no other hosts available. Host resource reasons may be due to insufficient resources on the destination host. Scheduling policy reasons may be that the current migrating virtual machine conflicts with the virtual machine policy on the destination host, making them mutually exclusive virtual machines, or the current migrating virtual machine is restricted from running on the destination host. Network resource reasons may be that the bandwidth and session on the destination host are too high, resulting in insufficient network resources; virtual machine reasons may be that the current virtual machine does not support migration operations. Host reliability reasons may be that the destination host has a hardware failure and the reliability score is too low.
[0192] In one embodiment, Figure 4 As shown in the figure, the external architecture diagram of DRS service deployment includes cluster server (i.e. the aforementioned server cluster), Agent (collector), database, front-end interface and DRS scheduling service.
[0193] 1. The Agent collector regularly collects configuration data, monitoring data, scheduling strategies and other information of server clusters, hosts and virtual machines, and then pushes it to the database.
[0194] 2. The DRS scheduling service regularly reads monitoring data, configuration data, scheduling policies, and scoring data in the database, generates migration scheduling policies through online scheduling, and pushes the migration scheduling policies to the database.
[0195] 3. The front-end interface queries the database to obtain the migration scheduling policy generated by the DRS scheduling service and displays it to the user.
[0196] 4. The user can decide whether to migrate the virtual machine according to the migration scheduling strategy displayed on the interface and the migration path information in the migration scheduling strategy. Usually the default is automatic execution. If the user chooses manual execution in the front-end interface, the user will have the priority to decide which virtual machines to be migrated by the electronic device.
[0197] In an application embodiment, if Figure 5 The figure below is a schematic diagram of a DRS performance balancing mode scheduling case for real data on the managed cloud online. The square nodes in the figure represent hosts SVR_aCloud_1~5 in the current cluster. The CPU load and memory load marked next to them represent the final load status after balancing. The oval nodes in the figure represent virtual machines migrated from the host. The arrow direction in the process is the migration direction, that is, the path from the starting host to the destination host. The sequence number in the oval represents the order or steps of virtual machine migration, which is described in words. The DRS balancing scheduling path of the entire cluster is as follows:
[0198] 1. The virtual machine [Xiaobaodang Interface] is migrated from the starting host SVR_aCloud_2 to the destination host SVR_aCloud_4.
[0199] 2. The virtual machine [Test Environment Coal Sharing Platform] is migrated from the starting host SVR_aCloud_2 to the destination host SVR_aCloud_5.
[0200] 3. The virtual machine [test environment harbor] is migrated from the starting host SVR_aCloud_2 to the destination host SVR_aCloud_4.
[0201] 4. The virtual machine [Production Environment MongoDB] is migrated from the starting host SVR_aCloud_2 to the destination host SVR_aCloud_5.
[0202] 5. The virtual machine [Endpoint Detection EDR] is migrated from the starting host SVR_aCloud_2 to the destination host SVR_aCloud_5.
[0203] 6. The virtual machine [production redis] is migrated from the starting host SVR_aCloud_3 to the destination host SVR_aCloud_5.
[0204] 7. The virtual machine [Coal Sharing Platform Application] is migrated from the starting host SVR_aCloud_3 to the destination host SVR_aCloud_5.
[0205] 8. The virtual machine [test environment card three car master node] is migrated from the starting host SVR_aCloud_3 to the destination host SVR_aCloud_5.
[0206] 9. The virtual machine [original monitoring] is migrated from the starting host SVR_aCloud_3 to the destination host SVR_aCloud_5.
[0207] 10. The virtual machine [test environment elk-02 node] is migrated from the starting host SVR_aCloud_3 to the destination host SVR_aCloud_5.
[0208] 11. The virtual machine [cu-app-731] is migrated from the starting host SVR_aCloud_1 to the destination host SVR_aCloud_5.
[0209] 12. The virtual machine [jump server AG1-PC (10.10.250.2)] is migrated from the starting host SVR_aCloud_1 to the destination host SVR_aCloud_5.
[0210] 13. The virtual machine [pro-dbs-51] is migrated from the starting host SVR_aCloud_1 to the destination host SVR_aCloud_5.
[0211] 14. The virtual machine [production environment rocketmq02 node] is migrated from the starting host SVR_aCloud_1 to the destination host SVR_aCloud_5.
[0212] 15. The virtual machine [test environment elk-01 node] is migrated from the starting host SVR_aCloud_1 to the destination host SVR_aCloud_5.
[0213] 16. The virtual machine [test environment application master node] is migrated from the starting host SVR_aCloud_1 to the destination host SVR_aCloud_5.
[0214] After executing the migration action according to the above path, the entire server cluster will reach a relatively balanced state, and ensure reliability under the user-configured scheduling strategy, sufficient network resources, and no resource competition in the future. The overall resource utilization and performance of the server cluster will be greatly improved compared to before scheduling.
[0215] For example, Figure 6 As shown in FIG. 1 , when the target scheduling mode is the performance balance mode and the target migration mode is the manual migration mode, the current virtual machine performance score and the virtual machine performance score after the migration scheduling strategy is executed are shown in FIG. 1 . Figure 6 It can be seen that the overall score of the current cluster is 28 points, indicating that the load is seriously unbalanced. DRS has generated scheduling suggestions, that is, the virtual machine migration path, but has not yet automatically executed scheduling. It is estimated that after resource scheduling is executed according to the migration scheduling policy, the performance score of the virtual machine can be improved from 30 points to 91 points, and the performance can be greatly improved.
[0216] like Figure 7 As shown in the figure, when the target scheduling mode is performance balance mode and the target migration mode is automatic migration mode, the current virtual machine performance score and the virtual machine performance score after the migration scheduling policy is executed. It can be seen from the figure that the overall score of the current cluster is 76 points, and the performance status is relatively healthy. Figure 7 The figure shows that the migration scheduling strategy has been automatically executed, achieving a relatively balanced load. As shown in the figure, the two virtual machines numbered Tab1 and Tab2 scored 58 points before resource scheduling, and the estimated score after migration scheduling is 85 points, with a migration performance benefit of 27 points.
[0217] In order to implement the method of the embodiment of the present application, the embodiment of the present application also provides a resource scheduling device for a server cluster, and the resource scheduling device for the server cluster corresponds to the resource scheduling method of the server cluster, such as Figure 8 As shown, each step in the above-mentioned resource scheduling method embodiment of the server cluster is also completely applicable to the resource scheduling device embodiment of the server cluster.
[0218] The resource scheduling device 800 of the server cluster includes: a first data acquisition module 801, a second data acquisition module 802, a scheduling strategy generation module 803 and a migration scheduling module 804. The first data acquisition module 801 is used to obtain a target scheduling mode and a target sensitivity threshold; the types of the target scheduling mode include at least a cost priority mode and a performance priority mode, and the target sensitivity threshold corresponds to the target scheduling mode; the second data acquisition module 802 is used to obtain the current usage data of the computing resources of each host in the server cluster; the scheduling strategy generation module 803 is used to generate a migration scheduling strategy based on the current usage data of the computing resources of each host, the target scheduling mode and the target sensitivity threshold, and the migration scheduling strategy includes a migration path for migrating a virtual machine to be migrated on at least one starting host in the server cluster to a corresponding destination host, and the starting host represents a source host for virtual machine migration; the migration scheduling module 804 is used to migrate the virtual machine to be migrated on at least one starting host to a corresponding destination host based on the migration scheduling strategy.
[0219] In one embodiment, the scheduling policy generation module 803 generates a migration scheduling policy based on the current usage data of the computing resources of each of the hosts, the target scheduling mode and the target sensitivity threshold, including: if the target scheduling mode is determined to be the cost priority mode, then based on the preset host determination policy, the target sensitivity threshold and the current usage data of the computing resources of each of the hosts, at least one starting host is determined, and a migration path is generated for the virtual machine to be migrated on the at least one starting host to be migrated to the corresponding destination host; if the target scheduling mode is determined to be the performance priority mode, then based on the target sensitivity threshold and the current usage data of the computing resources of each of the hosts, at least one starting host is determined, and the virtual machine information on the at least one starting host is obtained; based on the virtual machine information on the at least one starting host, a migration path is generated for the virtual machine to be migrated on the at least one starting host to be migrated to the corresponding destination host.
[0220] In one embodiment, the virtual machine information includes usage data of the computing resources of the virtual machine; the scheduling strategy generation module 803 generates a migration path for the virtual machine to be migrated on at least one starting host to the corresponding destination host based on the virtual machine information on the at least one starting host, including: sorting the virtual machine information on the at least one starting host from high to low according to the usage data of the computing resources of the virtual machines, simulating the migration of the virtual machines to the corresponding destination hosts in sequence according to the sorting until the load data of all hosts are less than the target sensitivity threshold, and determining the simulated migrated virtual machine as the virtual machine to be migrated in the at least one starting host; based on each of the virtual machines to be migrated and the corresponding destination host, generating a migration path for the virtual machine to be migrated on at least one starting host to the corresponding destination host.
[0221] In one embodiment, the scheduling strategy generation module 803 simulates migrating virtual machines to corresponding destination hosts in sequence according to the ranking, including: selecting a virtual machine to be migrated according to the ranking, obtaining the migration benefit score of the virtual machine to be migrated to each candidate host, and the performance score of each candidate host; determining the destination host to which the virtual machine to be migrated is to be migrated based on the migration benefit score of the virtual machine to be migrated to each candidate host, and the performance score of each candidate host; updating the computing resource usage data of the destination host based on the computing resource usage data of the destination host after simulating the migration of the virtual machine to be migrated; wherein the candidate host is a host in the server cluster other than the starting host.
[0222] In one embodiment, the scheduling strategy generation module 803 obtains the performance score of each candidate host, including: obtaining reliability data and affinity data of each candidate host, the reliability data representing the probability that the candidate host does not have a hardware failure when migrating the virtual machine to be migrated, and the affinity data representing whether the virtual machine to be migrated and the candidate host and the virtual machines on the candidate host are mutually exclusive; obtaining the remaining data of the computing resources of each candidate host and the network load data of the server cluster; determining the performance score of each candidate host based on the network load data, the remaining data of the computing resources of each candidate host, the reliability data and the affinity data.
[0223] In one embodiment, the scheduling strategy generation module 803 obtains the remaining data of the computing resources of each of the candidate hosts, including: determining whether the resource prediction function is enabled; if it is determined that the resource prediction function is enabled, then based on the trained resource prediction model, determining the predicted remaining data of the computing resources of each of the candidate hosts, and based on the predicted remaining data of the computing resources of each of the candidate hosts, determining the remaining data of the computing resources of each of the candidate hosts; if it is determined that the resource prediction function is not enabled, then based on the current usage data and initial resource data of the computing resources of each of the candidate hosts, determining the remaining data of the computing resources of each of the candidate hosts.
[0224] In one embodiment, the scheduling strategy generation module 803 determines the predicted remaining data of the computing resources of each candidate host based on the trained resource prediction model, including: obtaining the remaining data of the computing resources of the candidate host within a historical preset time period; inputting the remaining data of the computing resources of the candidate host within the historical preset time period into the trained resource prediction model to obtain the predicted remaining data of the computing resources of the candidate host, and the predicted remaining data of the computing resources is the remaining data of the computing resources of the candidate host within a future preset time period.
[0225] In one embodiment, the migration scheduling module 804 migrates the virtual machines to be migrated on the at least one starting host to the corresponding destination host based on the migration scheduling policy, including: obtaining a target migration mode; if it is determined that the target migration mode is an automatic migration mode, then based on the migration scheduling policy, migrating the virtual machines to be migrated in the at least one starting host to the corresponding destination host.
[0226] In one embodiment, if the migration scheduling module 804 determines that the target migration mode is the manual migration mode, it sends the migration scheduling policy to the front end for display; obtains the user's execution requirement information for the migration scheduling policy; and migrates the virtual machine to be migrated according to the execution requirement information.
[0227] In one embodiment, the first data acquisition module 801 acquires the target sensitivity threshold, including: acquiring input information representing the frequency of target scheduling; and determining the target sensitivity threshold based on the target scheduling mode and the input information.
[0228] In actual application, the first data acquisition module 801, the second data acquisition module 802, the scheduling strategy generation module 803 and the migration scheduling module 804 can be implemented by a processor in the resource scheduling device 800 of the server cluster. Of course, the processor needs to run the computer program in the memory to implement its function.
[0229] It should be noted that: the resource scheduling device for a server cluster provided in the above embodiment only uses the division of the above program modules as an example when performing resource scheduling for a server cluster. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the resource scheduling device for a server cluster provided in the above embodiment and the resource scheduling method embodiment for a server cluster belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0230] Based on the hardware implementation of the above program modules and in order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an electronic device. Fig. 9 Only an exemplary structure of the electronic device is shown, not all structures, and it can be implemented as needed. Fig. 9 Partial or complete structure shown.
[0231] like Fig. 9 As shown, the electronic device 900 provided in the embodiment of the present application includes: at least one processor 901, a memory 902, a user interface 903 and at least one network interface 904. The various components in the electronic device 900 are coupled together through a bus system 905. It can be understood that the bus system 905 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 905 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, in Fig. 9 Various buses are labeled as bus system 905.
[0232] The user interface 903 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen.
[0233] The memory 902 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.
[0234] The resource scheduling method of the server cluster disclosed in the embodiment of the present application can be applied to the processor 901, or implemented by the processor 901. The processor 901 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the resource scheduling method of the server cluster can be completed by the hardware integrated logic circuit or software instructions in the processor 901. The above-mentioned processor 901 can be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 901 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 902. The processor 901 reads the information in the memory 902 and completes the steps of the resource scheduling method of the server cluster provided in the embodiment of the present application in combination with its hardware.
[0235] In an exemplary embodiment, the electronic device may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.
[0236] It can be understood that the memory 902 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memories described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
[0237] In an exemplary embodiment, the present application also provides a computer storage medium, which can be a computer-readable storage medium, for example, a memory 902 storing a computer program, and the computer program can be executed by a processor 901 of an electronic device to complete the steps described in the method of the present application embodiment. The computer-readable storage medium can be a memory such as a ROM, a PROM, an EPROM, an EEPROM, a Flash Memory, a magnetic surface memory, an optical disk, or a CD-ROM.
[0238] In an exemplary embodiment, the embodiment of the present application further provides a computer program product, including a computer program, and the computer program can be executed by the processor 901 to complete the steps described in the method of the embodiment of the present application.
[0239] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0240] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0241] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A resource scheduling method for a server cluster, characterized in that: The method comprises: Acquire a target scheduling mode and a target sensitivity threshold; the types of the target scheduling mode include at least a cost priority mode and a performance priority mode, and the target sensitivity threshold corresponds to the target scheduling mode; Obtaining current usage data of computing resources of each host in the server cluster; Generate a migration scheduling strategy based on current usage data of computing resources of each of the hosts, the target scheduling mode and the target sensitivity threshold, wherein the migration scheduling strategy includes a migration path for migrating a virtual machine to be migrated on at least one starting host in the server cluster to a corresponding destination host, wherein the starting host represents a source host for the virtual machine migration; Based on the migration scheduling policy, the virtual machine to be migrated on the at least one starting host is migrated to the corresponding destination host.
2. The method according to claim 1, characterized in that The step of generating a migration scheduling strategy based on the current usage data of the computing resources of each host, the target scheduling mode and the target sensitivity threshold comprises: If it is determined that the target scheduling mode is the cost priority mode, then based on a preset host determination strategy, the target sensitivity threshold and current usage data of computing resources of each of the hosts, at least one starting host is determined, and a migration path is generated for migrating the virtual machine to be migrated on the at least one starting host to the corresponding destination host; If it is determined that the target scheduling mode is the performance priority mode, the at least one starting host is determined based on the target sensitivity threshold and the current usage data of the computing resources of each of the hosts, and the virtual machine information on the at least one starting host is obtained; based on the virtual machine information on the at least one starting host, a migration path is generated for the virtual machines to be migrated on at least one starting host to migrate to the corresponding destination host.
3. The method according to claim 2, characterized in that The virtual machine information includes usage data of computing resources of the virtual machine; the step of generating a migration path for migrating the virtual machine to be migrated on at least one starting host to a corresponding destination host based on the virtual machine information on at least one starting host includes: For the virtual machine information on the at least one starting host, sort the virtual machines from high to low according to the usage data of the computing resources of the virtual machines, simulate the migration of the virtual machines to the corresponding destination hosts in sequence according to the sorting, until the load data of all hosts are less than the target sensitivity threshold, and determine the simulated migration virtual machine as the virtual machine to be migrated in the at least one starting host; Based on the virtual machines to be migrated and the corresponding destination hosts, a migration path for migrating the virtual machines to be migrated on at least one starting host to the corresponding destination host is generated.
4. The method according to claim 3, characterized in that The step of simulating the migration of the virtual machines to the corresponding destination hosts in sequence according to the sequence includes: Selecting a virtual machine to be migrated according to the ranking, and obtaining a migration benefit score of the virtual machine to be migrated to each candidate host and a performance score of each candidate host; Determining a destination host to which the virtual machine to be migrated is to be migrated based on the migration benefit scores of the virtual machine to be migrated to each candidate host and the performance scores of each candidate host; Based on the usage data of the computing resources after the destination host simulates the migration of the virtual machine to be migrated, updating the usage data of the computing resources of the destination host; The candidate hosts are hosts in the server cluster except the starting host.
5. The method according to claim 4, characterized in that The step of obtaining the performance score of each candidate host includes: Obtaining reliability data and affinity data of each candidate host, wherein the reliability data indicates the probability that the candidate host does not have a hardware failure when migrating the virtual machine to be migrated, and the affinity data indicates whether the virtual machine to be migrated and the candidate host and the virtual machines on the candidate host are mutually exclusive; Obtaining remaining data of computing resources of each of the candidate hosts and network load data of the server cluster; A performance score of each of the candidate hosts is determined based on the network load data, the remaining data of the computing resources of each of the candidate hosts, the reliability data, and the affinity data.
6. The method according to claim 5, characterized in that The obtaining of remaining data of computing resources of each candidate host includes: Determine whether the resource forecasting function is enabled; If it is determined that the resource prediction function is enabled, the predicted remaining data of the computing resources of each of the candidate hosts is determined based on the trained resource prediction model, and the remaining data of the computing resources of each of the candidate hosts is determined based on the predicted remaining data of the computing resources of each of the candidate hosts; If it is determined that the resource prediction function is not enabled, the remaining data of the computing resources of each candidate host is determined based on the current usage data and initial resource data of the computing resources of each candidate host.
7. The method according to claim 6, characterized in that The step of determining predicted remaining data of computing resources of each candidate host based on the trained resource prediction model includes: Obtaining remaining data of computing resources of the candidate host within a historical preset time period; The remaining data of the computing resources of the candidate host within the historical preset time period is input into the trained resource prediction model to obtain the predicted remaining data of the computing resources of the candidate host, and the predicted remaining data of the computing resources is the remaining data of the computing resources of the candidate host within the future preset time period.
8. The method according to claim 1, characterized in that The migrating the virtual machine to be migrated on the at least one starting host to the corresponding destination host based on the migration scheduling policy includes: Get the target migration mode; If it is determined that the target migration mode is the automatic migration mode, then based on the migration scheduling policy, the virtual machine to be migrated in the at least one starting host is migrated to the corresponding destination host.
9. The method according to claim 8, characterized in that The method further comprises: If it is determined that the target migration mode is the manual migration mode, the migration scheduling policy is sent to the front end for display; Obtaining user's execution requirement information for the migration scheduling strategy; The virtual machine to be migrated is migrated according to the execution requirement information.
10. The method according to claim 1, characterized in that The step of obtaining a target sensitivity threshold comprises: Obtaining input information representing the frequency of target scheduling; The target sensitivity threshold is determined based on the target dispatch mode and the input information.
11. A resource scheduling device for a server cluster, characterized in that: The device comprises: A first data acquisition module is used to acquire a target scheduling mode and a target sensitivity threshold; the types of the target scheduling mode include at least a cost priority mode and a performance priority mode, and the target sensitivity threshold corresponds to the target scheduling mode; A second data acquisition module is used to acquire current usage data of computing resources of each host in the server cluster; A scheduling strategy generation module, configured to generate a migration scheduling strategy based on current usage data of computing resources of each of the hosts, the target scheduling mode and the target sensitivity threshold, wherein the migration scheduling strategy includes a migration path for migrating a virtual machine to be migrated on at least one starting host in the server cluster to a corresponding destination host, wherein the starting host represents a source host for virtual machine migration; The migration scheduling module is used to migrate the virtual machine to be migrated on the at least one starting host to the corresponding destination host based on the migration scheduling policy.
12. An electronic device, characterized in that: include: A processor and a memory for storing a computer program that can be executed on the processor, wherein: The processor is used to execute the steps of the method according to any one of claims 1 to 10 when running a computer program.
13. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
Citation Information
Cited By
Method and system for calling service capability in application software
CN120315893A
Thermal migration method and device for power distribution network service, electronic equipment, storage medium and computer program product
CN121029435A
Power distribution network service hot migration method and device, electronic equipment, storage medium and computer program product
CN121029435B
