Virtual machine scheduling method and device and computing equipment

By optimizing virtual machine scheduling in hyperconverged clusters, maximizing the number of local replicas, using hot migration technology to solve the problem of data remote access latency, achieving cluster performance optimization, and avoiding the high costs of hardware upgrades and architecture adjustments.

CN120492082APending Publication Date: 2025-08-15XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510361763.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In hyperconverged clusters, the increase in network latency caused by data remote replica access affects cluster performance. The existing technology requires hardware upgrades and architecture adjustments, which are costly and complex.

Method used

By optimizing virtual machine scheduling, maximizing the number of local replicas, reducing remote replica access, and using hot migration technology to optimize cluster performance without increasing costs.

Benefits of technology

Without changing the uniform distribution and cost of data, optimize cluster performance through virtual machine scheduling, reduce remote replica access latency, and improve system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492082A_ABST
    Figure CN120492082A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a virtual machine scheduling method and device and computing equipment. The method comprises the steps that the number of virtual machines and the positions and the number of data corresponding to the virtual machines are obtained; under the condition that the data position corresponding to each virtual machine in the at least one virtual machine is not changed, traversing the position arrangement of all the virtual machines; in each group of position arrangement of all the virtual machines, based on the position and the number of the data corresponding to each virtual machine in the at least one virtual machine, calculating the sum of logic distances of each virtual machine and the data corresponding to each virtual machine; based on the sum of the logic distances, position arrangement of all the virtual machines in at least one group is determined, and the sum of the logic distances is the minimum value; and determining the virtual machine needing to be scheduled based on the position arrangement. Therefore, the number of the local copies of the virtual machines in the server cluster is maximized, and under the condition that the cost is not increased, the performance optimization of the cluster can be realized through relatively small modification, that is, only by scheduling the virtual machines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtualization technology, and in particular to a virtual machine scheduling method, apparatus, and computing device. Background Art

[0002] In a hyperconverged cluster, multi-replication technology is a core mechanism for data storage. This technology ensures high data availability and fault tolerance by storing multiple copies of the same data on different nodes. Even if a node fails, the system can still access data from other replica nodes, ensuring business continuity while avoiding data loss or service interruptions caused by single points of failure.

[0003] As the number of nodes increases, the probability of data replicas being stored on remote nodes increases. While this distributed storage strategy improves data reliability and fault tolerance, it also introduces latency issues for remote data access. Specifically, when data replicas are stored on remote nodes, virtual machines need to read data from them, increasing network transmission latency. Especially in large-scale cluster environments, inter-node network latency and bandwidth limitations can further impact data access speed. This increased latency can impact cluster performance.

[0004] Therefore, while maintaining balanced data distribution, resolving the delay caused by accessing remote replicas is an urgent issue that needs to be addressed. Summary of the Invention

[0005] The embodiments of the present application provide a virtual machine scheduling method, apparatus, and computing device, which maximize the number of local copies of virtual machines in a cluster and optimize cluster performance with minor modifications, i.e., simply by scheduling virtual machines, without increasing costs.

[0006] In a first aspect, an embodiment of the present application provides a virtual machine scheduling method, the method comprising: obtaining the number of virtual machines and the location and quantity of data corresponding to the virtual machines; traversing the location arrangement of all virtual machines while keeping the location of the data corresponding to each virtual machine in at least one virtual machine unchanged; in each group of location arrangements of all virtual machines, based on the location and quantity of the data corresponding to each virtual machine in at least one virtual machine, calculating the sum of the logical distances between each virtual machine and the data corresponding to each virtual machine; based on the sum of the logical distances, determining the location arrangement of at least one group of all virtual machines, wherein the sum of the logical distances is the minimum value; and determining the virtual machines that need to be scheduled based on the location arrangement.

[0007] In the above example, based on the initial replica distribution of the VMs, the minimum logical distance between the VMs and their data is calculated, resulting in the VM scheduling policy that minimizes the number of remote VM replicas. VMs are scheduled according to this policy, optimizing and improving overall cluster performance with minimal, controllable changes.

[0008] In a possible implementation, before obtaining the number of virtual machines, the method further includes: after starting each of the at least one virtual machine, evenly distributing data corresponding to each of the at least one virtual machine.

[0009] In the above example, the overall performance of the cluster is optimized and improved through relatively few controllable changes without disrupting the uniform distribution of stored data or increasing costs.

[0010] In one possible implementation, after evenly distributing the data corresponding to each virtual machine in at least one virtual machine, initial position information of the data corresponding to at least one virtual machine and each virtual machine is obtained, and based on the position arrangement, the virtual machine that needs to be scheduled is determined, including: comparing the position arrangement and the initial position information, and scheduling the virtual machine based on the position arrangement that mobilizes the least number of virtual machines.

[0011] In the above example, by comparing the position arrangement of the virtual machines whose sum of the calculated logical distances is the minimum, that is, obtaining the expected position information of each virtual machine, and comparing the expected position information with the initial position information when each virtual machine is started, the number of virtual machines that need to be scheduled, as well as the initial position of the virtual machines that need to be scheduled and the target position of the scheduling can be obtained.

[0012] In a possible implementation, hot migration of the virtual machine is performed when the virtual machine is scheduled.

[0013] In the above example, the virtual machine completes the hot migration while it is active, without affecting the current business.

[0014] In one possible implementation, local data corresponding to each virtual machine in at least one virtual machine is preferentially accessed based on the location arrangement of the virtual machines.

[0015] In the above example, after scheduling the virtual machines according to the desired location arrangement of the virtual machines, each virtual machine accesses the data corresponding to the virtual machine according to the latest location arrangement, wherein the local copy is given priority in data access.

[0016] In a second aspect, an embodiment of the present application provides a virtual machine scheduling device, which includes: an acquisition module for acquiring the number of virtual machines and the location and quantity of data corresponding to the virtual machines; a calculation module for traversing the location arrangement of all virtual machines while keeping the location of data corresponding to each virtual machine in at least one virtual machine unchanged; in each group of location arrangements of all virtual machines, based on the location and quantity of data corresponding to each virtual machine in at least one virtual machine, calculating the sum of logical distances between each virtual machine and the data corresponding to each virtual machine; a determination module for determining the location information of the data corresponding to each virtual machine in at least one virtual machine based on the sum of the logical distances, wherein the sum of the logical distances is a minimum value; and a scheduling module for determining the virtual machine that needs to be scheduled based on the location information.

[0017] In one possible implementation, the device further includes: a distribution module configured to evenly distribute the data corresponding to each virtual machine in at least one virtual machine after starting each virtual machine in at least one virtual machine before obtaining the number of virtual machines and the location and quantity of data corresponding to the virtual machines.

[0018] In a third aspect, an embodiment of the present application provides a computing device, characterized in that the device runs computer program instructions to perform the method provided in the first aspect. Exemplarily, the device can be a chip or a processor.

[0019] In one example, the device may include a processor, which may be coupled to a memory, read instructions in the memory, and execute the method provided in the first aspect according to the instructions. The memory may be integrated into a chip or processor, or may be independent of the chip or processor.

[0020] In a fourth aspect, an embodiment of the present application provides a computer storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method provided in the first aspect.

[0021] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method provided in the first aspect.

[0022] It can be understood that the beneficial effects of the second and fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 This is a schematic diagram of the structure of data replica storage in a hyper-converged cluster;

[0024] Figure 2 A system architecture diagram of a cluster provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of the structure of the management module provided in an embodiment of the present application;

[0026] Figure 4 This is a flow chart of a virtual machine scheduling method provided in an embodiment of the present application;

[0027] Figure 5a A schematic diagram of a virtual machine scheduling process provided in an embodiment of the present application Figure 1 ;

[0028] Figure 5b A schematic diagram of a virtual machine scheduling process provided in an embodiment of the present application Figure 2 ;

[0029] Figure 5c A schematic diagram of a virtual machine scheduling process provided in an embodiment of the present application Figure 3 ;

[0030] Figure 6 A flowchart of a specific application of a virtual machine scheduling method provided for the implementation of this application;

[0031] Figure 7 It is a structural diagram of the computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The term "and / or" as used herein describes an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. The symbol " / " as used herein indicates that the related objects are in an "or" relationship, for example, A / B means either A or B.

[0033] The terms "first" and "second" in this specification and claims are used to distinguish different objects rather than to describe a specific order of objects. For example, "first response message" and "second response message" are used to distinguish different response messages rather than to describe a specific order of response messages.

[0034] In the description of this document, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "circumferential", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation.

[0035] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0036] To facilitate understanding of the technical solutions of the embodiments of the present application, the terms involved in this document are explained below.

[0037] Hyper-Converged Infrastructure (HCI): A technology architecture that integrates computing, storage, and networking. It aims to bring together the hardware and software resources of a data center to provide a highly integrated, scalable, and easy-to-manage solution.

[0038] Hyperconverged cluster: This integrates computing, storage, and network resources into a unified hardware platform and software framework, enabling centralized resource management and efficient utilization. It uses virtualization as its core and supports distributed storage.

[0039] Virtual Machine (VM): A computer environment simulated by software that can create multiple isolated virtual systems on a physical server.

[0040] Distributed storage: is a data storage technology that uses the disk space on each machine through the network to disperse data across multiple storage servers and form these dispersed storage resources into a virtual storage device.

[0041] Virtual Machine Monitor: Also known as a hypervisor, it is an intermediate software layer that runs between physical hardware and the operating system and is used to create and manage virtual machines.

[0042] Replicas: In distributed storage systems, replicas are multiple copies of data stored in different physical locations to improve data availability, reliability, and fault tolerance. In virtualized and distributed storage environments, virtual machine data replicas are typically set to two or three.

[0043] Remote Direct Memory Access (RDMA) is a highly efficient network communication technology that allows one computer to directly access the memory of another computer without excessive intervention from the operating system or CPU. It enables direct data transfer through hardware, bypassing the operating system protocol stack, significantly reducing latency, reducing CPU overhead, and improving data transfer efficiency.

[0044] Host Channel Adapter (HCA): This is a hardware device used to connect the server to the network.

[0045] Kernel bypass technology is a technique that bypasses the operating system kernel protocol stack, primarily used to reduce the kernel's involvement in the data processing path. By implementing the network protocol stack or data processing logic in user mode and directly accessing hardware devices, it avoids the multiple data copies and context switches between kernel and user modes required in traditional methods.

[0046] Offload card: This generally refers to a hardware accelerator card used to offload computing tasks from the CPU to dedicated hardware to improve system performance and efficiency. For example, a Smart NIC can use hardware offload functionality to transfer some or all tasks in the network protocol stack from the host CPU to the NIC hardware.

[0047] Virtual machine live migration: It is a technology that migrates a running virtual machine from one physical host to another in a virtualized environment without interrupting the operation of the virtual machine.

[0048] Transmission Control Protocol / Internet Protocol (TCP / IP): A set of communication protocols for interconnecting network devices, widely used on the Internet to ensure reliable data transmission between different networks.

[0049] Input / Output (I / O): The input and output operations of data in a computer system.

[0050] Hyperconverged architectures often utilize multiple replicas for data storage. Specifically, a piece of data is distributed across different nodes, creating multiple replicas. If a node fails, the system can switch to another node to read the corresponding data, ensuring continuous data availability.

[0051] Figure 1 The following is a diagram of the structure of data replica storage in a hyper-converged cluster. Figure 1 As shown in the figure, the hyper-converged cluster includes four nodes, node 1 to node 4. A node is an independent computing unit, which usually includes computing resources (such as CPU, memory) and storage resources.

[0052] Nodes 1 through 4 contain computing and storage resources and run several virtual machines (VMs). Each VM's data has multiple replicas, distributed across different nodes. Each replica may have both local and remote replicas. Local replicas are stored on the VM's node, while remote replicas are stored on nodes other than the VM's source node (the node where the data was created).

[0053] In a hyper-converged cluster, data copies are allocated using a certain strategy. Taking 4 nodes and 2 copies as an example, there is a 50% probability that the copy exists locally and a 50% probability that the copy exists remotely.

[0054] like Figure 1 As shown, virtual machine 1's data replicas (replica distribution 1) are distributed and stored on different nodes, with the local replica located on node 2 and the remote replica on node 3. Virtual machine 2's local replica is stored on node 1, and its remote replica is stored on node 2; virtual machine 3's local replica is stored on node 2, and its remote replica is stored on node 4; virtual machine 4's local replica is stored on node 1, and its remote replica is stored on node 3; virtual machine 5's local replica is stored on node 1, and its remote replica is stored on node 4; virtual machine 6's local replica is stored on node 3, and its remote replica is stored on node 4. For the virtual machine data on node 2, there's a 50% chance that the local replica is present locally, and a 50% chance that the remote replica is present remotely.

[0055] As the number of nodes increases, the probability of data replicas being stored on remote nodes increases. While this distributed storage strategy improves data reliability and fault tolerance, it also introduces latency issues for remote data access. Specifically, when data replicas are stored on remote nodes, reading data requires cross-node transmission, which increases network transmission latency. Especially in large-scale cluster environments, inter-node network latency and bandwidth limitations can further impact data access speed. This increased latency can negatively impact service performance, especially in scenarios with high real-time requirements.

[0056] Related technology 1 proposes that when cross-node remote copy access is required, remote direct memory access (RDMA) / offload card / kernel bypass technology is used to accelerate access to remote copies. However, in order to directly access memory through RDMA technology, traditional data access protocols (such as Transmission Control Protocol / Internet Protocol (TCP / IP)) need to be adjusted or replaced. This not only requires changes at the protocol stack level, but also involves changes to the network architecture and hardware facilities. The network stack of traditional protocols usually relies on the CPU and operating system, while RDMA directly accesses remote memory through hardware, bypassing the operating system and network protocol stack. This requires updating or replacing existing hardware, such as using a network card that supports RDMA.

[0057] To use RDMA technology, existing network and storage devices require hardware upgrades. For example, existing Ethernet cards and standard storage devices may not directly support RDMA and must be replaced with specialized hardware that supports the technology, such as RDMA-enabled network cards. This means the entire hardware architecture, network layer, and storage system may need to be redesigned and reconfigured. This hardware replacement and upgrade, as well as adjustments to the protocol stack and architecture, incurs high implementation costs and complexity.

[0058] Related technology 2 proposes a local copy priority solution. The copy allocation strategy is to prioritize storing data copies on the node where the virtual machine is located to reduce the delay caused by cross-node access and improve data reading efficiency.

[0059] However, Related Art 2 achieves data localization at the expense of uniform data distribution. When multiple virtual machine replicas are concentrated on a small number of nodes, such as in situations with high data access volume, the nodes with more data allocations can become performance bottlenecks, impacting overall system throughput and latency.

[0060] To address the above issues, an embodiment of the present application provides a virtual machine scheduling method. The method obtains the number of virtual machines and the location and quantity of data corresponding to the virtual machines; traverses the location arrangement of all virtual machines while keeping the location of data corresponding to each virtual machine in at least one virtual machine unchanged; in each group of location arrangements of all virtual machines, based on the location and quantity of data corresponding to each virtual machine in at least one virtual machine, calculates the sum of the logical distances between each virtual machine and the data corresponding to each virtual machine; based on the sum of the logical distances, determines the location arrangement of at least one group of all virtual machines, where the sum of the logical distances is the minimum; and based on the location arrangement, determines the virtual machine that needs to be scheduled.

[0061] Figure 2This is a system architecture diagram of a cluster provided in an embodiment of the present application. Figure 2 As shown, a cluster consists of multiple nodes that integrate computing, storage, or networking functions. For example, a cluster can be a hyperconverged cluster. Nodes can be physical computing nodes or virtual nodes. Physical nodes, for example, are servers. Servers can be rack servers, cabinet servers, blade servers, tower servers, general-purpose servers, GPU servers, high-performance servers, and the like. Servers can be connected via a high-speed network.

[0062] The management module monitors, manages, and configures cluster storage or computing resources. The management module can be deployed on one or more nodes. The node where the management module is deployed is called the management node.

[0063] The nodes run a virtual machine monitor that manages resource allocation to the virtual machines, such as CPU, memory, and storage. Each node also has a storage controller that manages the node's storage resources and reads / writes data from the shared storage pool.

[0064] When a virtual machine is started, the virtual machine monitor selects a node to run the virtual machine based on the configuration. After the virtual machine is started, the virtual machine monitor mounts the virtual machine disk to the shared storage pool through the storage controller. The virtual machine's data (such as the virtual disk) is distributed to multiple nodes in the cluster based on the storage policy. For example, the virtual machine's data is sharded into multiple blocks, and these data blocks are evenly distributed across the nodes in the entire cluster. The storage of data blocks uses a multi-copy mechanism, that is, each data block stores multiple copies, usually two or three copies. In a multi-copy storage strategy, copies of each data block are placed on different physical nodes. Among them, the data block copy located on the node where the virtual machine is located is called a local copy, while the copies stored on other nodes are called remote copies.

[0065] The virtual machine monitor manages the connection between the virtual machine and the storage controller. Input / output (I / O) requests from the virtual machine are sent to the virtual machine monitor, which then passes these requests on to the storage controller. For example, a request might include the location of a data block to be read. Upon receiving the read request, the storage controller parses the request content to determine the location of the data requested by the virtual machine. For example, the storage controller might need to query the metadata of the shared storage pool to determine the location of the requested data.

[0066] If the requested data exists locally, the storage controller retrieves it directly from the local disk. If the data is located on another node, the storage controller retrieves it from the storage controller on that node. The storage controller then transmits the retrieved data back to the virtual machine monitor, which then transfers the data to the virtual machine.

[0067] As mentioned above, after a VM is started, its data is divided into blocks according to the pre-set storage policy and evenly distributed across the nodes in the cluster. Multiple copies (for example, two or three) of each data block are generated. One copy is stored on the VM's local node, known as the local copy; the other copies are stored on other nodes, known as remote copies.

[0068] An acceleration engine module is deployed in the virtual machine monitor of each node to record the location information of each virtual machine and its stored data. For example, the specific location of each virtual machine and its data block replica can be recorded through a mapping table.

[0069] The management node collects the number of virtual machines, the location and quantity of data corresponding to the virtual machines reported by the acceleration engine modules of all nodes in the cluster, and obtains the number of all virtual machines in the cluster, the location and quantity of data corresponding to the virtual machines.

[0070] Based on the number of VMs in the cluster and the location and amount of data associated with each VM, the management module calculates the minimum sum of the logical distances between each VM and its corresponding data. A smaller sum of logical distances between VMs and their corresponding data indicates fewer remote replicas of the VM, less latency in accessing remote replicas across nodes, and better cluster performance.

[0071] In one possible implementation, the latency problem caused by remote replica access is formulated as minimizing the number of remote replicas allocated to a virtual machine. The objective function is solved under specific constraints to obtain an optimal solution, which then determines the virtual machines to be scheduled. The scheduling strategy involves constructing a location distribution for all virtual machines based on the optimal solution, and scheduling each virtual machine based on that location distribution.

[0072] The management module sends the virtual machine scheduling policy to the virtual machine monitor. Based on the scheduling policy, the virtual machine monitor performs live migration of virtual machines to achieve overall cluster optimization. This involves reallocating virtual machines to different nodes, maximizing the number of local replicas of virtual machine data while ensuring even data distribution. This ensures that virtual machine data is stored locally on the node as much as possible, reducing cross-node access latency, optimizing access paths, and improving system performance.

[0073] Figure 3 This is a schematic diagram of the structure of the management module provided in the embodiment of the present application. Figure 3 As shown, the management module includes an acquisition module, a calculation module, a determination module and a scheduling module.

[0074] The acquisition module collects the number of virtual machines and the location and quantity of the data corresponding to the virtual machines.

[0075] The calculation module traverses the position arrangement of all virtual machines while keeping the data position corresponding to each virtual machine unchanged, and calculates the sum of the logical distances between each virtual machine and the data corresponding to the virtual machine in each arrangement.

[0076] The determination module selects the location information of each virtual machine when the sum of the logical distances is the minimum.

[0077] The scheduling module determines the virtual machines that need to be scheduled.

[0078] based on Figure 1 The following is an introduction to the application scenarios of this application and an embodiment of the method of this application.

[0079] Figure 4 This is a flow chart of a virtual machine scheduling method provided by an embodiment of the present application. Figure 4 As shown, the scheduling method provided in the embodiment of the present application includes:

[0080] S401: Obtain the number of virtual machines and the location and number of data corresponding to the virtual machines.

[0081] In one possible implementation, before obtaining the number of virtual machines, the method further includes: after starting each of the at least one virtual machine, evenly distributing data corresponding to each of the at least one virtual machine. Evenly distributing data means that after distributing the data corresponding to each of the at least one virtual machine across cluster nodes, the amount of data on each node is the same or substantially the same.

[0082] In one possible implementation, the management module can obtain the number of virtual machines running on each node, as well as the location and amount of data corresponding to each virtual machine, through the acceleration engine module of each node. Specifically, the management module queries the number of virtual machines running on each node, as well as the number and storage locations of each virtual machine replica, to identify the distribution of different replicas across nodes. For example, the data for virtual machine 1 is: {virtual machine name: VM1, node: Node 1, number of replicas: 3, replica storage nodes: Node 1, Node 2, Node 3}.

[0083] The following describes in more detail the location information of virtual machines and their corresponding data replicas. For example, virtual machine VM1 runs on node 1, with its local replica stored on node 1, remote replica 1 stored on node 2, and remote replica 2 stored on node 3. For virtual machine VM2 runs on node 2, with its local replica data blocks stored on node 2, remote replica 1 stored on node 1, and remote replica 2 stored on node 4. For virtual machine VM3 runs on node 3, with its local replica stored on node 3, remote replica 1 stored on node 1, and remote replica 2 stored on node 4. Table 1 shows the location information of virtual machines and their corresponding data.

[0084] Table 1 Schematic diagram of the location information of virtual machines and data corresponding to virtual machines

[0085]

[0086] The acceleration engine module in each node sends the location information of the virtual machines and the data corresponding to the virtual machines to the management module. The management module maintains communication with the acceleration engine modules in each node, for example, through a heartbeat mechanism. The management module collects statistics on the location information of the virtual machines and the data corresponding to the virtual machines uploaded by the acceleration engine modules in each node.

[0087] S402, traversing the position arrangement of all virtual machines while keeping the data position corresponding to each virtual machine in at least one virtual machine unchanged; in each position arrangement of all virtual machines, calculating the sum of the logical distances between at least one virtual machine and the data corresponding to each virtual machine based on the position and quantity of the data corresponding to each virtual machine in at least one virtual machine.

[0088] In one possible implementation, the logical distance between the data corresponding to the virtual machines is the logical distance between the replica data of the virtual machines on each node. For example, if the replica of virtual machine i on node i is a local replica, then the distance between virtual machine i and the replica on node i is a first value, for example, the first value may be 0. If the replica of virtual machine i on node i is a remote replica, then the distance between virtual machine i and the replica on node i is a second value, for example, the second value may be 1.

[0089] For example, among the locations of all virtual machines, one set of locations is: virtual machine 1 on node 1, virtual machine 2 on node 1, virtual machine 3 on node 3, and virtual machine 4 on node 4. The location of the data corresponding to each virtual machine is: replica 1 of virtual machine 1 on node 1, replica 2 on node 2, and replica 3 on node 3. Replica 1 of virtual machine 2 on node 1, replica 2 on node 3, and replica 3 on node 4. Replica 1 of virtual machine 3 on node 2, replica 2 on node 3, and replica 3 on node 5. Based on the location information between the virtual machines and their data, the logical distance between the data corresponding to the virtual machines is calculated. Table 2 shows the logical distance between the data corresponding to the virtual machines.

[0090] Table 2 Schematic diagram of the logical distance between virtual machines and the data corresponding to them

[0091]

[0092] S403 : Determine a location arrangement of at least one group of all virtual machines based on the sum of the logical distances, where the sum of the logical distances is a minimum value.

[0093] In a possible implementation, the location arrangement is based on the location information of each virtual machine when the sum of logical distances is minimized.

[0094] In one possible implementation, a mathematical model for minimizing the number of remote replicas allocated to a virtual machine is established to obtain an optimal solution and a virtual machine scheduling strategy.

[0095] In one possible implementation, the solution to the mathematical model for minimizing the number of remote replicas allocated to a virtual machine is transformed into an integer linear programming problem, and the optimal solution is obtained by solving the integer linear programming method.

[0096] In one possible implementation, an objective function is constructed based on the logical distance between the virtual machine VM(i) and its replica data data(i). The objective function is expressed as formula (1):

[0097]

[0098] Where X is the number of hosts in the cluster, and Y is the number of VMs. D(i,j) is the decision variable representing the replica distance of VM i on node j. D(i,j) = 1 indicates remote allocation, meaning VM i has no local replica on node j. D(i,j) = 0 indicates local allocation, meaning VM i has a local replica on node j.

[0099] For example, according to the replicas of virtual machine 1 on all nodes shown in Table 2, the logical distance between virtual machine 1 and virtual machine 1's data is calculated as follows: When i=1, the remote replica distance of virtual machine 1 on all hosts is calculated:

[0100] Calculate the logical distance between virtual machine 2 and virtual machine 2's data as follows: When i = 2, calculate the distance between virtual machine 2's remote replicas on all hosts:

[0101] Calculate the logical distance between virtual machine 3 and virtual machine 3's data as follows: When i = 3, calculate the distance between virtual machine 3's remote replicas on all hosts:

[0102] Calculate the logical distance between virtual machine 4 and virtual machine 4's data as follows: When i = 4, calculate the distance between virtual machine 4's remote replicas on all hosts:

[0103] Find the total number of remote replicas of the virtual machine on all nodes and find the optimal solution using the constraints. The optimal solution indicates the desired placement of all virtual machines.

[0104] S404: Determine virtual machines that need to be scheduled based on the location arrangement.

[0105] The management module schedules the virtual machines according to the locations of the virtual machines VM(i), that is, determines which virtual machines to move, for example, from one node to another. The management module sends the virtual machine scheduling information to the virtual machine monitor of each node.

[0106] In a possible implementation, hot migration of the virtual machine is performed when the virtual machine is scheduled.

[0107] In one possible implementation, after determining one or more groups of location arrangements for virtual machines, select the group with the least number of virtual machines to be mobilized and schedule the virtual machines. For example: the determined location arrangement 1 for virtual machines is virtual machine 1 on node 2, virtual machine 2 on node 1, virtual machine 3 on node 3, and virtual machine 4 on node 4. The determined location arrangement 2 for virtual machines is virtual machine 1 on node 2, virtual machine 2 on node 3, virtual machine 3 on node 3, and virtual machine 4 on node 4. The sum of the logical distances between each virtual machine and the data corresponding to each virtual machine in location arrangement 1 and location arrangement 2 is the minimum value among all location arrangements. According to the initial location arrangement of the virtual machines in the cluster, virtual machine 1 needs to be scheduled to node 2 in location arrangement 1, and virtual machine 1 needs to be scheduled to node 2 and virtual machine 2 needs to be scheduled to node 3 in location arrangement 2. Then, a location arrangement with the least number of scheduled virtual machines is selected for virtual machine scheduling.

[0108] In an embodiment of the present application, based on the initial copy distribution of the virtual machine, virtual machine scheduling is regarded as an optimization problem to meet the copy distribution constraints of each host, such as the number of copies of the virtual machine. The optimization problem is converted into an integer linear programming model, the goal of which is to minimize the number of allocated remote copies of all virtual machines, and whether each virtual machine needs to be migrated is determined based on the solution of the planning problem. Through the optimization model, the optimal solution with the minimum sum of the number of remote copies of each virtual machine is obtained. The smaller the minimum value of the sum of the number of remote copies of each virtual machine, the fewer the number of virtual machines that need to be moved, and the closer the current local copies of the allocated virtual machines are to the expected value. The optimal solution indicates the host to which the virtual machine should be migrated so that the total number of remote copies of each virtual machine is minimized. During the solution process, some virtual machines may migrate from their original location to a new location, and the optimization model is used to try to ensure that each virtual machine has a local copy. For example, virtual machine 1 was originally on node 1. Through the optimization model processing, virtual machine 1 may be migrated from node 1 to node 3.

[0109] In the embodiments of the present application, after the initial virtual machine startup, the data corresponding to the virtual machine is evenly distributed. By scheduling the virtual machine, the number of local replicas of the virtual machine is maximized, that is, the number of remote replicas of the virtual machine is minimized, thereby reducing the read and write latency of the remote replicas of the virtual machine and achieving optimal cluster performance. When the data corresponding to the virtual machine is evenly distributed, the virtual machine is also guaranteed to have the most local replicas, reducing the latency of the virtual machine reading and writing data, thereby achieving optimal cluster performance.

[0110] On the basis of the above-mentioned embodiment, after determining the virtual machine that needs to be scheduled, the embodiment of the present application further optimizes the virtual machine hot migration process.

[0111] In one possible implementation, the node where the virtual machine is to be migrated needs to start memory compression before migration to reduce the amount of memory data transmitted and improve the efficiency of the migration process.

[0112] When a virtual machine is running, it will occupy a certain amount of memory, and this memory data will be transferred to the target host. When performing hot migration, if the virtual machine has a large memory, direct migration will consume a lot of bandwidth. The embodiment of the present application reduces the amount of data that needs to be transferred during migration by compressing the memory pages of the virtual machine.

[0113] In one possible implementation, before a virtual machine performs live migration, the acceleration engine module analyzes the virtual machine's I / O and determines its I / O type. A virtual machine's I / O type refers to how the virtual machine accesses resources such as storage during execution. I / Os with a high frequency of read requests are considered read-intensive, while I / Os with a high frequency of write requests are considered write-intensive.

[0114] The acceleration engine module calculates the read-write request ratio for the virtual machine on this node, for example, by counting the number of read and write requests. If the number of read requests far exceeds the number of write requests, the node is considered read-intensive. If the number of write requests far exceeds the number of read requests, the node is considered write-intensive.

[0115] Before a node's VM needs to be live migrated, the acceleration engine module performs different processing based on the VM's I / O type. If the VM's I / O type is read-intensive, the node's VM monitor initiates a migration instruction, including the name of the VM to be migrated (VM1), the target node (Node 3), and the migration type (hot migration). This means the VM will be migrated without stopping service. The VM monitor suspends VM1's activity and transfers the VM's memory pages from the initial node to the target node.

[0116] When the I / O type of the virtual machine that needs to be hot migrated is write-intensive, the hot memory and non-hot data in the virtual machine are identified. The hot memory is the memory area that is frequently accessed within a certain period of time. Non-hot data is the memory area that is less frequently accessed within a certain period of time. The embodiment of the present application gives priority to migrating non-hot data because the access frequency of non-hot data is low, so it can be migrated first to minimize the impact on the services of existing virtual machines. After migrating the non-hot data, hot dirty page migration is performed. Dirty pages refer to modified pages in the virtual machine memory. Hot dirty pages refer to memory areas that are frequently modified and accessed. When migrating hot dirty pages, first mark the hot dirty pages, start the virtual machine monitor of the target node, and the virtual machine monitor of the target node pulls the hot dirty pages. After the migration is completed, the management node will update the running status of VM1 to confirm that the virtual machine has been successfully migrated to the target node and started normal operation.

[0117] Figure 5a A schematic diagram of a virtual machine scheduling process provided in an embodiment of the present application Figure 1 .like Figure 5a As shown, in a four-node cluster, there are 4 nodes (node 1, node 2, node 3, and node 4), and 4 virtual machines (virtual machine 1, virtual machine 2, virtual machine 3, and virtual machine 4). Each virtual machine has 3 copies. Virtual machine 1 is on node 1, virtual machine 1 has no local copy, and the remote copies of the virtual machine are on nodes 2, node 3, and node 4. Virtual machine 2 is on node 1, the local copy of virtual machine 2 is stored on node 1, and the remote copies are stored on nodes 2 and node 4. Virtual machine 3 is on node 3, the local copy of virtual machine 3 is stored on node 3, and the remote copies are stored on nodes 1 and node 4. Virtual machine 4 is on node 4, virtual machine 4 has no local copy, and the remote copies are stored on nodes 1, node 2, and node 3. Ideally, virtual machine data is evenly distributed. It should be noted that in actual situations, due to the limitations of the number of nodes, the number of virtual machines, and the number of virtual machine copies, even distribution of virtual machine data cannot be achieved. The virtual machine scheduling method provided in the embodiments of the present application can still achieve optimal cluster performance.

[0118] According to the above location information of virtual machines and virtual machine data, Figure 5a One case of calculating the logical distance of virtual machine data of a virtual machine is:

[0119] The logical distance between VM 1 and its replica is: 1+1+1=3,

[0120] The logical distance between VM 2 and its replica is: 0+1+1=2,

[0121] The logical distance between VM 3 and its replica is: 0+1+1=2,

[0122] The logical distance between VM 4 and its replica is: 1+1+1=3,

[0123] Similarly, calculate each combination of virtual machines running on different nodes to obtain the logical distance between all virtual machines and virtual machine data transmission. The value with the smallest logical distance is the optimal solution.

[0124] The virtual machine that needs to be scheduled is determined, and the node performs virtual machine scheduling.

[0125] Figure 5b A schematic diagram of a virtual machine scheduling process provided in an embodiment of the present application Figure 2 When there are multiple optimal solutions, there are also multiple virtual machine scheduling strategies, such as Figure 5b As shown, VM 1 is migrated to Node 2, so that a local replica exists for VM 1. VM 4 is migrated to Node 2, so that a local replica exists for VM 4. The remote replicas for VMs 1 to 4 are the minimum.

[0126] Figure 5c A schematic diagram of a virtual machine scheduling process provided in an embodiment of the present application Figure 3 When there are multiple optimal solutions, there are also multiple virtual machine scheduling strategies, such as Figure 5c As shown, VM 1 is migrated to node 3, so a local replica exists for VM 1. VM 4 is migrated to node 2, so a local replica exists for VM 4. The remote replicas for VMs 1 to 4 are the minimum.

[0127] Based on the virtual machine scheduling method provided above, a specific application of the virtual machine scheduling method is described. Figure 6 A flowchart of a specific application of a virtual machine scheduling method provided for the implementation of this application. Figure 6 The specific contents include:

[0128] Step 601: The virtual machine starts.

[0129] Start the virtual machines according to the cluster configuration, and evenly distribute the virtual machines and their corresponding data.

[0130] Step 602: The management module obtains the number of virtual machines and the location and number of data corresponding to the virtual machines.

[0131] Step 603: The management module solves the optimal distance and generates a scheduling strategy.

[0132] Step 604: The virtual machine monitor executes the scheduling policy.

[0133] Step 605: The storage controller performs reading and writing according to the location information of the scheduled virtual machine.

[0134] Based on the same concept as the embodiment of the method of the present application, the embodiment of the present application also provides a virtual machine scheduling device. The virtual machine scheduling device includes several modules, each module is used to execute each step in the virtual machine scheduling method provided in the embodiment of the present application, and the division of the modules is not limited here. Those skilled in the art can clearly understand that in actual application, the various steps in the test method provided in the embodiment of the present application can be assigned to different modules as needed, that is, the internal structure of the device is divided into different modules to complete all or part of the functions described above. The modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more modules can be integrated into a unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the modules are only for the convenience of distinguishing each other and are not used to limit the scope of protection of this application. The specific working process of the modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0135] Based on the same concept as the embodiment of the method of the present application, the embodiment of the present application also provides a computing device, such as Figure 7 As shown, the computing device provided in the embodiment of the present application includes a processor 701 , a memory 702 and a communication interface 703 .

[0136] In the embodiment of the present application, the processor 701 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0137] Memory 702 may include a large-capacity memory for data or instructions, thereby providing storage space, which stores the operating system and executable program code of the network device, and may include but is not limited to: Windows system (an operating system), Linux system (an operating system), Hongmeng system (an operating system), etc., which are not limited here.

[0138] By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 702 may include removable or non-removable (or fixed) media. Where appropriate, the memory 702 may be located inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 702 is a non-volatile solid-state memory.

[0139] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, generally, the memory may include one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software that may include computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to the present application.

[0140] For example, the memory 702 may store a computer program, and when the processor 701 executes the computer program, the steps in the above-mentioned method embodiment are implemented. Alternatively, when the processor 701 executes the computer program, the functions of the modules in the above-mentioned device embodiment are implemented. For example, the computer program can be divided into one or more modules / units, and the one or more modules / units can be a series of computer program instruction segments that can perform specific functions. The one or more modules / units are stored in the memory 702 and executed by the processor 701 to complete the present application. For example, the computer program can be divided into multiple modules, such as the modules in the device described above.

[0141] The communication interface 703 is used to send and receive data, for example, to send data processed by the processor 701 to other computing devices, or to receive data sent by other computing devices.

[0142] Of course, to simplify, Figure 7 Only some of the components of the computing device 700 that are relevant to the present application are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, the computing device 700 may also include any other appropriate components according to specific application conditions. In addition, the computing device may be a network device such as a desktop computer, a notebook, a handheld computer, and a cloud server. It will be understood by those skilled in the art that Figure 7The computing device 700 is merely an example and does not limit the computing device. The computing device may include more or fewer components than shown, or a combination of certain components or different components. For example, the computing device may also include input devices, output devices, network access devices, buses, etc. For example, the input device may be a microphone array, or may include a keyboard, mouse, etc. For example, the output device may output various information to the outside world, and may include a display, speakers, printer, communication network, and remote output devices connected thereto.

[0143] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.

[0144] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product, characterized in that when the computer program product runs on a processor, the processor executes the method in the above embodiment.

[0145] It should be understood that each step of the above method embodiment can be completed by a hardware-based logic circuit or a software-based instruction in a processor.

[0146] It is understood that the order of execution of the steps in the above embodiments does not necessarily imply a specific order of execution. The order of execution of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In addition, in some possible implementations, the steps in the above embodiments can be selectively executed according to actual circumstances, and can be executed partially or completely, which is not limited here.

[0147] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.

[0148] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0149] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0150] The basic principles of the present invention have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, and effects mentioned in the present invention are merely illustrative and not restrictive, and it should not be assumed that these advantages, strengths, and effects are required of each embodiment of the present disclosure. In addition, the specific details disclosed above are merely illustrative and facilitating understanding, and are not restrictive. The above details do not limit the present disclosure to necessarily being implemented using the above specific details.

[0151] The block diagrams of the devices, devices, equipment, and systems involved in this disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, or configured in any manner. Words such as "include," "comprise," "have," and the like are open-ended words, meaning "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0152] It should also be noted that in the apparatus, device, and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0153] The above description has been provided for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

[0154] It should be understood that the various numerical numbers involved in the embodiments of the present invention are only used for the convenience of description and are not intended to limit the scope of the embodiments of the present invention.

Claims

1. A virtual machine scheduling method, characterized in that: The method comprises: Obtain the number of virtual machines and the location and quantity of data corresponding to the virtual machines; Traversing the position arrangement of all virtual machines while keeping the data position corresponding to each virtual machine in at least one virtual machine unchanged; In each group of position arrangements of all virtual machines, based on the position and quantity of data corresponding to each virtual machine in the at least one virtual machine, calculate the sum of logical distances between each virtual machine and the data corresponding to each virtual machine; Determining a location arrangement of at least one group of all virtual machines based on the sum of the logical distances, wherein the sum of the logical distances is a minimum value; Based on the location arrangement, the virtual machines that need to be scheduled are determined.

2. The method according to claim 1, characterized in that Before obtaining the number of virtual machines, the method further includes: after starting each of the at least one virtual machine, evenly distributing data corresponding to each of the at least one virtual machine.

3. The method according to claim 2, characterized in that After evenly distributing the data corresponding to each virtual machine in the at least one virtual machine, obtaining initial position information of the at least one virtual machine and the data corresponding to each virtual machine, The determining of the virtual machines to be scheduled based on the position arrangement includes: comparing the position arrangement with initial position information, The virtual machines are scheduled based on a position arrangement that mobilizes the least number of virtual machines.

4. The method according to any one of claims 1 to 3, characterized in that Perform hot migration of the virtual machine when scheduling the virtual machine.

5. The method according to any one of claims 1 to 4, characterized in that Based on the location arrangement of the virtual machines, local data corresponding to each virtual machine in the at least one virtual machine is preferentially accessed.

6. A virtual machine scheduling device, characterized in that: The device comprises: An acquisition module, used to obtain the number of virtual machines and the location and number of data corresponding to the virtual machines; a calculation module configured to traverse the positional arrangements of all virtual machines while maintaining the position of data corresponding to each virtual machine in at least one virtual machine; and calculate, in each positional arrangement of all virtual machines, the sum of logical distances between the data corresponding to each virtual machine and each virtual machine based on the position and quantity of data corresponding to each virtual machine in the at least one virtual machine; a determination module, configured to determine location information of data corresponding to each virtual machine in at least one virtual machine based on the sum of the logical distances, wherein the sum of the logical distances is a minimum value; The scheduling module is used to determine the virtual machine that needs to be scheduled based on the location information.

7. The method according to claim 6, characterized in that The device further comprises: The distribution module is used to evenly distribute the data corresponding to each virtual machine in the at least one virtual machine after starting each virtual machine in the at least one virtual machine before obtaining the number of virtual machines and the location and number of data corresponding to the virtual machines.

8. A computing device, characterized in that include: a memory for storing executable code; A processor, configured to implement the method according to any one of claims 1 to 5 when executing the executable code.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 5.

10. A computer program product comprising instructions, characterized in that When the instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 5.