WO2020134364A1 - Virtual machine migration method, cloud computing management platform, and storage medium - Google Patents

Virtual machine migration method, cloud computing management platform, and storage medium Download PDF

Info

Publication number
WO2020134364A1
WO2020134364A1 PCT/CN2019/110999 CN2019110999W WO2020134364A1 WO 2020134364 A1 WO2020134364 A1 WO 2020134364A1 CN 2019110999 W CN2019110999 W CN 2019110999W WO 2020134364 A1 WO2020134364 A1 WO 2020134364A1
Authority
WO
WIPO (PCT)
Prior art keywords
load
physical machine
machine
moment
physical
Prior art date
Application number
PCT/CN2019/110999
Other languages
French (fr)
Chinese (zh)
Inventor
童遥
孔鹏
李华
申光
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2020134364A1 publication Critical patent/WO2020134364A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Definitions

  • the embodiments of the present invention relate to the field of virtual machine resource scheduling in a cloud computing data center, and in particular, to a virtual machine migration method, a cloud computing management platform, and a storage medium.
  • the cloud computing management platform is a complex large-scale system, and the virtual machine is an important part of the cloud computing management platform. It has the characteristics of cross-system, resource isolation, and migration. Efficient virtual machine cluster deployment and dynamic migration operations can decentralize virtual It is an important part of the cloud computing management platform that the machine is integrated and meets the needs of large-scale applications. It can improve the operation, maintenance and service quality of the cloud computing management platform.
  • Dynamic migration occurs because of the need for load balancing. In the cloud computing environment, some computers may be overloaded and have been overloaded, while other calculations are often idle, which greatly reduces The overall resource utilization of the system. Load balancing is to adjust tasks among multiple physical resources to obtain the best overall resource utilization.
  • the migration triggering strategy in the related art is based on a fixed threshold.
  • the system When a certain type of performance load of a node is greater than the fixed threshold, the system will trigger a migration; however, due to various types of sudden Therefore, once the sudden load at any instant reaches a fixed threshold, the virtual machine migration will be triggered, which leads to frequent virtual machine migration, unnecessary migration overhead, and system reliability cannot be guaranteed.
  • the embodiments of the present invention are expected to provide a virtual machine migration method, cloud computing management platform, and storage medium, which solves that the sudden burst load in the related art will trigger the virtual machine migration when it reaches a fixed threshold, which leads to frequent Virtual machine migration causes unnecessary migration overhead, avoids the interference of the sudden load on the system, and improves the reliability of the system.
  • a virtual machine migration method is provided, which is applied to a cloud computing management platform.
  • the method includes:
  • the second load of the first physical machine at the second moment is predicted; wherein, the second moment is after the first moment;
  • the second threshold selects the virtual machine to be migrated from the virtual machines on the first physical machine; wherein, the second threshold is greater than the first threshold;
  • predicting the second load of the first physical machine at the second moment includes:
  • the first load is greater than the first threshold, obtain a third load at least two moments within a preset time period; wherein the preset time period includes the first time and the time before the first time At least one third moment, the third load at each moment in the at least two moments includes at least two loads with different attributes; the loads with different attributes represent different types of resources occupied in the first physical machine;
  • the second load is calculated based on the fourth load at each moment.
  • the calculating the second load according to the fourth load at each moment includes:
  • the average value of the fourth load at multiple times is calculated to obtain the second load.
  • the method further includes :
  • the request type includes a static request or a dynamic request
  • the method further includes:
  • the weight value of each load in the third load at each moment is determined.
  • the third load at each moment further includes a distance, wherein the distance represents the distance between the first physical machine and the data center that receives the user request, and the cloud computing management platform further includes In the data center, the data center is used to manage a third physical machine, and the third physical machine includes the first physical machine.
  • the method before calculating the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment, the method further includes:
  • the weight value of each load in the third load at each moment is determined.
  • the number of virtual machines on the first physical machine is multiple, and if the second load is greater than a second threshold, selecting the virtual machine to be migrated from the virtual machines on the first physical machine includes: :
  • the virtual machine to be migrated is selected from multiple virtual machines on the first physical machine according to the resource utilization rate.
  • the selecting a virtual machine to be migrated from multiple virtual machines on the first physical machine according to the resource utilization rate includes:
  • resource utilization rate is greater than or equal to a third threshold, predict a fifth load of each virtual machine on the first physical machine at the third moment; wherein the third moment is after the first moment;
  • the selecting a virtual machine to be migrated from multiple virtual machines on the first physical machine according to the resource utilization rate includes:
  • the resource utilization rate is less than or equal to a fourth threshold, it is determined that each virtual machine on the first physical machine is the virtual machine to be migrated; wherein, the fourth threshold is less than the third threshold.
  • the determining the second physical machine includes:
  • the physical machine with the sixth load less than the fifth threshold is selected from the physical machines in the cloud computing management platform, and determined as the third physical machine; wherein the third physical machine is different from the first physical machine, so The number of the third physical machine is multiple;
  • the second physical machine is determined from at least one fourth physical machine.
  • the determining the second physical machine from at least one fourth physical machine includes:
  • the second physical machine is determined from the fourth physical machine according to the predicted remaining resource amount of each of the fourth physical machine.
  • the determining the second physical machine from the fourth physical machine according to the predicted remaining resource amount of the fourth physical machine includes:
  • the fourth physical machine corresponding to the maximum value in the predicted remaining resource amount of the fourth physical machine is the second physical machine.
  • a virtual machine cluster is established on the physical machine of the cloud computing management platform, the number of the virtual machines to be migrated is at least two, the number of the virtual machines to be migrated and the number of the second physical machines The same; before migrating the virtual machine to be migrated to the second physical machine, the method further includes:
  • each of the virtual machines to be migrated According to the load of each of the virtual machines to be migrated and the load of each of the target physical machines, sort the multiple target physical machines to obtain a priority queue.
  • sorting the plurality of second physical machines to obtain a priority queue includes:
  • the migrating the virtual machine to be migrated to the second physical machine includes:
  • a cloud computing management platform includes:
  • Memory used to store executable instructions
  • the processor is configured to execute the executable instructions stored in the memory to implement the steps in the above virtual machine migration method.
  • a storage medium stores one or more programs, and the one or more programs may be executed by one or more processors to implement, for example, The steps of the above virtual machine migration method.
  • the second load of the first physical machine at the second moment is predicted ; Where the second moment is after the first moment; if the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine; wherein, the second threshold is greater than the first threshold; determine the second physical Machine, and migrate the virtual machine to be migrated to the second physical machine; where the second physical machine is different from the first physical machine; that is to say, in the embodiment of the present invention, the burst of the first physical machine is determined at the first moment
  • the sexual load is greater than the first threshold
  • the load of the first physical machine at the future moment is predicted, and when it is determined that the load at the future moment is higher than the second threshold greater than the first threshold, a migration is triggered, which is effective This avoids the interference of the sudden load on the system, and solves the problem that
  • FIG. 1 is a schematic diagram of a functional architecture of a cloud computing platform management system provided by an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an implementation architecture of a cloud computing platform management system provided by an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an agent implementation architecture provided by an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a virtual machine migration model provided by an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of a virtual machine migration method according to an embodiment of the present invention.
  • FIG. 6 is a schematic flowchart of another virtual machine migration method according to an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart of another virtual machine migration method according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a virtual machine cluster deployment architecture based on resource classification provided by an embodiment of the present invention.
  • FIG. 9 is a schematic flowchart of a virtual machine migration method according to another embodiment of the present invention.
  • FIG. 10 is a schematic flowchart of another virtual machine migration method according to another embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a cloud computing platform management system according to an embodiment of the present invention.
  • the cloud computing management platform is a complex large-scale system, and the virtual machine is an important part of the cloud computing management platform. It has the characteristics of cross-system, resource isolation, and migration. Efficient virtual machine cluster deployment and dynamic migration operations can decentralize virtual It is an important part of the cloud computing management platform that the machine is integrated and meets the needs of large-scale applications. It can improve the operation, maintenance and service quality of the cloud computing management platform.
  • the cloud computing management platform has the characteristics of huge resources, complex structure, and wide geographical distribution, and its application has the characteristics of flexible requests, different resource types, and dynamic changes in load, etc., it deploys and dynamically migrates virtual machine clusters.
  • the strategy presents a huge challenge. Dynamic migration occurs because of the need for load balancing. In the cloud computing environment, some computers may be overloaded and have been overloaded, while other calculations are often idle, which greatly reduces The overall resource utilization rate of the system. Load balancing is to adjust tasks among multiple physical resources to obtain the best overall resource utilization.
  • the cloud computing management platform has thousands of servers, and each physical machine may have dozens of virtual machines.
  • the resource types of these virtual machines vary, and performance data is being generated all the time. Faced with such large-scale servers and data, it is difficult to directly analyze the performance of the cloud computing management platform using traditional methods.
  • the third aspect the guarantee of system reliability
  • operating system virtualization technology such as non-downtime migration technology, which migrates the virtual machine to another lightly loaded server without the user's awareness. It provides regular management and maintenance of the system. And error recovery provides a brand new experience. Although the system consumes less performance when migrating, the system cannot effectively apply sudden loads.
  • the migration strategy of most load balancing methods is only based on a fixed threshold, that is, the load of the node machine exceeds the upper limit of the load threshold, then the node machine triggers a migration, so that the peak burst load will be instantaneous Triggering the migration of virtual machines can easily cause unnecessary migration overhead.
  • the current load prediction method either predicts the load of the virtual machine or the load of the application, and some methods of load prediction of the physical host.
  • the load index range is narrow, and the singular value algorithm is used in the prediction method. Incremental weighting, etc., but the purpose of the prediction is to select physical machines that meet the conditions and migrate all virtual machines on it. During the migration process, the same physical node machine may be selected as the target node, resulting in a sharp increase in the load of the selected target node, resulting in Migration shocks.
  • the current method of virtual machine migration involves cluster deployment.
  • the virtual machine and the physical machine are sorted according to the central processing unit (CPU) occupancy rate or memory occupancy rate, and then one by one is matched, or the virtual machine is used.
  • the ratio between the CPU usage and the memory usage is sorted.
  • the sorting result matches the sorting result of the physical machine.
  • the reference index is narrow and the improvement of the migration efficiency of the virtual machine is not significant.
  • the current image transfer method involved in virtual machine migration is based on the sequential copying of the cache of the virtual machine image to the target physical host.
  • the size of the virtual machine cluster to be migrated is relatively large, there is a defect of low efficiency.
  • the embodiments of the present invention provide a virtual machine migration method, which is applied to a cloud computing management platform.
  • the cloud computing management platform may also be referred to as a cloud computing management platform system, which may also be referred to as a system hereinafter; the system uses a multi-level distribution
  • the architecture has multiple data centers, and each data center has multiple physical machines and a data center server. The data center is connected to the system server through the network.
  • the client accesses the system server.
  • a system server manages all the data centers. Each data center is equipped with a data center server.
  • the data center server manages all physical machines in the data center and is installed on each physical machine.
  • the agent is responsible for processing the commands sent by the data center server and responding to the operation results.
  • This distributed multi-layer management structure can easily realize the expansion of the system, and is beneficial to reduce the pressure on the server.
  • the cloud computing management platform system 10 includes an image file management module 110, a cluster management module 120, a performance monitoring module 130, and a resource management module 140, described separately below.
  • the image file management module (Image Manager) 110 can upload and download images, classify image resource types, and copy management.
  • the image resource type is initially specified by the user, and can be revised later by the system.
  • the virtual machine cluster management module (Cluster Manager) 120 can implement cluster editing, cluster deployment and cluster deletion.
  • Performance monitoring module 130 can realize physical machine performance monitoring, virtual machine performance monitoring and system load performance prediction.
  • Resource management module (Resource Manager) 140 can realize physical resource addition, physical resource deletion, physical resource editing and image library management.
  • the implementation architecture of the cloud computing management platform system is shown in FIG. 2 and includes a presentation layer 210, a logic layer 220, and a data persistence layer 230, which are described below.
  • the presentation layer 210 is a display interface for user interaction with the system, and displays system performance, operation results, and cluster operation status through tables, graphics, and text.
  • the logic layer 220 is the core layer of the cluster management strategy. It is responsible for responding to the operation commands sent by the presentation layer, and provides access interfaces to display the system operation status. It provides five sub-modules, which are the Resource Manager module and performance management. (Performance Manager) module, virtualization engine (Virtualization Engine) module, agent management (Agent Manager) module, front-end interactive interface API Interface module.
  • the Agent Manager module is mainly deployed on each physical machine and virtual machine of the system.
  • the agent on the physical machine is mainly used to respond to the operation commands sent by the data center server, such as virtual machine creation, start, stop, destruction, migration Wait, it has to collect performance data and submit to the system.
  • the Agent in the virtual machine is mainly used to send the current performance status of the virtual machine to the system.
  • the collected performance data mainly includes CPU utilization, network bandwidth utilization, memory utilization, and file system status over a period of time.
  • Agent is also responsible for sending machine performance status information to the server, the implementation architecture of Agent is shown in Figure 3, including image files
  • the processing module 310, the virtualization event processing module 320, and the performance monitoring module 330 will be described separately below.
  • the image file processing module 310 can realize the reception of the image file image and the transmission of the image file.
  • the virtualization event processing module 320 can implement virtual machine startup, virtual machine creation, virtual machine stop, and virtual machine deployment.
  • the performance monitoring module 330 can implement performance monitoring on database programs, file transfer programs, and Extensible Markup Language XML programs.
  • the Performance Manager module is responsible for analyzing the data collected by the Agent Manager to determine the current operating status of the entire and each physical.
  • the Performance Manager module can predict the performance of the system that may occur in the next time. When the load is too heavy, it can issue an overload warning to the system to remind managers to increase physical resources or adjust the load through load balancing. This module provides decision support for the deployment and migration of virtual machines and users viewing the current system operating status.
  • the Virtualization Engine module is the core module of the system. It can accept user requests to implement a series of virtualization operations, including the creation of virtual machines, the start of virtual machines, the stop of virtual machines, the destruction of virtual machines and other events.
  • the cluster deployment request is received, after XML parsing of the cluster deployment request, if it is determined that the cluster can be deployed, the cluster deployment process is performed, such as passing the image, configuring the cluster deployment file, starting the cluster, etc. It is sent to the Agent Manager module in the form of commands for specific operations. It also accepts the information from the Performance Manager module. When a machine is overloaded, it migrates some virtual machines to a lighter-loaded machine.
  • the Resource Manager module is mainly responsible for managing physical resources and monitoring the current physical resource usage. These physical resources mainly include machine CPU, memory, file system, and network. This module also manages the resources of each mirror library.
  • the data persistence layer 230 provides various methods for data persistence, the database program (Database) Provider provides support for database access, and the file service program (File-Server Provider) persists large data in the form of files, such as mirror files , XML program (XML Provider) is mainly used to support the reading and writing of XML files.
  • the cloud computing management platform system 10 further includes a virtual machine dynamic migration controller (not shown in FIG. 1).
  • the virtual machine dynamic migrator is composed of two large modules, a workload prediction module and a migration control module, as shown in FIG. 4, and the migration control module may include a migration trigger module, a virtual machine selection module to be migrated, and a target physical machine selection module.
  • the migration trigger module is set to determine the timing of migration, that is, determine when a virtual machine should be migrated, to ensure that the performance of the entire physical machine always maintains a good state;
  • the virtual machine selection module to be migrated is set to determine which virtual The machine should be migrated;
  • the target physical machine selection module is set to determine to which target physical machine the virtual machine to be migrated should be migrated.
  • embodiments of the present invention provide a virtual machine migration method, which is applied to a cloud computing management platform; as shown in FIG. 5, the method includes the following steps:
  • Step 101 If the first load of the first physical machine at the first moment is greater than the first threshold, predict the second load of the first physical machine at the second moment.
  • the second moment is after the first moment.
  • the cloud computing management platform determines that the first load of the first physical machine at the first moment is greater than the first threshold, and does not directly trigger the migration of the virtual machine on the first physical machine, but predicts the future at the second moment The second load of the first physical machine at the moment, so that the second load is used to further determine whether to trigger the migration of the virtual machine.
  • the system can collect the load data of the physical machine in real time or periodically collect the load data of the physical machine, which lays a foundation for predicting the load data of the physical machine.
  • a total of 288 sample points can be collected within 24 hours with a sampling period of 5 minutes.
  • the load data of the physical machine is collected in real time, the load data is saved, and further, the CPU utilization data of various services on the physical machine can be used as the dynamic requirements of the CPU parameters of the cloud task executed by the virtual machine of the physical machine the amount.
  • the load at the second time T2 may be calculated based on the load data at the first time T1 and the load data at multiple times within a specified time period before T1.
  • the load data at multiple times within a specified time period before T1 may be used to calculate the load at the second time T2.
  • the migration controller in the system completes the migration under the guidance of the control module in the migration controller through the cooperation between the migration trigger module, the virtual machine selection module to be migrated, and the target physical machine selection module. Decision, selection of virtual machines to be migrated, migration of virtual machines to be migrated to target physical machines.
  • the virtual machine dynamic migration controller adopts a performance prediction algorithm to determine the migration timing and select the migration target physical machine.
  • Step 102 If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine.
  • the second threshold is greater than the first threshold.
  • the cloud computing management platform determines that the second load is greater than the second threshold, that is, when it is determined that the load in the future is higher than the second threshold greater than the first threshold, a migration is triggered; and, once the virtual machine is determined When the migration is triggered, select some or all virtual machines from the first physical machine for migration.
  • the system can determine the performance load status of a physical machine node and determine the time to trigger the migration.
  • the migration triggering strategy in the related art is based on a fixed threshold, and when certain types of performance load of a physical machine node exceeds this specified threshold, the system will trigger a migration.
  • the first physical machine is determined at the first moment
  • the virtual machine migration is not directly carried out, but the load of the past period and the current time is comprehensively considered, and then the future load is predicted, only when the future load meets the preset conditions. Trigger the migration of virtual machines. In this way, you can effectively prevent the interference of the sudden load on the system and reduce the performance loss of the system due to unnecessary migration.
  • the system will determine whether to trigger a virtual machine migration. In practical applications, first, it is analyzed whether the current load of a physical machine exceeds the threshold k1, and if it is exceeded, the next step is performed; second, in order to verify whether the current load information is a sudden load, it can be based on the physical machine's The load data is used to predict the load at the future time; then, after obtaining the load at the future time, if the load at the future time is greater than the threshold k1, the system will trigger a migration. On the contrary, the system will not trigger the migration, so it can effectively avoid the interference of the sudden load on the system.
  • the system when the system selects the virtual machine to be migrated through the virtual machine to be migrated selection module, the system can be implemented through the following two steps:
  • Step B1 According to the predicted result, the resource type with the highest utilization rate is analyzed.
  • Step B2 Select a virtual machine with the highest utilization rate for the resource type analyzed in step B1. This virtual machine is the virtual machine to be migrated.
  • the CPU utilization of the physical machine exceeds the first parameter
  • the physical machine when the physical machine is overloaded, that is, the CPU utilization of the physical machine exceeds the first parameter
  • the physical machine is overloaded that is, the CPU utilization of the physical machine is lower than the second parameter
  • the criterion for selecting the virtual machine to be migrated may be that the virtual machine with the largest predicted load on the physical machine is first migrated out of the current working host, that is, the current physical machine, and the current physical machine can satisfy the remaining Future resource requirements for virtual machines.
  • the criterion for selecting the virtual machine to be migrated may be that the virtual machine with the largest predicted load on the physical machine is first migrated out of the current working host, that is, the current physical machine, and the current physical machine can satisfy the remaining Future resource requirements for virtual machines.
  • all virtual machines are migrated out of the current physical machine, and then the virtual machine is deleted to save computing resources.
  • Step 103 Determine the second physical machine, and migrate the virtual machine to be migrated to the second physical machine.
  • the second physical machine is different from the first physical machine, and the second physical machine belongs to the cloud computing management platform.
  • the next step is to select the migration target host, that is, the destination physical machine.
  • the selection of the migration destination host needs to consider that it can provide sufficient resources to the virtual machine to be migrated, and ensure that after the migration is completed, the load of the destination host will not exceed the preset threshold and cause two or more migrations.
  • Step C1 Select the destination host with less load information.
  • Step C2 When the number of destination hosts is multiple, as long as the destination host with the smallest load information is selected, the workload prediction method is used to predict the load of the destination host in the future. If the load of the destination host in the future is still the smallest compared to other destination hosts, the next step is executed, otherwise it returns to step C1 to reselect the destination host.
  • Step C3 If the load value of the virtual machine to be migrated plus the predicted value of step C2 will not exceed the preset threshold, the destination host will be selected as the migration target of the virtual machine, otherwise return to step C1.
  • the second load of the first physical machine at the second moment is predicted; After a moment; if the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine; wherein, the second threshold is greater than the first threshold; determine the second physical machine, and transfer the virtual machine to be migrated Migrate to the second physical machine; where the second physical machine is different from the first physical machine; that is, in the embodiment of the present invention, when it is determined that the burst load of the first physical machine at the first moment is greater than the first threshold, Predict the load of the first physical machine at the future moment, and when it is determined that the load at the future moment is higher than the second threshold greater than the first threshold, trigger a migration, thus effectively avoiding sudden load pairs
  • the interference of the system solves the problem that the sudden burst load in the related technology will trigger the migration of the virtual machine when it reaches
  • embodiments of the present invention provide a virtual machine migration method, which is applied to a cloud computing management platform; a virtual machine cluster is established on a physical machine of the cloud computing management platform, and the number of virtual machines to be migrated is at least two.
  • the virtual machine migration process can be optimized by using cluster deployment technology.
  • the main function to be completed by the virtual machine cluster deployment method based on resource classification is to be able to select N physical nodes, and the resources of these nodes are enough to deploy a cluster of n virtual machines, so that the entire physical
  • the resources of the computer system are relatively balanced and comprehensively utilized.
  • the method includes:
  • Step 201 If the first load of the first physical machine at the first moment is greater than the first threshold, predict the second load of the first physical machine at the second moment.
  • the second moment is after the first moment.
  • step 201 if the first load of the first physical machine at the first moment is greater than the first threshold, before predicting the second load of the first physical machine at the second moment, the following steps are further included:
  • Step S1 The cloud computing management platform analyzes the resource type of the virtual machine cluster and distinguishes the resource type. There are many ways to analyze the resource type of the cluster: it can be specified by the user; it can be analyzed according to the historical data of the image used by the cluster.
  • Step S2 The cloud computing management platform filters the cluster deployment request. If it is analyzed that the deployment system is unable to complete the cluster deployment due to CPU, memory, file capacity, network bandwidth and other limitations, the deployment request should be filtered and submitted to customer feedback.
  • Step 202 If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine.
  • the second threshold is greater than the first threshold.
  • the priority queue represents the virtual machine resource load priority queue.
  • Step 203 Determine the second physical machine.
  • all physical machine nodes in the process of determining the second physical machine, can be traversed in cycles, and it can be calculated whether the physical machine node can also deploy a new virtual machine according to the following formula.
  • L ⁇ L1 It indicates that the current load of the physical node is relatively low and can be used to deploy virtual machines; when the load information value L1 ⁇ L ⁇ L2, it indicates that the current load of the physical machine node is in the best state, and the virtual machine can also be deployed, but the new virtual machine cannot The physical machine node is overloaded; when the load information value L>L2, it indicates that the physical machine node is currently overloaded, and the physical machine node should be reselected.
  • the load information is determined according to the resource type of the cluster, and the cluster is divided into a computing-intensive cluster, a storage-intensive cluster, and a traffic-intensive cluster. Furthermore, determining the virtual machine to be migrated based on the cluster can improve the positioning efficiency.
  • the virtual machine resource load priority queue is inserted until the physical nodes are selected for all virtual machines.
  • Step 204 Obtain the load of each virtual machine to be migrated.
  • Step 205 Determine a target physical machine corresponding to each virtual machine to be migrated from multiple second physical machines.
  • the plurality of second physical machines include target physical machines.
  • Step 206 Acquire the load of multiple target physical machines.
  • Step 207 Sort multiple target physical machines according to the load of each virtual machine to be migrated and the load of each target physical machine to obtain a priority queue.
  • step 207 sorts multiple target physical machines according to the load of each virtual machine to be migrated and the load of each target physical machine to obtain a priority queue, which can be achieved by the following steps:
  • Step 207a Calculate the sum of the load of each virtual machine to be migrated and the load of the target physical machine corresponding to each virtual machine to be migrated to obtain the transmission load.
  • Step 207b Sort the multiple target physical machines according to the transmission load to obtain a priority queue.
  • Step 208 Determine the priority of each target physical machine according to the priority queue.
  • Step 209 Perform image transmission on the virtual machine to be migrated corresponding to each target physical machine according to the order of priority from high to low.
  • the transmission load corresponding to the target physical machine with a high priority is less than the transmission load corresponding to the target physical machine with a low priority.
  • migrating the virtual machine to be migrated from the first physical machine to the target physical machine in the second physical machine means that the virtual machine needs to be restored. This process consumes the resources of the physical machine. If the load is high, the data will be transmitted again; that is, if the target physical machine has a low load, the image will be transmitted first, and then the virtual machine will be restored based on the image. Finally, start all the virtual machines in the cluster to complete the cluster deployment.
  • an embodiment of the present invention provides a virtual machine migration method, which is applied to a cloud computing management platform. It should be noted that the purpose of this embodiment is to use a virtual machine cluster image to express expressly during the process of virtual machine migration. Technology to help improve the efficiency of virtual machine dynamic migration.
  • the virtual machine image file contains cluster applications, operating systems, etc.
  • its file size is often in the tens of millions of bytes, and can even reach hundreds of millions of bytes. Therefore, it may take a long time to transfer an image file from the image library to the physical machine, and a virtual machine cluster may be composed of dozens of virtual machines. Deploying and migrating such a cluster requires a greater time cost.
  • the fast image transfer method uses the image and copy of the image library as the root node. After the first copy is completed, the image file that has just been transferred in the entire cloud platform system has twice the number of images and copies, and then the image library The mirror and copy of, and the mirror of the first transfer serve as the parent node of the second mirror transfer.
  • the mirror file in the system will have four times the number of mirrors and copies. This cycle is passed until the number of virtual machines required by the cluster can be met.
  • the system only includes the image files such as image1 and image3, image2 and image6, and image4 and image5 in the solid line box; after the first copy is completed, the system includes the dotted box
  • the image files such as image2 and image4, image1 and image5, and image3 and image6, that is, after the first copy is completed, the image files just transferred in the entire cloud platform system have twice the number of images and copies.
  • adopting the virtual machine cluster image fast express technology may include the following steps:
  • the image transfer strategy will select M physical machines from the selected physical machine, and then transfer the image file to the selected physical machine, which is basically a mirror backup pair A physical machine.
  • the M backups in the image library are called the root node, and the M physical machines that have received the image are called the first-generation child nodes.
  • M backup nodes are the root node, plus M first-generation child nodes, and send mirror images to 2M second-generation child nodes, respectively.
  • the rapid express technology of virtual machine cluster mirroring can provide strategic support for the multi-channel parallel transmission of mirror images, which greatly improves the transmission speed of the virtual machine cluster mirror file.
  • embodiments of the present invention provide a virtual machine migration method, which is applied to a cloud computing management platform.
  • the method includes the following steps:
  • Step 301 Receive a user request and obtain the request type of the user request.
  • the request type includes a static request or a dynamic request.
  • server cluster systems have their own load characteristics, and the load indicators that should be considered are also different.
  • load indicators For example: in a Web server cluster system, for a request for static content, the server only needs to read the corresponding from the disk The content can be sent to the browser; when requesting dynamic content, it often needs to be read, compiled and processed to generate the requested file before it can be sent to the client.
  • user requests can be divided into two types. Among them, requests for static content.
  • the main load that such requests bring to the server is the network bandwidth load.
  • requests for static web pages For requests for dynamic content, the load that such requests bring to the server is mainly the occupation of CPU and memory resources.
  • requests for dynamic web pages and database access In web applications, such requests are mainly requests for dynamic web pages and database access.
  • determining the request type requested by the user it can be determined according to the file type requested by the user.
  • Step 302 If the first load is greater than the first threshold, obtain third loads at least two moments within a preset time period.
  • the preset time period includes the first time and at least one third time before the first time, and the third load at each time in the at least two times includes at least two loads with different attributes; the loads with different attributes represent the first The types of occupied resources in physical machines are different.
  • At least two loads with different attributes include: the utilization rate of the central processor of the first physical machine, the utilization rate of the memory of the first physical machine, and the utilization rate of the input interface/output interface of the first physical machine And at least two of the utilization rates of the network bandwidth of the first physical machine.
  • Step 303 Acquire the attribute of each load in the third load at each moment.
  • the loads with different attributes represent different types of resources occupied in the first physical machine.
  • the third load at each moment may include the utilization rate of the central processor of the first physical machine, the utilization rate of the memory of the first physical machine, and the utilization rate of the input interface/output interface of the first physical machine And at least two of the utilization rates of the network bandwidth of the first physical machine.
  • Step 304 Determine the weight value of each load in the third load at each moment according to the request type and the attribute of each load in the third load at each moment.
  • the workload forecast value at the next moment is calculated by weighted average according to the current and previous load data.
  • the weight of the load data it is necessary to first determine the type of user request, if it is a request for static content , The weight of the network bandwidth item is increased by 20%, and the weight of CPU and memory are both reduced by 10%; if it is a request for dynamic content, the weight of CPU and memory are increased by 10%, and the weight of the network bandwidth item is increased. The weight is reduced by 20%.
  • the weight value of each load in the third load is determined according to the request type and the attribute of each load in the third load at a certain time, for example, the CPU utilization weight value is 15% , The memory utilization weight value is 15%, the input interface/output interface utilization weight value is 25%, and the network utilization bandwidth weight value is 45%.
  • the weight value of each load in the third load is determined according to the request type and the attribute of each load in the third load at a certain time, such as the CPU utilization weight value is 35%, the memory utilization rate The weight value is 35%, the input interface/output interface utilization weight value is 25%, and the network utilization bandwidth weight value is 5%.
  • Step 305 Calculate the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment.
  • the fourth load at each moment can be calculated using Formula 1.
  • Step 306 Calculate the second load according to the fourth load at each moment.
  • the average value of the fourth load at multiple times is calculated to obtain the second load.
  • Step 307 If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine.
  • the second threshold is greater than the first threshold.
  • selecting the virtual machine to be migrated from the virtual machines on the first physical machine may include the following steps:
  • Step 307a1 if the second load is greater than the second threshold, obtain the resource utilization rate of the first physical machine.
  • Step 307b1 Select a virtual machine to be migrated from multiple virtual machines on the first physical machine according to the resource utilization rate.
  • step 307b1 selects a virtual machine to be migrated from multiple virtual machines on the first physical machine according to the resource utilization rate, and may further include the following steps:
  • the fifth load of each virtual machine on the first physical machine at the third moment is predicted.
  • the third moment is after the first moment.
  • the resource utilization rate is greater than or equal to the third threshold, it is determined that the physical machine is overloaded, and then the fifth load of each virtual machine on the first physical machine at the third moment is predicted.
  • the virtual machine corresponding to the maximum load among the fifth loads is selected from the virtual machines on the first physical machine, and determined as the virtual machine to be migrated.
  • selecting the virtual machine to be migrated from the virtual machines on the first physical machine may further include the following steps:
  • Step 307a2 If the resource utilization rate is less than or equal to the fourth threshold, determine that each virtual machine on the first physical machine is a virtual machine to be migrated.
  • the fourth threshold is smaller than the third threshold.
  • the resource utilization rate is less than or equal to the fourth threshold, it is determined that the physical machine has a low load condition, and then all virtual machines on the physical machine are determined to be virtual machines to be migrated.
  • the physical machine when the physical machine is overloaded, such as CPU utilization exceeding 80% and low load, such as CPU utilization being less than 20%, some or all of the virtual machines on the physical machine need to be migrated to other according to the current state Run on the physical machine.
  • the virtual machines When in an overload state, the virtual machines are sorted in descending order according to the amount of future workload, and the virtual machines with the highest workload in the future are selected for migration.
  • the selection criterion is to migrate the virtual machine with the largest predicted load out of the current physical machine first, and enable the host to meet the future resource requirements of the remaining virtual machines.
  • a low-load state all virtual machines are migrated out of the current physical machine.
  • Step 308 Determine the second physical machine, and migrate the virtual machine to be migrated to the second physical machine.
  • the second physical machine is different from the first physical machine.
  • determining the second physical machine in step 308 may be implemented by the following steps:
  • Step 308a Acquire the sixth load of each physical machine in the cloud computing management platform at the first moment.
  • Step 308b Select the physical machine with the sixth load less than the fifth threshold from the physical machines in the cloud computing management platform, and determine it as the third physical machine.
  • the third physical machine is different from the first physical machine, and the number of the third physical machine is multiple.
  • the system when determining the third physical machine, may also select the physical machine with the smallest load from the physical machines in the cloud computing management platform and determine the first and third physical machines. Further, based on the first and third physical machines, step 308c is executed. If the predicted load corresponding to the first and third physical machines, that is, the seventh load, is not the smallest, then reselect the physical machine in the cloud computing management platform except the first The smallest physical machine other than the third physical machine is the second and third physical machines, and the subsequent steps are performed.
  • Step 308c Predict the seventh load of the virtual machine on each third physical machine at the fourth moment.
  • the fourth moment is after the first moment.
  • Step 308d Calculate the sum of the seventh load of each third physical machine and the load of the virtual machine to be migrated to obtain multiple target loads.
  • Step 308e Determine a target load among the multiple target loads that is less than the sixth threshold.
  • Step 308f Select the third physical machine corresponding to the target load less than the sixth threshold from the third physical machine, and determine it as the fourth physical machine.
  • the number of the fourth physical machine is at least one.
  • Step 308g Determine a second physical machine from at least one fourth physical machine.
  • the step 308g determining the second physical machine from the at least one fourth physical machine may be implemented by the following steps:
  • the amount of resource demand expansion and contraction is a negative value, indicating that the future load is decreasing.
  • the amount of resource demand expansion and contraction is positive, indicating that the future load is increasing.
  • each fourth physical machine minus the sixth load of each fourth physical machine is calculated to obtain the unallocated resource amount of each fourth physical machine.
  • the value of the unallocated resource amount of each fourth physical machine minus the resource demand expansion and contraction amount of each fourth physical machine is calculated to obtain the predicted remaining resource amount of each fourth physical machine.
  • the second physical machine is determined from the fourth physical machine.
  • determining the second physical machine from the fourth physical machine according to the predicted remaining resource amount of each fourth physical machine may be achieved by the following steps: determining the maximum of the predicted remaining resource amount of the fourth physical machine The fourth physical machine corresponding to the value is the second physical machine.
  • embodiments of the present invention provide a virtual machine migration method, which is applied to a cloud computing management platform.
  • the method includes the following steps:
  • Step 401 If the first load is greater than the first threshold, obtain third loads at least two moments within a preset time period.
  • the preset time period includes the first time and at least one third time before the first time, and the third load at each time in the at least two times includes at least two loads with different attributes.
  • the third load at each moment includes a distance, where the distance represents the distance between the first physical machine and the data center that receives the user request, and the cloud computing management platform also includes data
  • the data center is used to manage the third physical machine.
  • the third physical machine includes the first physical machine.
  • the third load at each moment also includes the utilization rate of the central processor of the first physical machine and the At least two of the utilization rate of the memory, the utilization rate of the input interface/output interface of the first physical machine, and the utilization rate of the network bandwidth of the first physical machine.
  • a large cloud computing platform usually includes multiple data centers, commonly known as data centers in the same city. Multiple data centers are generally not located in a building, but are distributed in data center computer rooms in different locations. The distance between them is 5-10 kilometers. If the virtual machines are migrated across data centers, the service level agreement of the business will be affected due to the distance. Therefore, the migration of virtual machines across data centers is restricted.
  • the weighted average is used to calculate the predicted workload value at the next time.
  • I/O and network bandwidth are four indicators, and the distance indicator is added, and the unit can be kilometers. The effect achieved in this way is that the predicted load of the local data center is low and the load of the remote data center is high, which effectively prevents the virtual machine from migrating to the remote data center.
  • Step 402 Acquire the attribute of each load in the third load at each moment.
  • loads with different attributes represent different types of resources occupied in the first physical machine.
  • Step 403 Determine the weight value of each load in the third load at each moment according to the attribute of each load in the third load at each moment.
  • the CPU utilization weight value is 20%
  • the memory utilization weight value is 20%
  • the input interface/output interface utilization weight value is 20%
  • the network utilization bandwidth weight value is 20. %.
  • Step 404 Calculate the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment.
  • Step 405 Calculate the second load according to the fourth load at each moment.
  • the average value of the fourth load at multiple times is calculated to obtain the second load.
  • Step 406 If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine.
  • the second threshold is greater than the first threshold.
  • the physical machine when the physical machine is overloaded, such as CPU utilization exceeding 80% and low load, such as CPU utilization being less than 20%, some or all of the virtual machines on the physical machine need to be migrated to other according to the current state Run on the physical machine.
  • the virtual machines When in an overload state, the virtual machines are sorted in descending order according to the amount of future workload, and the virtual machines with the highest workload in the future are selected for migration.
  • the selection criterion is to migrate the virtual machine with the largest predicted load out of the current physical machine first, and enable the host to meet the future resource requirements of the remaining virtual machines.
  • a low-load state all virtual machines are migrated out of the current physical machine.
  • Step 407 Determine the second physical machine, and migrate the virtual machine to be migrated to the second physical machine.
  • the second physical machine is different from the first physical machine.
  • a workload prediction method is proposed.
  • the load comprehensively considers multiple factors such as CPU usage, memory usage, disk IO, network bandwidth, and distance.
  • the classification of business requests adjusts the weight of the load index, so as to accurately select the virtual machines that need to be migrated and install the hosts, reduce the number of virtual machine migrations, and avoid migration shocks.
  • a virtual machine cluster deployment method based on resource classification is proposed. Different virtual machine clusters are divided according to resource types, which can quickly select the virtual machines to be migrated and the target physical host, and help improve the efficiency of virtual machine dynamic migration.
  • a fast image transfer method based on image copy split is proposed. This method uses the image and copy of the image library as the root node, and through multiple cyclic copies, the virtual machine image can be M, 2M, 4M... Fast copy speed, help improve the efficiency of virtual machine dynamic migration.
  • the cloud computing management platform 11 includes: a processor 1101, a memory 1102, and a communication bus 1103, where:
  • the communication bus 1103 is used to implement a communication connection between the processor 1101 and the memory 1102.
  • the processor 1101 is used to execute a virtual machine migration program stored in the memory 1102 to implement the following steps:
  • the second load of the first physical machine at the second moment is predicted; where the second moment is after the first moment;
  • the second threshold selects the virtual machine to be migrated from the virtual machines on the first physical machine; wherein, the second threshold is greater than the first threshold;
  • the processor 1101 is used to execute in the memory 1102 if the first load of the first physical machine at the first moment is greater than the first threshold, predict the second load of the first physical machine at the second moment , Can be achieved by the following steps:
  • the first load is greater than the first threshold, obtain a third load at least two moments within a preset time period; wherein the preset time period includes the first moment and at least one third moment before the first moment, at least two moments
  • the third load at each moment in includes at least two loads with different attributes; the loads with different attributes represent different types of resources occupied in the first physical machine;
  • the second load is calculated based on the fourth load at each moment.
  • the average value of the fourth load at multiple times is calculated to obtain the second load.
  • the processor 1101 is used to execute a virtual machine migration program in the memory 1102 to implement the following steps:
  • the method further includes:
  • the weight value of each load in the third load at each moment is determined.
  • the third load at each moment also includes a distance, where the distance represents the distance between the first physical machine and the data center that receives the user request, and the cloud computing management platform also includes a data center, The data center is used to manage the third physical machine, and the third physical machine includes the first physical machine.
  • the processor 1101 is used to execute a virtual machine migration program in the memory 1102 to implement the following steps:
  • the weight value of each load in the third load at each moment is determined.
  • the processor 1101 is used to execute a plurality of virtual machines on the first physical machine in the memory 1102. If the second load is greater than the second threshold, select from the virtual machines on the first physical machine When you want to migrate a virtual machine, you can use the following steps:
  • the virtual machine to be migrated is selected from multiple virtual machines on the first physical machine according to the resource utilization rate.
  • the processor 1101 is used to execute the selection of a virtual machine to be migrated from multiple virtual machines on the first physical machine in the memory 1102 according to the resource utilization rate by the following steps:
  • resource utilization rate is greater than or equal to the third threshold, predict the fifth load of each virtual machine on the first physical machine at the third moment; where the third moment is after the first moment;
  • the virtual machine corresponding to the maximum load in the fifth load is selected from the virtual machines on the first physical machine, and determined as the virtual machine to be migrated.
  • the processor 1101 is used to execute the selection of a virtual machine to be migrated from multiple virtual machines on the first physical machine in the memory 1102 according to the resource utilization rate by the following steps:
  • the resource utilization rate is less than or equal to the fourth threshold, it is determined that each virtual machine on the first physical machine is a virtual machine to be migrated; wherein, the fourth threshold is less than the third threshold.
  • processor 1101 when used to execute the determination of the second physical machine in the memory 1102, the following steps may be implemented:
  • the third physical machine corresponding to the target load less than the sixth threshold is selected from the third physical machines, and determined as the fourth physical machine; wherein the number of the fourth physical machine is at least one;
  • the second physical machine is determined from at least one fourth physical machine.
  • the second physical machine is determined from the fourth physical machine according to the predicted remaining resource amount of each fourth physical machine.
  • the processor 1101 is used to execute the determination of the second physical machine from the fourth physical machine according to the predicted remaining resource amount of the fourth physical machine in the memory 1102 by the following steps:
  • the fourth physical machine corresponding to the maximum value in the predicted remaining resource amount of the fourth physical machine is the second physical machine.
  • a virtual machine cluster is established on the physical machine of the cloud computing management platform, the number of virtual machines to be migrated is at least two, and the number of virtual machines to be migrated is the same as the number of second physical machines.
  • the device 1101 is used to execute a virtual machine migration program in the storage 1102 to implement the following steps:
  • the multiple target physical machines are sorted to obtain a priority queue.
  • the processor 1101 is used to execute, in the memory 1102, sort multiple second physical machines according to the load of each virtual machine to be migrated and the load of each target physical machine to obtain a priority queue Can be achieved by the following steps:
  • the processor 1101 when the processor 1101 is used to execute the root migration of the virtual machine to be migrated to the second physical machine in the memory 1102, the following steps may be implemented:
  • the embodiments of the present invention provide a storage medium that stores one or more programs, and the one or more programs may be executed by one or more processors to implement Figures 5 and 7 Steps in the method for migrating a virtual machine provided by the corresponding embodiment.
  • the above-mentioned computer storage media may be read-only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-memory) Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Random Access Memory (Ferromagnetic Random Access Memory, FRAM), Flash Memory (Flash) Memory, Magnetic Surface memory, compact disc, or read-only compact disc (Compact Disc Read-Only Memory, CD-ROM) and other memories; can also be one of the above memories or any combination of various electronic devices, such as mobile phones, computers, tablet devices, Personal digital assistant, etc.
  • the methods in the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware, but in many cases the former is better Implementation.
  • the technical solution of the present invention can be embodied in the form of a software product in essence or part that contributes to the existing technology, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk,
  • the CD-ROM includes several instructions to enable a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the embodiments of the present invention.
  • each flow and/or block in the flowchart and/or block diagram and a combination of the flow and/or block in the flowchart and/or block diagram may be implemented from computer program instructions.
  • These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processing machine, or other programmable data processing device to produce a machine that enables the generation of instructions executed by the processor of the computer or other programmable data processing device
  • These computer program instructions may also be stored in a computer readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instructions
  • the device implements the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, which is executed on the computer or other programmable device
  • the instructions provide steps for implementing the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
  • the embodiment of the present invention solves the problem that the sudden burst load in the related art will trigger the migration of the virtual machine when it reaches a fixed threshold, thus causing frequent virtual machine migration, causing unnecessary migration overhead, and avoiding the sudden load
  • the interference of the system improves the reliability of the system.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A virtual machine migration method, comprising: if a first load of a first physical machine is greater than a first threshold at the current first moment, predicting a second load of the first physical machine at a second moment, wherein the second moment is after the first moment; if the second load is greater than a second threshold, selecting, from the virtual machines on the first physical machine, a virtual machine to be migrated, wherein the second threshold is greater than the first threshold; determining a second physical machine, migrating the virtual machine to be migrated to the second physical machine, wherein the second physical machine is different from the first physical machine. A cloud computing management platform and a storage medium are further comprised.

Description

一种虚拟机迁移方法、云计算管理平台和存储介质Virtual machine migration method, cloud computing management platform and storage medium 技术领域Technical field
本发明实施例涉及云计算数据中心的虚拟机资源调度领域,尤其涉及一种虚拟机迁移方法、云计算管理平台和存储介质。The embodiments of the present invention relate to the field of virtual machine resource scheduling in a cloud computing data center, and in particular, to a virtual machine migration method, a cloud computing management platform, and a storage medium.
背景技术Background technique
云计算管理平台是一个复杂的大型系统,虚拟机是云计算管理平台的重要部分,它具有跨系统、资源隔离、可迁移等特点,高效的虚拟机集群部署与动态迁移操作可以将分散的虚拟机组成整体、满足大规模应用需求,可提高云计算管理平台的运行维护与服务质量,是云计算管理平台的重要组成部分。The cloud computing management platform is a complex large-scale system, and the virtual machine is an important part of the cloud computing management platform. It has the characteristics of cross-system, resource isolation, and migration. Efficient virtual machine cluster deployment and dynamic migration operations can decentralize virtual It is an important part of the cloud computing management platform that the machine is integrated and meets the needs of large-scale applications. It can improve the operation, maintenance and service quality of the cloud computing management platform.
但由于云计算管理平台具有资源规模巨大、结构复杂、地域分布广的特点,而其应用则具有请求灵活多变、资源类型变化各异、负载动态变化等特点,这对虚拟机集群部署与动态迁移策略提出了巨大挑战。动态迁移的出现是因为负载均衡的需要,在云计算环境下,可能会出现一些计算机的负载过重,一直处于超负荷状态,而另外一些计算则经常处于空闲状态的情况,这就大大降低了系统的整体资源利用率。负载均衡就是把任务在多个物理资源间进行调节,以获得最优的资源整体利用。However, because the cloud computing management platform has the characteristics of huge resource scale, complex structure, and wide geographical distribution, and its application has the characteristics of flexible and variable requests, different resource types, and dynamic load changes, this is a virtual machine cluster deployment and dynamic The migration strategy presents a huge challenge. Dynamic migration occurs because of the need for load balancing. In the cloud computing environment, some computers may be overloaded and have been overloaded, while other calculations are often idle, which greatly reduces The overall resource utilization of the system. Load balancing is to adjust tasks among multiple physical resources to obtain the best overall resource utilization.
相关技术中的迁移触发策略是基于一个固定的阀值,当某个节点的某一类型的性能负载大于这个固定的阀值时,系统就会触发一次迁移;然而,由于存在各种类型的突发性负载,因此,一旦任一瞬间的突发性负载达到固定阈值便会触发虚拟机迁移,如此导致频繁的虚拟机迁移,造成不必要的迁移开销,同时导致系统可靠性无法得到保障。The migration triggering strategy in the related art is based on a fixed threshold. When a certain type of performance load of a node is greater than the fixed threshold, the system will trigger a migration; however, due to various types of sudden Therefore, once the sudden load at any instant reaches a fixed threshold, the virtual machine migration will be triggered, which leads to frequent virtual machine migration, unnecessary migration overhead, and system reliability cannot be guaranteed.
发明内容Summary of the invention
有鉴于此,本发明实施例期望提供一种虚拟机迁移方法、云计算管理平台和存储介质,解决了相关技术中瞬间的突发性负载达到固定阈值便会触发虚拟机迁移,如此导致频繁的虚拟机迁移,造成不必要的迁移开销的问题,避免了突发性负载对系统的干扰,提高了系统的可靠性。In view of this, the embodiments of the present invention are expected to provide a virtual machine migration method, cloud computing management platform, and storage medium, which solves that the sudden burst load in the related art will trigger the virtual machine migration when it reaches a fixed threshold, which leads to frequent Virtual machine migration causes unnecessary migration overhead, avoids the interference of the sudden load on the system, and improves the reliability of the system.
为达到上述目的,根据本发明实施例的一方面,提供了一种虚拟机迁移方 法,应用于云计算管理平台,所述方法包括:To achieve the above objective, according to an aspect of an embodiment of the present invention, a virtual machine migration method is provided, which is applied to a cloud computing management platform. The method includes:
若当前第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻所述第一物理机的第二负载;其中,所述第二时刻在所述第一时刻之后;If the first load of the first physical machine is greater than the first threshold at the current first moment, the second load of the first physical machine at the second moment is predicted; wherein, the second moment is after the first moment;
若所述第二负载大于第二阈值,从所述第一物理机上的虚拟机中选择待迁移虚拟机;其中,所述第二阈值大于所述第一阈值;If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine; wherein, the second threshold is greater than the first threshold;
确定第二物理机,并将所述待迁移虚拟机迁移至所述第二物理机;其中,所述第二物理机与所述第一物理机不同。Determine a second physical machine, and migrate the virtual machine to be migrated to the second physical machine; wherein the second physical machine is different from the first physical machine.
可选的,所述若当前的第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻所述第一物理机的第二负载,包括:Optionally, if the first load of the first physical machine at the current first moment is greater than the first threshold, predicting the second load of the first physical machine at the second moment includes:
若所述第一负载大于所述第一阈值,获取预设时间段内至少两个时刻的第三负载;其中,所述预设时间段包括所述第一时刻以及所述第一时刻之前的至少一个第三时刻,所述至少两个时刻中每一时刻的第三负载包括至少两个不同属性的负载;不同属性的负载表征第一物理机中被占用的资源的类型不同;If the first load is greater than the first threshold, obtain a third load at least two moments within a preset time period; wherein the preset time period includes the first time and the time before the first time At least one third moment, the third load at each moment in the at least two moments includes at least two loads with different attributes; the loads with different attributes represent different types of resources occupied in the first physical machine;
根据所述每一时刻的第三负载和所述每一时刻的第三负载的权重值计算所述每一时刻的第四负载;Calculating the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment;
根据所述每一时刻的第四负载计算所述第二负载。The second load is calculated based on the fourth load at each moment.
可选的,所述根据所述每一时刻的第四负载计算所述第二负载,包括:Optionally, the calculating the second load according to the fourth load at each moment includes:
计算多个时刻的第四负载的平均值,得到所述第二负载。The average value of the fourth load at multiple times is calculated to obtain the second load.
可选的,所述若所述第一负载大于所述第一阈值,获取所述第一时刻之前的多个时刻中的每一时刻的多个不同种类的负载数据之前,所述方法还包括:Optionally, if the first load is greater than the first threshold, before acquiring a plurality of different types of load data at each time among the multiple times before the first time, the method further includes :
接收用户请求,并获取所述用户请求的请求类型;其中,所述请求类型包括静态请求或动态请求;Receiving a user request, and obtaining the request type of the user request; wherein, the request type includes a static request or a dynamic request;
相应的,所述根据所述每一时刻的第三负载和所述每一时刻的第三负载的权重值计算所述每一时刻的第四负载之前,所述方法还包括:Correspondingly, before calculating the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment, the method further includes:
获取所述每一时刻的第三负载中每一负载的属性;Acquiring the attribute of each load in the third load at each moment;
根据所述请求类型和所述每一时刻的第三负载中每一负载的属性,确定所述每一时刻的第三负载中每一负载的权重值。According to the request type and the attribute of each load in the third load at each moment, the weight value of each load in the third load at each moment is determined.
可选的,所述每一时刻的第三负载还包括距离,其中,所述距离表征所述 第一物理机与接收到用户请求的数据中心之间的距离,所述云计算管理平台还包括所述数据中心,所述数据中心用于管理第三物理机,所述第三物理机包括所述第一物理机。Optionally, the third load at each moment further includes a distance, wherein the distance represents the distance between the first physical machine and the data center that receives the user request, and the cloud computing management platform further includes In the data center, the data center is used to manage a third physical machine, and the third physical machine includes the first physical machine.
可选的,所述根据所述每一时刻的第三负载和所述每一时刻的第三负载的权重值计算所述每一时刻的第四负载之前,所述方法还包括:Optionally, before calculating the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment, the method further includes:
获取所述每一时刻的第三负载中每一负载的属性;Acquiring the attribute of each load in the third load at each moment;
根据所述每一时刻的第三负载中每一负载的属性,确定所述每一时刻的第三负载中每一负载的权重值。According to the attribute of each load in the third load at each moment, the weight value of each load in the third load at each moment is determined.
可选的,所述第一物理机上的虚拟机的数量为多个,所述若所述第二负载大于第二阈值,从所述第一物理机上的虚拟机中选择待迁移虚拟机,包括:Optionally, the number of virtual machines on the first physical machine is multiple, and if the second load is greater than a second threshold, selecting the virtual machine to be migrated from the virtual machines on the first physical machine includes: :
若所述第二负载大于所述第二阈值,获取所述第一物理机的资源利用率;If the second load is greater than the second threshold, obtain the resource utilization rate of the first physical machine;
根据所述资源利用率从所述第一物理机上的多个虚拟机中选择待迁移虚拟机。The virtual machine to be migrated is selected from multiple virtual machines on the first physical machine according to the resource utilization rate.
可选的,所述根据所述资源利用率从所述第一物理机上的多个虚拟机中选择待迁移虚拟机,包括:Optionally, the selecting a virtual machine to be migrated from multiple virtual machines on the first physical machine according to the resource utilization rate includes:
若所述资源利用率大于或等于第三阈值,预测第三时刻所述第一物理机上的每一虚拟机的第五负载;其中,所述第三时刻在所述第一时刻之后;If the resource utilization rate is greater than or equal to a third threshold, predict a fifth load of each virtual machine on the first physical machine at the third moment; wherein the third moment is after the first moment;
从所述第一物理机上的虚拟机中选取第五负载中最大负载对应的虚拟机,并确定为所述待迁移虚拟机。Select the virtual machine corresponding to the maximum load among the fifth loads from the virtual machines on the first physical machine, and determine the virtual machine to be migrated.
可选的,所述根据所述资源利用率从所述第一物理机上的多个虚拟机中选择待迁移虚拟机,包括:Optionally, the selecting a virtual machine to be migrated from multiple virtual machines on the first physical machine according to the resource utilization rate includes:
若所述资源利用率小于或等于第四阈值,确定所述第一物理机上的每一虚拟机为所述待迁移虚拟机;其中,所述第四阈值小于第三阈值。If the resource utilization rate is less than or equal to a fourth threshold, it is determined that each virtual machine on the first physical machine is the virtual machine to be migrated; wherein, the fourth threshold is less than the third threshold.
可选的,所述确定第二物理机,包括:Optionally, the determining the second physical machine includes:
获取所述第一时刻所述云计算管理平台中的每个物理机的第六负载;Acquiring the sixth load of each physical machine in the cloud computing management platform at the first moment;
从所述云计算管理平台中的物理机中选取第六负载小于第五阈值的物理机,并确定为第三物理机;其中,所述第三物理机与所述第一物理机不同,所述第三物理机的数量为多个;The physical machine with the sixth load less than the fifth threshold is selected from the physical machines in the cloud computing management platform, and determined as the third physical machine; wherein the third physical machine is different from the first physical machine, so The number of the third physical machine is multiple;
预测第四时刻每个所述第三物理机上的虚拟机的第七负载;其中,所述第四时刻在所述第一时刻之后;Predicting the seventh load of the virtual machine on each third physical machine at the fourth moment; wherein, the fourth moment is after the first moment;
计算每个所述第三物理机的第七负载与所述待迁移虚拟机的负载的和,得到多个目标负载;Calculating the sum of the seventh load of each third physical machine and the load of the virtual machine to be migrated to obtain multiple target loads;
确定所述多个目标负载中小于第六阈值的目标负载;Determining a target load less than a sixth threshold among the plurality of target loads;
从所述第三物理机中选取所述小于第六阈值的目标负载对应的第三物理机,并确定为第四物理机;其中,所述第四物理机的数量为至少一个;Selecting the third physical machine corresponding to the target load less than the sixth threshold from the third physical machine and determining it as the fourth physical machine; wherein the number of the fourth physical machine is at least one;
从至少一个所述第四物理机中确定所述第二物理机。The second physical machine is determined from at least one fourth physical machine.
可选的,所述从至少一个所述第四物理机中确定所述第二物理机,包括:Optionally, the determining the second physical machine from at least one fourth physical machine includes:
计算每个所述第四物理机的第七负载减去每个所述第四物理机的第六负载的值,得到每个所述第四物理机的资源需求伸缩量;Calculating the value of the seventh load of each fourth physical machine minus the value of the sixth load of each fourth physical machine to obtain the resource demand expansion and contraction amount of each fourth physical machine;
计算每个所述第四物理机的资源总量减去每个所述第四物理机的第六负载的值,得到每个所述第四物理机的未分配资源量;Calculating the value of the total resources of each fourth physical machine minus the value of the sixth load of each fourth physical machine to obtain the amount of unallocated resources of each fourth physical machine;
计算每个所述第四物理机的未分配资源量减去每个所述第四物理机的资源需求伸缩量的值,得到每个所述第四物理机的预测剩余资源量;Calculating the value of the unallocated resources of each fourth physical machine minus the amount of resource demand expansion and contraction of each fourth physical machine to obtain the predicted remaining resource amount of each fourth physical machine;
根据每个所述第四物理机的预测剩余资源量,从所述第四物理机中确定所述第二物理机。The second physical machine is determined from the fourth physical machine according to the predicted remaining resource amount of each of the fourth physical machine.
可选的,所述根据所述第四物理机的预测剩余资源量从所述第四物理机中确定所述第二物理机,包括:Optionally, the determining the second physical machine from the fourth physical machine according to the predicted remaining resource amount of the fourth physical machine includes:
确定所述第四物理机的预测剩余资源量中的最大值对应的第四物理机为所述第二物理机。It is determined that the fourth physical machine corresponding to the maximum value in the predicted remaining resource amount of the fourth physical machine is the second physical machine.
可选的,在所述云计算管理平台的物理机上建立有虚拟机集群,所述待迁移虚拟机的数量为至少两个,所述待迁移虚拟机的数量和所述第二物理机的数量相同;所述将所述待迁移虚拟机迁移至所述第二物理机之前,所述方法还包括:Optionally, a virtual machine cluster is established on the physical machine of the cloud computing management platform, the number of the virtual machines to be migrated is at least two, the number of the virtual machines to be migrated and the number of the second physical machines The same; before migrating the virtual machine to be migrated to the second physical machine, the method further includes:
获取每个所述待迁移虚拟机的负载;Obtaining the load of each of the virtual machines to be migrated;
从多个第二物理机中确定每个所述待迁移虚拟机对应的目标物理机;其中,所述多个第二物理机包括所述目标物理机;Determining a target physical machine corresponding to each virtual machine to be migrated from a plurality of second physical machines; wherein the plurality of second physical machines include the target physical machine;
获取多个所述目标物理机的负载;Acquiring loads of multiple of the target physical machines;
根据每个所述待迁移虚拟机的负载和每个所述目标物理机的负载,对多个目标物理机进行排序,得到优先级队列。According to the load of each of the virtual machines to be migrated and the load of each of the target physical machines, sort the multiple target physical machines to obtain a priority queue.
可选的,所述根据每个所述待迁移虚拟机的负载和每个所述目标物理机的负载,对多个第二物理机进行排序,得到优先级队列,包括:Optionally, according to the load of each virtual machine to be migrated and the load of each target physical machine, sorting the plurality of second physical machines to obtain a priority queue includes:
计算每个所述待迁移虚拟机的负载以及与每个所述待迁移虚拟机对应的目标物理机的负载的和,得到传输负载;Calculating the sum of the load of each virtual machine to be migrated and the load of the target physical machine corresponding to each virtual machine to be migrated to obtain a transmission load;
根据所述传输负载对多个目标物理机进行排序,得到优先级队列。Sort multiple target physical machines according to the transmission load to obtain a priority queue.
可选的,所述将所述待迁移虚拟机迁移至所述第二物理机,包括:Optionally, the migrating the virtual machine to be migrated to the second physical machine includes:
根据所述优先级队列确定每一所述目标物理机的优先级;Determine the priority of each of the target physical machines according to the priority queue;
按照优先级由高到低的顺序,对每个所述目标物理机对应的待迁移虚拟机进行镜像传输;其中,所述优先级高的目标物理机对应的传输负载小于所述优先级低的目标物理机对应的传输负载。Mirroring the virtual machines to be migrated corresponding to each of the target physical machines in order of high priority to low priority; wherein the transmission load corresponding to the target physical machine with high priority is less than that with low priority The transmission load corresponding to the target physical machine.
根据本发明实施例的另一方面,还提供了一种云计算管理平台,所述云计算管理平台包括:According to another aspect of the embodiments of the present invention, a cloud computing management platform is also provided. The cloud computing management platform includes:
存储器,用于存储可执行指令;Memory, used to store executable instructions;
处理器,用于执行所述存储器中存储的可执行指令,实现如上述的虚拟机迁移方法中的步骤。The processor is configured to execute the executable instructions stored in the memory to implement the steps in the above virtual machine migration method.
根据本发明实施例的另一方面,还提供了一种存储介质,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如上述的虚拟机迁移方法的步骤。According to another aspect of the embodiments of the present invention, a storage medium is also provided, where the storage medium stores one or more programs, and the one or more programs may be executed by one or more processors to implement, for example, The steps of the above virtual machine migration method.
本发明实施例所提供的虚拟机迁移方法、云计算管理平台和存储介质,若当前第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻第一物理机的第二负载;其中,第二时刻在第一时刻之后;若第二负载大于第二阈值,从第一物理机上的虚拟机中选择待迁移虚拟机;其中,第二阈值大于第一阈值;确定第二物理机,并将待迁移虚拟机迁移至第二物理机;其中,第二物理机与第一物理机不同;也就是说,本发明实施例中,在确定第一时刻第一物理机的突发性负载大于第一阈值时,对该第一物理机未来时刻的负载进行预测,并在确定未来时刻的负载比大于第一阈值的第二阈值还要高时,则触发一次迁移, 如此,有效地避免了突发性负载对系统的干扰,解决了相关技术中瞬间的突发性负载达到固定阈值便会触发虚拟机迁移,如此导致频繁的虚拟机迁移,造成不必要的迁移开销的问题,避免了突发性负载对系统的干扰,提高了系统的可靠性。In the virtual machine migration method, cloud computing management platform, and storage medium provided in the embodiments of the present invention, if the first load of the first physical machine at the first moment is greater than the first threshold, the second load of the first physical machine at the second moment is predicted ; Where the second moment is after the first moment; if the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine; wherein, the second threshold is greater than the first threshold; determine the second physical Machine, and migrate the virtual machine to be migrated to the second physical machine; where the second physical machine is different from the first physical machine; that is to say, in the embodiment of the present invention, the burst of the first physical machine is determined at the first moment When the sexual load is greater than the first threshold, the load of the first physical machine at the future moment is predicted, and when it is determined that the load at the future moment is higher than the second threshold greater than the first threshold, a migration is triggered, which is effective This avoids the interference of the sudden load on the system, and solves the problem that the instantaneous sudden load in the related technology will trigger the migration of the virtual machine when it reaches a fixed threshold. This leads to the problem of frequent virtual machine migration and unnecessary migration overhead. The interference of the sudden load on the system is avoided, and the reliability of the system is improved.
附图说明BRIEF DESCRIPTION
图1为本发明实施例提供的一种云计算平台管理系统的功能架构示意图;1 is a schematic diagram of a functional architecture of a cloud computing platform management system provided by an embodiment of the present invention;
图2为本发明实施例提供的一种云计算平台管理系统的实现架构示意图;2 is a schematic diagram of an implementation architecture of a cloud computing platform management system provided by an embodiment of the present invention;
图3为本发明实施例提供的一种代理实现架构示意图;3 is a schematic diagram of an agent implementation architecture provided by an embodiment of the present invention;
图4为本发明实施例提供的一种虚拟机迁移模型示意图;4 is a schematic diagram of a virtual machine migration model provided by an embodiment of the present invention;
图5为本发明实施例提供的一种虚拟机迁移方法的流程示意图;5 is a schematic flowchart of a virtual machine migration method according to an embodiment of the present invention;
图6为本发明实施例提供的另一种虚拟机迁移方法的流程示意图;6 is a schematic flowchart of another virtual machine migration method according to an embodiment of the present invention;
图7为本发明实施例提供的又一种虚拟机迁移方法的流程示意图;7 is a schematic flowchart of another virtual machine migration method according to an embodiment of the present invention;
图8为本发明实施例提供的一种基于资源分类的虚拟机集群部署架构示意图;8 is a schematic diagram of a virtual machine cluster deployment architecture based on resource classification provided by an embodiment of the present invention;
图9为本发明另一实施例提供的一种虚拟机迁移方法的流程示意图;9 is a schematic flowchart of a virtual machine migration method according to another embodiment of the present invention;
图10为本发明另一实施例提供的另一种虚拟机迁移方法的流程示意图;10 is a schematic flowchart of another virtual machine migration method according to another embodiment of the present invention;
图11为本发明实施例提供的一种云计算平台管理系统的结构示意图。11 is a schematic structural diagram of a cloud computing platform management system according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be described clearly and completely in conjunction with the drawings in the embodiments of the present invention.
应理解,说明书通篇中提到的“本发明实施例”或“前述实施例”意味着与实施例有关的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在整个说明书各处出现的“本发明实施例中”或“在前述实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中应。在本发明的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。It should be understood that the “embodiments of the present invention” or “previous embodiments” mentioned throughout the specification mean that specific features, structures, or characteristics related to the embodiments are included in at least one embodiment of the present invention. Therefore, “in the embodiments of the present invention” or “in the foregoing embodiments” appearing throughout the specification does not necessarily refer to the same embodiments. In addition, these specific features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In various embodiments of the present invention, the size of the sequence numbers of the above processes does not mean that the execution order is sequential, and the execution order of each process should be determined by its function and inherent logic, and should not correspond to the implementation process of the embodiments of the present invention Constitute any limitation. The sequence numbers of the above embodiments of the present invention are for description only, and do not represent the advantages and disadvantages of the embodiments.
对本发明实施例进行进一步详细说明之前,对相关技术中虚拟机迁移技术进行说明。Before describing the embodiments of the present invention in further detail, the virtual machine migration technology in the related art will be described.
云计算管理平台是一个复杂的大型系统,虚拟机是云计算管理平台的重要部分,它具有跨系统、资源隔离、可迁移等特点,高效的虚拟机集群部署与动态迁移操作可以将分散的虚拟机组成整体、满足大规模应用需求,可提高云计算管理平台的运行维护与服务质量,是云计算管理平台的重要组成部分。The cloud computing management platform is a complex large-scale system, and the virtual machine is an important part of the cloud computing management platform. It has the characteristics of cross-system, resource isolation, and migration. Efficient virtual machine cluster deployment and dynamic migration operations can decentralize virtual It is an important part of the cloud computing management platform that the machine is integrated and meets the needs of large-scale applications. It can improve the operation, maintenance and service quality of the cloud computing management platform.
但由于云计算管理平台具有资源规模巨大、结构复杂、地域分布广的特点,而其应用则具有请求灵活多变、资源类型变化各异、负载动态变化等特点,对虚拟机集群部署与动态迁移策略提出了巨大挑战。动态迁移的出现是因为负载的均衡的需要,在云计算环境下,可能会出现一些计算机的负载过重,一直处于超负荷状态,而另外一些计算则经常处于空闲状态的情况,这就大大降低了系统的整体资源利用率。负载均衡就是把任务在多个物理资源间进行调节,以获得最优的资源整体利用。However, because the cloud computing management platform has the characteristics of huge resources, complex structure, and wide geographical distribution, and its application has the characteristics of flexible requests, different resource types, and dynamic changes in load, etc., it deploys and dynamically migrates virtual machine clusters. The strategy presents a huge challenge. Dynamic migration occurs because of the need for load balancing. In the cloud computing environment, some computers may be overloaded and have been overloaded, while other calculations are often idle, which greatly reduces The overall resource utilization rate of the system. Load balancing is to adjust tasks among multiple physical resources to obtain the best overall resource utilization.
根据云计算管理平台资源的特点,通过分析可以知道动态迁移的主要难点在于以下几下三个方面:突发性负载的应对、系统虚拟机数目巨大、系统可靠性的保障等。According to the characteristics of cloud computing management platform resources, through analysis, we can know that the main difficulties of dynamic migration are the following three aspects: the response to sudden loads, the huge number of system virtual machines, and the guarantee of system reliability.
本发明实施例中,对上述三个方面进行简单介绍:In the embodiments of the present invention, the above three aspects are briefly introduced:
第一方面、突发性负载的应对First, the response to sudden loads
随着云计算管理平台的广泛使用,某一时刻用户规模可能变得非常大,这便是突发性负载之一。以2017年11月11日当天,某一网站的访问量为例,短时间内用户针对该网站的访问量可达到千万级,远远高于平均值。这种突发性负载行为对系统性能分析及虚拟机的动态迁移带来重大挑战。With the widespread use of cloud computing management platforms, the size of users may become very large at a certain moment, which is one of the sudden loads. Taking November 11, 2017 as an example, the number of visits to a website can be reached within a short period of time, which is much higher than the average. This sudden load behavior poses a major challenge to system performance analysis and dynamic migration of virtual machines.
第二方面、系统虚拟机数目巨大Second, the number of system virtual machines is huge
云计算管理平台有成千上个服务器,而每个物理机可能有数十个虚拟机,这些虚拟机的资源类型变化各异,且时时刻刻都在产生着性能数据。面对如此大规模的服务器和数据,要想直接使用传统方法对云计算管理平台进行性能分析是很难的。The cloud computing management platform has thousands of servers, and each physical machine may have dozens of virtual machines. The resource types of these virtual machines vary, and performance data is being generated all the time. Faced with such large-scale servers and data, it is difficult to directly analyze the performance of the cloud computing management platform using traditional methods.
第三方面、系统可靠性的保障The third aspect, the guarantee of system reliability
系统的可靠性保证一方面要求动态迁移不能使得系统开销太大干扰了系统 的正常运行,另一方面,动态迁移不能对部署在虚拟机中的应用程序造成干扰。这就要求动态迁移要选择出真正需要迁移的虚拟机,以及未来一段时间负载都不会过度增加的物理节点,才能确保虚拟机迁移不会干扰己经存在的虚拟机及应用。The reliability of the system requires that on the one hand, dynamic migration cannot make the system overhead too large to interfere with the normal operation of the system; on the other hand, dynamic migration cannot interfere with applications deployed in virtual machines. This requires dynamic migration to select virtual machines that really need to be migrated, and physical nodes that will not increase the load excessively for a period of time in the future, so as to ensure that virtual machine migration will not interfere with existing virtual machines and applications.
需要说明的是,除了以上三个方面,还要注意虚拟机迁移后震荡的预防。由于多个节点基于当前的负载信息可能会选择同一个物理节点机作为目标节点,导致被选中的目标节点负载急剧增加,超过了管理员设置的阀值后会引发二次甚至三次迁移,即产生迁移震荡。It should be noted that, in addition to the above three aspects, we should also pay attention to the prevention of shock after the virtual machine migration. Because multiple nodes may select the same physical node machine as the target node based on the current load information, the load of the selected target node increases sharply. After exceeding the threshold set by the administrator, it will cause two or even three migrations. Migration shocks.
相关技术中,有些系统采用操作系统虚拟化技术,例如采用不宕机迁移技术,在用户无察觉的情况下将虚拟机迁移到另一台负载较轻的服务器中,它为系统的定期管理维护及出错恢复提供了全新的体验。虽然该系统迁移时消耗的性能较少,但是该系统无法有效应用突发性负载。In related technologies, some systems use operating system virtualization technology, such as non-downtime migration technology, which migrates the virtual machine to another lightly loaded server without the user's awareness. It provides regular management and maintenance of the system. And error recovery provides a brand new experience. Although the system consumes less performance when migrating, the system cannot effectively apply sudden loads.
相关技术中,有些系统在迁移时不需要修改操作系统和内核系统,使服务能够不问断的运行;但是在迁移过程中迁移实体为操作系统镜像及应用,迁移效率低,且没有解决迁移震荡的问题。In the related art, some systems do not need to modify the operating system and kernel system during migration, so that the service can run without interruption; but during the migration process, the migration entity is the operating system image and application, the migration efficiency is low, and the migration shock is not resolved The problem.
相关技术中,还有基于英特尔处理器的当前服务器与未来技术之间的无缝迁移技术,该技术具有良好的向后兼容性,但是迁移系统没有充分考虑迁移前后的性能关系,可能迁移震荡,增加系统开销。In related technologies, there is a seamless migration technology between current servers based on Intel processors and future technologies. This technology has good backward compatibility, but the migration system does not fully consider the performance relationship before and after migration, and migration may be shocked. Increase system overhead.
由上述相关技术中采用的虚拟机迁移技术可知,目前存在的虚拟机动态迁移仍然存在缺陷,具体如:It can be known from the virtual machine migration technology adopted in the above-mentioned related technologies that the current dynamic migration of virtual machines still has defects, such as:
(1)绝大部分负载均衡方法的迁移策略仅基于某一固定阈值,即节点机的负载超过了负载阈值的上界,则该节点机触发一个迁移,这样,瞬间的突发负载峰值就会触发虚拟机迁移,容易造成不必要的迁移开销。(1) The migration strategy of most load balancing methods is only based on a fixed threshold, that is, the load of the node machine exceeds the upper limit of the load threshold, then the node machine triggers a migration, so that the peak burst load will be instantaneous Triggering the migration of virtual machines can easily cause unnecessary migration overhead.
(2)当前的负载预测方法要么针对虚拟机负载进行预测,要么针对应用负载进行预测,还有部分针对物理主机负载预测的方法,负载的指标范围狭窄,在预测手段上有使用奇异值算法、增量加权等,但预测目的是筛选出符合条件物理机,将其上所有虚拟机迁移,迁移过程中可能会选择同一个物理节点机作为目标节点,导致被选中的目标节点负载急剧增加,造成迁移震荡。(2) The current load prediction method either predicts the load of the virtual machine or the load of the application, and some methods of load prediction of the physical host. The load index range is narrow, and the singular value algorithm is used in the prediction method. Incremental weighting, etc., but the purpose of the prediction is to select physical machines that meet the conditions and migrate all virtual machines on it. During the migration process, the same physical node machine may be selected as the target node, resulting in a sharp increase in the load of the selected target node, resulting in Migration shocks.
(3)当前虚拟机迁移涉及集群部署的方法要么按照中央处理器(Central Processing Unit,CPU)占用率或内存占用率分别对虚拟机和物理机进行排序, 然后一一匹配,要么使用虚拟机的CPU占用率和内存占用率的比值,将该比值进行排序,排序结果在和物理机的排序结果匹配,参照的指标狭窄且对于虚拟机迁移效率的提升不显著。(3) The current method of virtual machine migration involves cluster deployment. The virtual machine and the physical machine are sorted according to the central processing unit (CPU) occupancy rate or memory occupancy rate, and then one by one is matched, or the virtual machine is used. The ratio between the CPU usage and the memory usage is sorted. The sorting result matches the sorting result of the physical machine. The reference index is narrow and the improvement of the migration efficiency of the virtual machine is not significant.
(4)当前虚拟机迁移涉及的镜像传递方法都是基于虚拟机镜像的缓存的顺序拷贝到目标物理主机,在待迁移的虚拟机集群规模比较大时,存在效率低的缺陷。(4) The current image transfer method involved in virtual machine migration is based on the sequential copying of the cache of the virtual machine image to the target physical host. When the size of the virtual machine cluster to be migrated is relatively large, there is a defect of low efficiency.
(5)当前虚拟机迁移对于距离因素的考虑,仅仅只考虑单数据中心的场景,迁移到距离最近的物理主机,而没有考虑多数据中心的场景,即没有防止虚拟机跨数据中心迁移的手段。(5) For the consideration of distance factors in the current virtual machine migration, only the single data center scenario is considered, and the closest physical host is considered, and the multiple data center scenario is not considered, that is, there is no means to prevent the migration of virtual machines across data centers. .
根据前述实施例,本发明实施例提供一种虚拟机迁移方法,应用于云计算管理平台,云计算管理平台又可称为云计算管理平台系统,下文也可以简称系统;该系统采用多级分布式架构,整个系统有多个数据中心,每个数据中心有多台物理机及一个数据中心服务器,数据中心通过网络连接到系统服务器。According to the foregoing embodiments, the embodiments of the present invention provide a virtual machine migration method, which is applied to a cloud computing management platform. The cloud computing management platform may also be referred to as a cloud computing management platform system, which may also be referred to as a system hereinafter; the system uses a multi-level distribution The architecture has multiple data centers, and each data center has multiple physical machines and a data center server. The data center is connected to the system server through the network.
客户端访问到的是系统服务器,由一个系统服务器管理所有的数据中心,每个数据中心配备一个数据中心服务器,由数据中心服务器,管理本数据中心的所有物理机,在每个物理机上装有代理,负责处理数据中心服务器发来的命令及回应操作结果。这种分布式多层管理结构可方便的实现系统的扩展,且有利于减轻服务器的压力。The client accesses the system server. A system server manages all the data centers. Each data center is equipped with a data center server. The data center server manages all physical machines in the data center and is installed on each physical machine. The agent is responsible for processing the commands sent by the data center server and responding to the operation results. This distributed multi-layer management structure can easily realize the expansion of the system, and is beneficial to reduce the pressure on the server.
下面说明实现本发明实施例的云计算管理平台系统的示例性的功能架构,参见图1,云计算管理平台系统10包括镜像文件管理模块110、集群管理模块120、性能监控模块130以及资源管理模块140,下面分别进行说明。The following describes an exemplary functional architecture of a cloud computing management platform system that implements an embodiment of the present invention. Referring to FIG. 1, the cloud computing management platform system 10 includes an image file management module 110, a cluster management module 120, a performance monitoring module 130, and a resource management module 140, described separately below.
镜像文件管理模块(Image Manager)110,可以上传和下载镜像,以及对镜像的资源类型进行分类,及副本管理,镜像的资源类型初始由用户指定,后期可由系统修正。The image file management module (Image Manager) 110 can upload and download images, classify image resource types, and copy management. The image resource type is initially specified by the user, and can be revised later by the system.
虚拟机集群管理模块(Cluster Manager)120,可以实现集群的编辑,集群的部署以及集群的删除。The virtual machine cluster management module (Cluster Manager) 120 can implement cluster editing, cluster deployment and cluster deletion.
性能监控模块(Performance Monitor)130,可以实现物理机性能监控,虚拟机性能监控以及系统负载性能的预测。Performance monitoring module (PerformanceMonitor) 130 can realize physical machine performance monitoring, virtual machine performance monitoring and system load performance prediction.
资源管理模块(Resource Manager)140,可以实现物理资源添加、物理资 源删除、物理资源编辑以及镜像库管理。Resource management module (Resource Manager) 140 can realize physical resource addition, physical resource deletion, physical resource editing and image library management.
云计算管理平台系统实现架构参见图2所示,包括表现层210、逻辑层220以及数据持久层230,下面分别进行说明。The implementation architecture of the cloud computing management platform system is shown in FIG. 2 and includes a presentation layer 210, a logic layer 220, and a data persistence layer 230, which are described below.
表现层210,是用户与系统交互的显示界面,通过表格、图形、文字等内容来展示系统性能、操作结果、集群运行情况。The presentation layer 210 is a display interface for user interaction with the system, and displays system performance, operation results, and cluster operation status through tables, graphics, and text.
逻辑层220,是集群管理策略的核心层,负责响应表现层发来的操作命令,并且提供访问接口以展示系统运行状况,它提供5个子模块,分别是资源管理(Resource Manager)模块、性能管理(Performance Manager)模块、虚拟化引擎(Virtualization Engine)模块、代理管理(Agent Manager)模块、前端交互接口API Interface模块。The logic layer 220 is the core layer of the cluster management strategy. It is responsible for responding to the operation commands sent by the presentation layer, and provides access interfaces to display the system operation status. It provides five sub-modules, which are the Resource Manager module and performance management. (Performance Manager) module, virtualization engine (Virtualization Engine) module, agent management (Agent Manager) module, front-end interactive interface API Interface module.
Agent Manager模块主要部署在系统的每个物理机、虚拟机上,在物理机上的代理(Agent)主要用来响应数据中心服务器发来的操作命令,诸如虚拟机创建、启动、停止、销毁、迁移等,它要搜集性能数据以及向系统提交。在虚拟机中的Agent主要用来向系统发送虚拟机的当前性能状况,所搜集的性能数据主要包括一段时间内的CPU利用率、网络带宽利用率、内存利用率及文件系统状况,另外传递镜像、集群部署文件、集群的启动等操作,都需要装在每个物理机上Agent参与,Agent还要负责将机器的性能状态信息发送给服务器,Agent的实现架构如附图3所示,包括镜像文件处理模块310、虚拟化事件处理模块320以及性能监控模块330,下面分别进行说明。The Agent Manager module is mainly deployed on each physical machine and virtual machine of the system. The agent on the physical machine is mainly used to respond to the operation commands sent by the data center server, such as virtual machine creation, start, stop, destruction, migration Wait, it has to collect performance data and submit to the system. The Agent in the virtual machine is mainly used to send the current performance status of the virtual machine to the system. The collected performance data mainly includes CPU utilization, network bandwidth utilization, memory utilization, and file system status over a period of time. , Cluster deployment files, cluster startup and other operations, need to install Agent on each physical machine to participate, Agent is also responsible for sending machine performance status information to the server, the implementation architecture of Agent is shown in Figure 3, including image files The processing module 310, the virtualization event processing module 320, and the performance monitoring module 330 will be described separately below.
镜像文件处理模块310,可以实现镜像文件image接收和镜像文件的传输。The image file processing module 310 can realize the reception of the image file image and the transmission of the image file.
虚拟化事件处理模块320,可以实现虚拟机启动、虚拟机创建、虚拟机停止以及虚拟机部署。The virtualization event processing module 320 can implement virtual machine startup, virtual machine creation, virtual machine stop, and virtual machine deployment.
性能监控模块330,可以实现对数据库程序、文件传输程序以及可扩展标记语言XML程序进行性能监控。The performance monitoring module 330 can implement performance monitoring on database programs, file transfer programs, and Extensible Markup Language XML programs.
Performance Manager模块负责对Agent Manager搜集来的数据进行分析,确定整个及每个物理的当前运行状况。Performance Manager模块可以预测下一时间系统可能出现的性能情况,当负载过重时,可以向系统发出负载过重警告,提醒管理人员增加物理资源或者通过负载均衡手段调节负载。这个模块为虚拟机的部署、迁移,用户查看当前系统运行状况提供了决策支持。The Performance Manager module is responsible for analyzing the data collected by the Agent Manager to determine the current operating status of the entire and each physical. The Performance Manager module can predict the performance of the system that may occur in the next time. When the load is too heavy, it can issue an overload warning to the system to remind managers to increase physical resources or adjust the load through load balancing. This module provides decision support for the deployment and migration of virtual machines and users viewing the current system operating status.
Virtualization Engine模块为系统的核心模块,可以接受用户的请求实现一系列的虚拟化操作,包括虚拟机的创建、虚拟机的启动、虚拟机的停止、虚拟机的销毁等事件,在接收到上层发来的集群部署请求后,对集群部署请求进行XML解析后,如果判定该集群能够部署,就进行集群部署流程,比如传递镜像、配置集群部署文件、启动集群等,同时将操作后的虚拟化事件以命令的形式发送给Agent Manager模块具体操作,它还要接受Performance Manager模块的信息,当有机器负载过重时将部分虚拟机迁移到负载较轻的机器上。The Virtualization Engine module is the core module of the system. It can accept user requests to implement a series of virtualization operations, including the creation of virtual machines, the start of virtual machines, the stop of virtual machines, the destruction of virtual machines and other events. After the cluster deployment request is received, after XML parsing of the cluster deployment request, if it is determined that the cluster can be deployed, the cluster deployment process is performed, such as passing the image, configuring the cluster deployment file, starting the cluster, etc. It is sent to the Agent Manager module in the form of commands for specific operations. It also accepts the information from the Performance Manager module. When a machine is overloaded, it migrates some virtual machines to a lighter-loaded machine.
Resource Manager模块主要负责管理物理资源,以及监控当前的物理资源使用情况,这些物理资源主要包括机器CPU、内存、文件系统、网络。该模块也要管理每个镜像库的资源。The Resource Manager module is mainly responsible for managing physical resources and monitoring the current physical resource usage. These physical resources mainly include machine CPU, memory, file system, and network. This module also manages the resources of each mirror library.
数据持久层230提供多种用来数据持久化的方法,数据库程序(Database Provider)提供对数据库访问的支持,文件服务程序(File-Server Provider)对大型数据以文件形式进行持久化,如镜像文件,XML程序(XML Provider)主要用来对XML文件读写的支持。The data persistence layer 230 provides various methods for data persistence, the database program (Database) Provider provides support for database access, and the file service program (File-Server Provider) persists large data in the form of files, such as mirror files , XML program (XML Provider) is mainly used to support the reading and writing of XML files.
本发明实施例中,云计算管理平台系统10还包括虚拟机动态迁移控制器(图1中未示出)。In the embodiment of the present invention, the cloud computing management platform system 10 further includes a virtual machine dynamic migration controller (not shown in FIG. 1).
虚拟机动态迁移器由工作负载预测模块及迁移控制模块两个大的模块组成,参见图4所示,而迁移控制模块可以包括迁移触发模块、待迁移虚拟机选择模块、目标物理机选择模块三个部分;其中,迁移触发模块,设置为确定迁移时机,即确定什么时候应该迁移一个虚拟机,以确保整个物理机上的性能始终维持较佳状态;待迁移虚拟机选择模块,设置为确定哪些虚拟机应该被迁移;目标物理机选择模块,设置为确定待迁移的虚拟机应该被迁移到哪个目标物理机上。The virtual machine dynamic migrator is composed of two large modules, a workload prediction module and a migration control module, as shown in FIG. 4, and the migration control module may include a migration trigger module, a virtual machine selection module to be migrated, and a target physical machine selection module. Part; Among them, the migration trigger module is set to determine the timing of migration, that is, determine when a virtual machine should be migrated, to ensure that the performance of the entire physical machine always maintains a good state; the virtual machine selection module to be migrated is set to determine which virtual The machine should be migrated; the target physical machine selection module is set to determine to which target physical machine the virtual machine to be migrated should be migrated.
基于前述实施例,本发明实施例提供一种虚拟机迁移方法,应用于云计算管理平台;如图5所示,该方法包括以下步骤:Based on the foregoing embodiments, embodiments of the present invention provide a virtual machine migration method, which is applied to a cloud computing management platform; as shown in FIG. 5, the method includes the following steps:
步骤101、若当前第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻第一物理机的第二负载。Step 101: If the first load of the first physical machine at the first moment is greater than the first threshold, predict the second load of the first physical machine at the second moment.
其中,第二时刻在第一时刻之后。Among them, the second moment is after the first moment.
本发明实施例中,云计算管理平台确定当前第一时刻第一物理机的第一负载大于第一阈值,并未直接触发第一物理机上的虚拟机的迁移,而是预测第二 时刻即未来时刻该第一物理机的第二负载,以使得借助第二负载进一步确定是否触发虚拟机迁移。In the embodiment of the present invention, the cloud computing management platform determines that the first load of the first physical machine at the first moment is greater than the first threshold, and does not directly trigger the migration of the virtual machine on the first physical machine, but predicts the future at the second moment The second load of the first physical machine at the moment, so that the second load is used to further determine whether to trigger the migration of the virtual machine.
本发明实施例中,由于虚拟机中的应用多样化,虚拟机事件、资源的使用、负载的均衡度也存在巨大的差异性,不同的迁移策略会对迁移的代价产生巨大的差别。为了支撑决策系统选择正确的需要迁移的虚拟机及迁移目的地,有必要对工作负载这一关键的指标进行预测。In the embodiments of the present invention, due to the diversification of applications in virtual machines, there are also huge differences in the balance of virtual machine events, resource usage, and load, and different migration strategies will have huge differences in migration costs. In order to support the decision-making system to select the correct virtual machine and migration destination to be migrated, it is necessary to predict the key indicator of workload.
本发明实施例中,系统可以实时采集物理机的负载数据,也可以周期性地采集物理机的负载数据,为预测物理机的负载数据奠定基础。示例性的,实际应用中,可以以5分钟为一个采样周期,在24小时内共采集288个样本点。In the embodiment of the present invention, the system can collect the load data of the physical machine in real time or periodically collect the load data of the physical machine, which lays a foundation for predicting the load data of the physical machine. Exemplarily, in practical applications, a total of 288 sample points can be collected within 24 hours with a sampling period of 5 minutes.
本发明实施例中,实时采集物理机的负载数据之后,保存该负载数据,进而,可以将物理机上各种业务的CPU利用率数据作为物理机的虚拟机所执行云任务的CPU参数的动态需求量。In the embodiment of the present invention, after the load data of the physical machine is collected in real time, the load data is saved, and further, the CPU utilization data of various services on the physical machine can be used as the dynamic requirements of the CPU parameters of the cloud task executed by the virtual machine of the physical machine the amount.
本发明实施例中,可以根据第一时刻T1的负载数据以及T1之前指定时间段内的多个时刻的负载数据,计算第二时刻T2的负载。In the embodiment of the present invention, the load at the second time T2 may be calculated based on the load data at the first time T1 and the load data at multiple times within a specified time period before T1.
本发明另一实施例中,还可以在确定T1时刻第一物理机发生突发性负载时,利用T1之前指定时间段内的多个时刻的负载数据,计算第二时刻T2的负载。In another embodiment of the present invention, when it is determined that a sudden load occurs on the first physical machine at time T1, the load data at multiple times within a specified time period before T1 may be used to calculate the load at the second time T2.
参见图6所示,系统中的迁移控制器通过迁移触发模块、待迁移虚拟机选择模块以及目标物理机选择模块三个部分之间的协作,在迁移控制器中的控制模块的引导下完成迁移的决策、待迁移虚拟机的选择、将待迁移虚拟机迁移到目标物理机。本发明实施例中,虚拟机动态迁移控制器采用性能预测算法实现迁移时机的确定以及迁移目标物理机的选择。As shown in FIG. 6, the migration controller in the system completes the migration under the guidance of the control module in the migration controller through the cooperation between the migration trigger module, the virtual machine selection module to be migrated, and the target physical machine selection module. Decision, selection of virtual machines to be migrated, migration of virtual machines to be migrated to target physical machines. In the embodiment of the present invention, the virtual machine dynamic migration controller adopts a performance prediction algorithm to determine the migration timing and select the migration target physical machine.
步骤102、若第二负载大于第二阈值,从第一物理机上的虚拟机中选择待迁移虚拟机。Step 102: If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine.
其中,第二阈值大于第一阈值。Among them, the second threshold is greater than the first threshold.
本发明实施例中,云计算管理平台确定第二负载大于第二阈值,即确定未来时刻的负载比大于第一阈值的第二阈值还要高时,才触发一次迁移;而且,一旦确定虚拟机迁移被触发,则要从第一物理机上选择部分或全部虚拟机进行迁移。In the embodiment of the present invention, the cloud computing management platform determines that the second load is greater than the second threshold, that is, when it is determined that the load in the future is higher than the second threshold greater than the first threshold, a migration is triggered; and, once the virtual machine is determined When the migration is triggered, select some or all virtual machines from the first physical machine for migration.
由上述可知,本发明实施例中云计算管理平台通过迁移触发模块,系统能够判断一个物理机节点的性能负载状况,确定触发迁移的时间。相关技术中的迁移触发策略是基于一个固定的阀值,当某个物理机节点的某些类型的性能负载超过这个指定的阀值时,系统就会触发一次迁移。然而本发明实施例中考虑到由于存在各种类型的突发性负载,这种指定阀值的做法必然导致频繁的虚拟机迁移;因此,本发明实施例中在确定第一时刻第一物理机的第一负载大于第一阈值时,并未直接进行虚拟机迁移,而是综合考虑了过去一段时间及当前时间的负载,进而对未来负载进行预测,只有在未来负载符合预设条件时,才触发虚拟机迁移,如此,可以有效的防止突发性负载对系统的干扰,减少系统因不必要的迁移而带来的性能损失。As can be seen from the above, in the cloud computing management platform of the embodiment of the present invention, through the migration trigger module, the system can determine the performance load status of a physical machine node and determine the time to trigger the migration. The migration triggering strategy in the related art is based on a fixed threshold, and when certain types of performance load of a physical machine node exceeds this specified threshold, the system will trigger a migration. However, in the embodiment of the present invention, it is considered that due to the presence of various types of sudden loads, this method of specifying the threshold will inevitably lead to frequent virtual machine migration; therefore, in the embodiment of the present invention, the first physical machine is determined at the first moment When the first load is greater than the first threshold, the virtual machine migration is not directly carried out, but the load of the past period and the current time is comprehensively considered, and then the future load is predicted, only when the future load meets the preset conditions. Trigger the migration of virtual machines. In this way, you can effectively prevent the interference of the sudden load on the system and reduce the performance loss of the system due to unnecessary migration.
在实际应用中,结合预测结果及当前的负载信息,系统会判断是否触发一次虚拟机迁移。在实际应用中,首先,分析出某物理机器的当前负载是否超过了阀值k1,如果超过,则执行下一步;其次,为了验证当前的负载信息是否属于突发性负载,可以基于物理机器的负载数据进行预测未来时刻的负载;然后,得到未来时刻的负载之后,如果未来时刻的负载比阀值k1更大,则系统会触发一次迁移。反之,系统不会触发迁移,如此,可以有效的避免突发性负载对系统的干扰。In practical applications, combining the prediction results and current load information, the system will determine whether to trigger a virtual machine migration. In practical applications, first, it is analyzed whether the current load of a physical machine exceeds the threshold k1, and if it is exceeded, the next step is performed; second, in order to verify whether the current load information is a sudden load, it can be based on the physical machine's The load data is used to predict the load at the future time; then, after obtaining the load at the future time, if the load at the future time is greater than the threshold k1, the system will trigger a migration. On the contrary, the system will not trigger the migration, so it can effectively avoid the interference of the sudden load on the system.
需要说明的是,采用本发明实施例中的虚拟机迁移时机的确定方法,只要一个虚拟机迁移命令被触发,则必须选择这个物理机器上的某些虚拟机进行迁移,这些需要被迁移的虚拟机称之为候选虚拟机即待迁移虚拟机,待迁移虚拟机的选择必需满足一系列的要求,如:迁移是短暂的,不会导致系统出现迁移震荡。It should be noted that, according to the method for determining the timing of virtual machine migration in the embodiment of the present invention, as long as a virtual machine migration command is triggered, certain virtual machines on this physical machine must be selected for migration. These virtual machines that need to be migrated The machine is called a candidate virtual machine, that is, a virtual machine to be migrated. The selection of the virtual machine to be migrated must meet a series of requirements. For example, the migration is short-lived and does not cause system migration shocks.
本发明实施例中,系统通过待迁移虚拟机选择模块选择待迁移虚拟机时可以通过如下两个步骤实现:In the embodiment of the present invention, when the system selects the virtual machine to be migrated through the virtual machine to be migrated selection module, the system can be implemented through the following two steps:
步骤B1:根据预测的结果,分析出当前有最大利用率的资源类型。Step B1: According to the predicted result, the resource type with the highest utilization rate is analyzed.
步骤B2:选择出一个对有步骤B1分析出的资源类型有最大利用率的虚拟机,这个虚拟机就是待迁移虚拟机。Step B2: Select a virtual machine with the highest utilization rate for the resource type analyzed in step B1. This virtual machine is the virtual machine to be migrated.
本发明的另一实施例中,当物理机发生过载情况时即物理机的CPU利用率超过第一参数,以及当物理机发生低载情况时即物理机的CPU利用率低于第二参数,需要根据当前状态将该主机上的部分或全部虚拟机迁移到其它主机上运 行;其中,第一参数大于第二参数,例如第一参数为80%,第二参数为20%。In another embodiment of the present invention, when the physical machine is overloaded, that is, the CPU utilization of the physical machine exceeds the first parameter, and when the physical machine is overloaded, that is, the CPU utilization of the physical machine is lower than the second parameter, It is necessary to migrate some or all of the virtual machines on the host to other hosts according to the current state; where the first parameter is greater than the second parameter, for example, the first parameter is 80% and the second parameter is 20%.
本发明实施例中,当处于过载状态时,选择待迁移虚拟机的准则可以是将物理机上预测负载最大的虚拟机率先迁移出当前工作主机即当前物理机,并使得当前物理机能够满足剩下的虚拟机的未来资源需求。当处于低载状态时,将所有虚拟机都迁移出当前物理机,进而删除该虚拟机,以节省计算资源。In the embodiment of the present invention, when in an overload state, the criterion for selecting the virtual machine to be migrated may be that the virtual machine with the largest predicted load on the physical machine is first migrated out of the current working host, that is, the current physical machine, and the current physical machine can satisfy the remaining Future resource requirements for virtual machines. When in a low-load state, all virtual machines are migrated out of the current physical machine, and then the virtual machine is deleted to save computing resources.
步骤103、确定第二物理机,并将待迁移的虚拟机迁移至第二物理机。Step 103: Determine the second physical machine, and migrate the virtual machine to be migrated to the second physical machine.
其中,第二物理机与第一物理机不同,第二物理机属于云计算管理平台。Among them, the second physical machine is different from the first physical machine, and the second physical machine belongs to the cloud computing management platform.
本发明实施例中,当待迁移虚拟机己经被确定时,接下来就是选择迁移目的主机即目的物理机。迁移目的主机的选择需要考虑能够提供足够的资源给待迁移虚拟机,且确保迁移完成之后,目的主机的负载不至于因此超过预设阀值而导致二次甚至多次迁移。In the embodiment of the present invention, when the virtual machine to be migrated has been determined, the next step is to select the migration target host, that is, the destination physical machine. The selection of the migration destination host needs to consider that it can provide sufficient resources to the virtual machine to be migrated, and ensure that after the migration is completed, the load of the destination host will not exceed the preset threshold and cause two or more migrations.
本发明实施例中,系统通过目标物理机选择模块选择迁移目的主机时可以通过如下三个步骤实现:In the embodiment of the present invention, when the system selects the migration target host through the target physical machine selection module, the following three steps can be implemented:
步骤C1:选择出具有较小负载信息的目的主机。Step C1: Select the destination host with less load information.
步骤C2:在目的主机的数量为多个时,只要具有最小负载信息的目的主机被选择,就要使用工作负载预测方法针对该目的主机未来时刻的负载进行预测。如果该目的主机未来时刻的负载,相比于其他的目的主机而言仍然是最小的,则执行下一步,否则返回步骤C1重新选择目的主机。Step C2: When the number of destination hosts is multiple, as long as the destination host with the smallest load information is selected, the workload prediction method is used to predict the load of the destination host in the future. If the load of the destination host in the future is still the smallest compared to other destination hosts, the next step is executed, otherwise it returns to step C1 to reselect the destination host.
步骤C3:如果待迁移虚拟机的负载值加上步骤C2的预测值不会超过预设阀值,则这个目的主机会被选择作为虚拟机的迁移目标,否则返回步骤C1。Step C3: If the load value of the virtual machine to be migrated plus the predicted value of step C2 will not exceed the preset threshold, the destination host will be selected as the migration target of the virtual machine, otherwise return to step C1.
本发明实施例所提供的虚拟机迁移方法,若当前第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻第一物理机的第二负载;其中,第二时刻在第一时刻之后;若第二负载大于第二阈值,从第一物理机上的虚拟机中选择待迁移虚拟机;其中,第二阈值大于第一阈值;确定第二物理机,并将待迁移虚拟机迁移至第二物理机;其中,第二物理机与第一物理机不同;也就是说,本发明实施例中,在确定第一时刻第一物理机的突发性负载大于第一阈值时,对该第一物理机未来时刻的负载进行预测,并在确定未来时刻的负载比大于第一阈值的第二阈值还要高时,则触发一次迁移,如此,有效地避免了突发性负载对系统的干扰,解决了相关技术中瞬间的突发性负载达到固定阈值便会触发 虚拟机迁移,如此导致频繁的虚拟机迁移,造成不必要的迁移开销的问题,避免了突发性负载对系统的干扰,提高了系统的可靠性。In the virtual machine migration method provided by the embodiment of the present invention, if the first load of the first physical machine at the first moment is greater than the first threshold, the second load of the first physical machine at the second moment is predicted; After a moment; if the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine; wherein, the second threshold is greater than the first threshold; determine the second physical machine, and transfer the virtual machine to be migrated Migrate to the second physical machine; where the second physical machine is different from the first physical machine; that is, in the embodiment of the present invention, when it is determined that the burst load of the first physical machine at the first moment is greater than the first threshold, Predict the load of the first physical machine at the future moment, and when it is determined that the load at the future moment is higher than the second threshold greater than the first threshold, trigger a migration, thus effectively avoiding sudden load pairs The interference of the system solves the problem that the sudden burst load in the related technology will trigger the migration of the virtual machine when it reaches a fixed threshold, which leads to frequent virtual machine migration, causing unnecessary migration overhead, and avoiding the sudden load on the system. Interference improves the reliability of the system.
基于前述实施例,本发明实施例提供一种虚拟机迁移方法,应用于云计算管理平台;在云计算管理平台的物理机上建立有虚拟机集群,待迁移的虚拟机的数量为至少两个。本发明实施例中,可以借助集群部署技术优化虚拟机迁移过程。Based on the foregoing embodiments, embodiments of the present invention provide a virtual machine migration method, which is applied to a cloud computing management platform; a virtual machine cluster is established on a physical machine of the cloud computing management platform, and the number of virtual machines to be migrated is at least two. In the embodiments of the present invention, the virtual machine migration process can be optimized by using cluster deployment technology.
本发明实施例中,基于资源分类的虚拟机集群部署方法要完成的主要功能是要能选择出N个物理结点,且这些结点的资源足够部署n个虚拟机的集群,以便使整个物理机系统的资源相对平衡且综合利用。参见图7和图8所示,该方法包括:In the embodiment of the present invention, the main function to be completed by the virtual machine cluster deployment method based on resource classification is to be able to select N physical nodes, and the resources of these nodes are enough to deploy a cluster of n virtual machines, so that the entire physical The resources of the computer system are relatively balanced and comprehensively utilized. As shown in FIGS. 7 and 8, the method includes:
步骤201、若当前第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻第一物理机的第二负载。Step 201: If the first load of the first physical machine at the first moment is greater than the first threshold, predict the second load of the first physical machine at the second moment.
其中,第二时刻在第一时刻之后。Among them, the second moment is after the first moment.
本发明实施例中,在步骤201、若第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻第一物理机的第二负载之前,还包括如下步骤:In the embodiment of the present invention, in step 201, if the first load of the first physical machine at the first moment is greater than the first threshold, before predicting the second load of the first physical machine at the second moment, the following steps are further included:
步骤S1:云计算管理平台分析虚拟机集群的资源类型,区分资源类型,集群资源类型的分析有多种方式:可以根据用户的指定;可以根据该集群所用镜像的历史数据的分析。Step S1: The cloud computing management platform analyzes the resource type of the virtual machine cluster and distinguishes the resource type. There are many ways to analyze the resource type of the cluster: it can be specified by the user; it can be analyzed according to the historical data of the image used by the cluster.
步骤S2:云计算管理平台过滤集群部署请求,如果分析出部署系统因为CPU、内存、文件容量、网络带宽等方面的限制,致使不能完成此次集群部署时,应当过滤此次部署请求,并向用户反馈。Step S2: The cloud computing management platform filters the cluster deployment request. If it is analyzed that the deployment system is unable to complete the cluster deployment due to CPU, memory, file capacity, network bandwidth and other limitations, the deployment request should be filtered and submitted to customer feedback.
步骤202、若第二负载大于第二阈值,从第一物理机上的虚拟机中选择待迁移虚拟机。Step 202: If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine.
其中,第二阈值大于第一阈值。Among them, the second threshold is greater than the first threshold.
本发明实施例中,在选择待迁移虚拟机的过程中,可以假定虚拟机的数量为N,初始化这次操作每个物理机节点所需部署的虚拟机个数为0,创建一个容量为N的优先级队列,该优先级队列表征虚拟机资源负载优先级队列。In the embodiment of the present invention, in the process of selecting virtual machines to be migrated, it can be assumed that the number of virtual machines is N, and the number of virtual machines to be deployed for initial operation of each physical machine node is 0, and a capacity of N is created. Priority queue, the priority queue represents the virtual machine resource load priority queue.
步骤203、确定第二物理机。Step 203: Determine the second physical machine.
本发明实施例中,在确定第二物理机的过程中,可以循环遍历所有的物理 机节点,根据如下公式计算该物理机节点是否还可以部署新的虚拟机,当负载信息值L<L1,表明物理结点当前的负载比较低可以用来部署虚拟机;当负载信息值L1<L<L2时,表明物理机节点当前负载处于最佳状态,也可部署虚拟机,但是新增的虚拟不能使物理机节点负载过重;当负载信息值L>L2时,表明物理机节点当前负载过重,应该重新选择物理机节点。In the embodiment of the present invention, in the process of determining the second physical machine, all physical machine nodes can be traversed in cycles, and it can be calculated whether the physical machine node can also deploy a new virtual machine according to the following formula. When the load information value L<L1, It indicates that the current load of the physical node is relatively low and can be used to deploy virtual machines; when the load information value L1<L<L2, it indicates that the current load of the physical machine node is in the best state, and the virtual machine can also be deployed, but the new virtual machine cannot The physical machine node is overloaded; when the load information value L>L2, it indicates that the physical machine node is currently overloaded, and the physical machine node should be reselected.
本发明实施例中,负载信息的确定要依据集群的资源类型进行,将集群分为计算密集型集群、存储密集型集群、流量密集型集群。进而,基于集群确定待迁移虚拟机可以提高定位效率。In the embodiment of the present invention, the load information is determined according to the resource type of the cluster, and the cluster is divided into a computing-intensive cluster, a storage-intensive cluster, and a traffic-intensive cluster. Furthermore, determining the virtual machine to be migrated based on the cluster can improve the positioning efficiency.
本发明实施例中,根据集群的资源类型,按不同资源的权重计算出负载值后,插入虚拟机资源负载优先级队列,直到为所有的虚拟机选择了物理结点。In the embodiment of the present invention, after calculating the load value according to the weight of different resources according to the resource type of the cluster, the virtual machine resource load priority queue is inserted until the physical nodes are selected for all virtual machines.
步骤204、获取每个待迁移虚拟机的负载。Step 204: Obtain the load of each virtual machine to be migrated.
步骤205、从多个第二物理机中确定每个待迁移虚拟机对应的目标物理机。Step 205: Determine a target physical machine corresponding to each virtual machine to be migrated from multiple second physical machines.
其中,多个第二物理机包括目标物理机。Wherein, the plurality of second physical machines include target physical machines.
步骤206、获取多个目标物理机的负载。Step 206: Acquire the load of multiple target physical machines.
步骤207、根据每个待迁移虚拟机的负载和每个目标物理机的负载,对多个目标物理机进行排序,得到优先级队列。Step 207: Sort multiple target physical machines according to the load of each virtual machine to be migrated and the load of each target physical machine to obtain a priority queue.
本发明实施例中,步骤207根据每个待迁移虚拟机的负载和每个目标物理机的负载,对多个目标物理机进行排序,得到优先级队列,可以通过如下步骤实现:In the embodiment of the present invention, step 207 sorts multiple target physical machines according to the load of each virtual machine to be migrated and the load of each target physical machine to obtain a priority queue, which can be achieved by the following steps:
步骤207a、计算每个待迁移虚拟机的负载以及与每个待迁移虚拟机对应的目标物理机的负载的和,得到传输负载。Step 207a: Calculate the sum of the load of each virtual machine to be migrated and the load of the target physical machine corresponding to each virtual machine to be migrated to obtain the transmission load.
步骤207b、根据传输负载对多个目标物理机进行排序,得到优先级队列。Step 207b: Sort the multiple target physical machines according to the transmission load to obtain a priority queue.
步骤208、根据优先级队列确定每一目标物理机的优先级。Step 208: Determine the priority of each target physical machine according to the priority queue.
步骤209、按照优先级由高到低的顺序,对每个目标物理机对应的待迁移虚拟机进行镜像传输。Step 209: Perform image transmission on the virtual machine to be migrated corresponding to each target physical machine according to the order of priority from high to low.
其中,优先级高的目标物理机对应的传输负载小于优先级低的目标物理机对应的传输负载。The transmission load corresponding to the target physical machine with a high priority is less than the transmission load corresponding to the target physical machine with a low priority.
本发明实施例中,将待迁移虚拟机从第一物理机迁移到第二物理机中的目标物理机上,即要对虚拟机进行恢复,该过程要消耗物理机的资源,若目标物 理机当前负载较高,则等等再传;也就是说,目标物理机负载低,先把镜像传过去,再基于镜像恢复出虚拟机。最终,启动集群的所有虚拟机,完成集群部署。In the embodiment of the present invention, migrating the virtual machine to be migrated from the first physical machine to the target physical machine in the second physical machine means that the virtual machine needs to be restored. This process consumes the resources of the physical machine. If the load is high, the data will be transmitted again; that is, if the target physical machine has a low load, the image will be transmitted first, and then the virtual machine will be restored based on the image. Finally, start all the virtual machines in the cluster to complete the cluster deployment.
基于前述实施例,本发明实施例提供一种虚拟机迁移方法,应用于云计算管理平台,需要说明的是,本实施例的目的是在虚拟机迁移的过程中,采用虚拟机集群镜像快速快递技术,辅助提高虚拟机动态迁移的效率。Based on the foregoing embodiment, an embodiment of the present invention provides a virtual machine migration method, which is applied to a cloud computing management platform. It should be noted that the purpose of this embodiment is to use a virtual machine cluster image to express expressly during the process of virtual machine migration. Technology to help improve the efficiency of virtual machine dynamic migration.
由于虚拟机镜像文件包含集群应用、操作系统等部分,其文件大小往往在数千万字节,甚至可以达到数亿字节。因此,从镜像库中传递一个镜像文件到物理机器可能花费很长时间,而一个虚拟机集群可能由数十个虚拟机组成,部署和迁移这样的集群则需要更大的时间代价。镜像快速传递方法以镜像库的镜像及副本为根结点,当第一次拷贝完成之后,整个云平台系统中刚才进行传递的镜像文件共有镜像及副本数的两倍,然后再以镜像库中的镜像及副本、第一次传递的镜像作为第二次镜像传递的父结点,完成第二次镜像传递之后,系统中该镜像文件将有镜像及副本数的四倍。如此循环传递,直到能够满足集群所需的虚拟机数量。示例性的,图8中第一次拷贝之前,系统中仅包括实线框中的镜像文件如image1和image3、image2和image6以及image4和image5;当第一次拷贝完成之后,系统包括虚线框中的镜像文件如image2和image4、image1和image5以及image3和image6,即当第一次拷贝完成之后,整个云平台系统中刚才进行传递的镜像文件共有镜像及副本数的两倍。Because the virtual machine image file contains cluster applications, operating systems, etc., its file size is often in the tens of millions of bytes, and can even reach hundreds of millions of bytes. Therefore, it may take a long time to transfer an image file from the image library to the physical machine, and a virtual machine cluster may be composed of dozens of virtual machines. Deploying and migrating such a cluster requires a greater time cost. The fast image transfer method uses the image and copy of the image library as the root node. After the first copy is completed, the image file that has just been transferred in the entire cloud platform system has twice the number of images and copies, and then the image library The mirror and copy of, and the mirror of the first transfer serve as the parent node of the second mirror transfer. After the second mirror transfer, the mirror file in the system will have four times the number of mirrors and copies. This cycle is passed until the number of virtual machines required by the cluster can be met. Exemplarily, before the first copy in FIG. 8, the system only includes the image files such as image1 and image3, image2 and image6, and image4 and image5 in the solid line box; after the first copy is completed, the system includes the dotted box The image files such as image2 and image4, image1 and image5, and image3 and image6, that is, after the first copy is completed, the image files just transferred in the entire cloud platform system have twice the number of images and copies.
本发明实施例中,采用虚拟机集群镜像快速快递技术可以包括如下步骤:In the embodiment of the present invention, adopting the virtual machine cluster image fast express technology may include the following steps:
首先:假设镜像库中一个镜像存在M个备份,则镜像传递策略会从选出的物理机挑出M个物理机,接着将镜像文件传送到选出的物理机上,基本是一份镜像备份对一个物理机。First: Assuming that there are M backups for an image in the image library, the image transfer strategy will select M physical machines from the selected physical machine, and then transfer the image file to the selected physical machine, which is basically a mirror backup pair A physical machine.
其次:当这次传递完成之后,镜像库中的M个备份被称为根节点,M个已经接收镜像的物理机称为第一代子节点。Secondly: After this transfer is complete, the M backups in the image library are called the root node, and the M physical machines that have received the image are called the first-generation child nodes.
再次:如果虚拟机节点的部署请求仍然没有完成,则以M个备份节点即根节点,加上M个第一代子节点,分别向2M个第二代子节点,发送镜像。Again: If the deployment request of the virtual machine node is still not completed, then M backup nodes are the root node, plus M first-generation child nodes, and send mirror images to 2M second-generation child nodes, respectively.
最后:循环以上的步骤,直到部署请求完成。Finally: Loop the above steps until the deployment request is completed.
由上述可知,采用虚拟机集群镜像快速快递技术可以为镜像的多路并行传递提供策略支持,极大的提升虚拟机集群镜像文件的传输速度。It can be seen from the above that the rapid express technology of virtual machine cluster mirroring can provide strategic support for the multi-channel parallel transmission of mirror images, which greatly improves the transmission speed of the virtual machine cluster mirror file.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that the description of the same steps and the same content in this embodiment and other embodiments can refer to the descriptions in other embodiments, and are not repeated here.
基于前述实施例,本发明实施例提供一种虚拟机迁移方法,应用于云计算管理平台,该方法包括以下步骤:Based on the foregoing embodiments, embodiments of the present invention provide a virtual machine migration method, which is applied to a cloud computing management platform. The method includes the following steps:
步骤301、接收用户请求,并获取用户请求的请求类型。Step 301: Receive a user request and obtain the request type of the user request.
其中,请求类型包括静态请求或动态请求。Among them, the request type includes a static request or a dynamic request.
在实际应用中,各类服务器集群系统有各自的负载特点,所应考虑的负载指标也不同,例如:在Web服务器集群系统中,对静态内容的请求,服务器只需从磁盘中读取相应的内容发往浏览器即可;而对动态内容进行请求时,往往需要经过读取、编译和处理,生成请求的文件才能发送给客户端。In practical applications, various types of server cluster systems have their own load characteristics, and the load indicators that should be considered are also different. For example: in a Web server cluster system, for a request for static content, the server only needs to read the corresponding from the disk The content can be sent to the browser; when requesting dynamic content, it often needs to be read, compiled and processed to generate the requested file before it can be sent to the client.
参见图9所示,本发明实施例中可以将用户请求分为两类,其中,对静态内容的请求,这类请求给服务器带来的主要负载是网络带宽负载。在Web应用上,这类请求主要是对静态网页的请求。对动态内容的请求,这类请求给服务器带来的负载主要是对CPU和内存资源的占用。在Web应用上,这类请求主要是对动态网页的请求和数据库的访问。As shown in FIG. 9, in the embodiment of the present invention, user requests can be divided into two types. Among them, requests for static content. The main load that such requests bring to the server is the network bandwidth load. In web applications, such requests are mainly requests for static web pages. For requests for dynamic content, the load that such requests bring to the server is mainly the occupation of CPU and memory resources. In web applications, such requests are mainly requests for dynamic web pages and database access.
需要说明的是,确定用户请求的请求类型时,可根据用户请求的文件类型来确定。It should be noted that when determining the request type requested by the user, it can be determined according to the file type requested by the user.
步骤302、若第一负载大于第一阈值,获取预设时间段内至少两个时刻的第三负载。Step 302: If the first load is greater than the first threshold, obtain third loads at least two moments within a preset time period.
其中,预设时间段包括第一时刻以及第一时刻之前的至少一个第三时刻,至少两个时刻中每一时刻的第三负载包括至少两个不同属性的负载;不同属性的负载表征第一物理机中被占用的资源的类型不同。The preset time period includes the first time and at least one third time before the first time, and the third load at each time in the at least two times includes at least two loads with different attributes; the loads with different attributes represent the first The types of occupied resources in physical machines are different.
本发明实施例中,至少两个不同属性的负载包括:第一物理机的中央处理器的利用率、第一物理机的内存的利用率、第一物理机的输入接口/输出接口的利用率以及第一物理机的网络带宽的利用率中的至少两个。In the embodiment of the present invention, at least two loads with different attributes include: the utilization rate of the central processor of the first physical machine, the utilization rate of the memory of the first physical machine, and the utilization rate of the input interface/output interface of the first physical machine And at least two of the utilization rates of the network bandwidth of the first physical machine.
步骤303、获取每一时刻的第三负载中每一负载的属性。Step 303: Acquire the attribute of each load in the third load at each moment.
本发明实施例中,不同属性的负载表征第一物理机中被占用的资源的类型不同。In the embodiment of the present invention, the loads with different attributes represent different types of resources occupied in the first physical machine.
本发明实施例中,每一时刻的第三负载可以包括第一物理机的中央处理器 的利用率、第一物理机的内存的利用率、第一物理机的输入接口/输出接口的利用率以及第一物理机的网络带宽的利用率中的至少两个。In the embodiment of the present invention, the third load at each moment may include the utilization rate of the central processor of the first physical machine, the utilization rate of the memory of the first physical machine, and the utilization rate of the input interface/output interface of the first physical machine And at least two of the utilization rates of the network bandwidth of the first physical machine.
步骤304、根据请求类型和每一时刻的第三负载中每一负载的属性,确定每一时刻的第三负载中每一负载的权重值。Step 304: Determine the weight value of each load in the third load at each moment according to the request type and the attribute of each load in the third load at each moment.
本发明实施例中,根据当前时刻以及之前的负载数据,通过加权平均计算下一时刻的工作负载预测值,在确定负载数据权重时,需要先判断用户请求的类型,如果是对静态内容的请求,则将网络带宽项的权重增加20%,同时将CPU、内存的权重均减少10%;如果是对动态内容的请求,则将CPU和内存的权重均增加10%,同时将网络带宽项的权重减少20%。In the embodiment of the present invention, the workload forecast value at the next moment is calculated by weighted average according to the current and previous load data. When determining the weight of the load data, it is necessary to first determine the type of user request, if it is a request for static content , The weight of the network bandwidth item is increased by 20%, and the weight of CPU and memory are both reduced by 10%; if it is a request for dynamic content, the weight of CPU and memory are increased by 10%, and the weight of the network bandwidth item is increased. The weight is reduced by 20%.
示例性的,当用户请求为静态请求时,根据请求类型和某一时刻第三负载中每一负载的属性,确定第三负载中每一负载的权重值,如CPU利用率权重值为15%、内存利用率权重值为15%、输入接口/输出接口利用率权重值为25%、网络利用率带宽权重值为45%。Exemplarily, when the user request is a static request, the weight value of each load in the third load is determined according to the request type and the attribute of each load in the third load at a certain time, for example, the CPU utilization weight value is 15% , The memory utilization weight value is 15%, the input interface/output interface utilization weight value is 25%, and the network utilization bandwidth weight value is 45%.
当用户请求为动态请求时,根据请求类型和某一时刻第三负载中每一负载的属性,确定第三负载中每一负载的权重值,如CPU利用率权重值为35%、内存利用率权重值为35%、输入接口/输出接口利用率权重值为25%、网络利用率带宽权重值为5%。When the user request is a dynamic request, the weight value of each load in the third load is determined according to the request type and the attribute of each load in the third load at a certain time, such as the CPU utilization weight value is 35%, the memory utilization rate The weight value is 35%, the input interface/output interface utilization weight value is 25%, and the network utilization bandwidth weight value is 5%.
步骤305、根据每一时刻的第三负载和每一时刻的第三负载的权重值计算每一时刻的第四负载。Step 305: Calculate the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment.
本发明实施例中,可以利用公式1计算每一时刻的第四负载。In the embodiment of the present invention, the fourth load at each moment can be calculated using Formula 1.
L=a1×ucpu+a2×umem+a3×uio+a4×unet     (公式1)L=a1×ucpu+a2×umem+a3×uio+a4×unet (Formula 1)
其中,L表示每一时刻的第四负载;ucpu表示CPU利用率,umem表示内存利用率,uio表示I/O利用率,unet表示网络带宽利用率;a1表示CPU利用率权重值,a2表示内存利用率权重值,a3表示I/O利用率权重值,a4表示网络带宽利用率权重值,a1+a2+a3+a4=1。Among them, L represents the fourth load at each moment; ucpu represents CPU utilization, umem represents memory utilization, uio represents I/O utilization, and unet represents network bandwidth utilization; a1 represents CPU utilization weight value and a2 represents memory Utilization weight value, a3 indicates the I/O utilization weight value, a4 indicates the network bandwidth utilization weight value, a1+a2+a3+a4=1.
步骤306、根据每一时刻的第四负载计算第二负载。Step 306: Calculate the second load according to the fourth load at each moment.
本发明实施例中,计算多个时刻的第四负载的平均值,得到第二负载。In the embodiment of the present invention, the average value of the fourth load at multiple times is calculated to obtain the second load.
步骤307、若第二负载大于第二阈值,从第一物理机上的虚拟机中选择待迁移虚拟机。Step 307: If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine.
其中,第二阈值大于第一阈值。Among them, the second threshold is greater than the first threshold.
本发明实施例中,步骤307若第二负载大于第二阈值,从第一物理机上的虚拟机中选择待迁移虚拟机,可以包括如下步骤:In the embodiment of the present invention, if the second load is greater than the second threshold in step 307, selecting the virtual machine to be migrated from the virtual machines on the first physical machine may include the following steps:
步骤307a1、若第二负载大于第二阈值,获取第一物理机的资源利用率。Step 307a1, if the second load is greater than the second threshold, obtain the resource utilization rate of the first physical machine.
步骤307b1、根据资源利用率从第一物理机上的多个虚拟机中选择待迁移虚拟机。Step 307b1: Select a virtual machine to be migrated from multiple virtual machines on the first physical machine according to the resource utilization rate.
本发明实施例中,步骤307b1根据资源利用率从第一物理机上的多个虚拟机中选择待迁移虚拟机,还可以包括如下步骤:In the embodiment of the present invention, step 307b1 selects a virtual machine to be migrated from multiple virtual machines on the first physical machine according to the resource utilization rate, and may further include the following steps:
第一步、若资源利用率大于或等于第三阈值,预测第三时刻第一物理机上的每一虚拟机的第五负载。In the first step, if the resource utilization rate is greater than or equal to the third threshold, the fifth load of each virtual machine on the first physical machine at the third moment is predicted.
其中,第三时刻在第一时刻之后。Among them, the third moment is after the first moment.
本发明实施例中,若资源利用率大于或等于第三阈值,则确定物理机发生过载情况,进而预测第三时刻第一物理机上的每一虚拟机的第五负载。In the embodiment of the present invention, if the resource utilization rate is greater than or equal to the third threshold, it is determined that the physical machine is overloaded, and then the fifth load of each virtual machine on the first physical machine at the third moment is predicted.
第二步、从第一物理机上的虚拟机中选取第五负载中最大负载对应的虚拟机,并确定为待迁移虚拟机。In the second step, the virtual machine corresponding to the maximum load among the fifth loads is selected from the virtual machines on the first physical machine, and determined as the virtual machine to be migrated.
本发明实施例中,步骤307若第二负载大于第二阈值,从第一物理机上的虚拟机中选择待迁移虚拟机,还可以包括如下步骤:In the embodiment of the present invention, if the second load is greater than the second threshold in step 307, selecting the virtual machine to be migrated from the virtual machines on the first physical machine may further include the following steps:
步骤307a2、若资源利用率小于或等于第四阈值,确定第一物理机上的每一虚拟机为待迁移虚拟机。Step 307a2: If the resource utilization rate is less than or equal to the fourth threshold, determine that each virtual machine on the first physical machine is a virtual machine to be migrated.
其中,第四阈值小于第三阈值。Among them, the fourth threshold is smaller than the third threshold.
本发明实施例中,若资源利用率小于或等于第四阈值,则确定物理机发生低载情况,进而确定将该物理机上的所有虚拟机为待迁移虚拟机。In the embodiment of the present invention, if the resource utilization rate is less than or equal to the fourth threshold, it is determined that the physical machine has a low load condition, and then all virtual machines on the physical machine are determined to be virtual machines to be migrated.
在实际应用中,当物理机发生过载情况时如CPU利用率超过80%和低载情况时如CPU利用率低于20%,需要根据当前状态将该物理机上的部分或全部虚拟机迁移到其它物理机上运行。当处于过载状态时,将虚拟机按未来工作负载量进行降序排列,选择未来工作负载排名前列的虚拟机进行迁移。选择准则是将预测负载最大的虚拟机率先迁移出当前物理机,并使得主机能够满足剩下的虚拟机的未来资源需求。当处于低载状态时,将所有虚拟机都迁移出当前物理机。In practical applications, when the physical machine is overloaded, such as CPU utilization exceeding 80% and low load, such as CPU utilization being less than 20%, some or all of the virtual machines on the physical machine need to be migrated to other according to the current state Run on the physical machine. When in an overload state, the virtual machines are sorted in descending order according to the amount of future workload, and the virtual machines with the highest workload in the future are selected for migration. The selection criterion is to migrate the virtual machine with the largest predicted load out of the current physical machine first, and enable the host to meet the future resource requirements of the remaining virtual machines. When in a low-load state, all virtual machines are migrated out of the current physical machine.
步骤308、确定第二物理机,并将待迁移虚拟机迁移至第二物理机。Step 308: Determine the second physical machine, and migrate the virtual machine to be migrated to the second physical machine.
其中,第二物理机与第一物理机不同。Among them, the second physical machine is different from the first physical machine.
本发明实施例中,步骤308中确定第二物理机可以通过如下步骤实现:In the embodiment of the present invention, determining the second physical machine in step 308 may be implemented by the following steps:
步骤308a、获取第一时刻云计算管理平台中的每个物理机的第六负载。Step 308a: Acquire the sixth load of each physical machine in the cloud computing management platform at the first moment.
步骤308b、从云计算管理平台中的物理机中选取第六负载小于第五阈值的物理机,并确定为第三物理机。Step 308b: Select the physical machine with the sixth load less than the fifth threshold from the physical machines in the cloud computing management platform, and determine it as the third physical machine.
其中,第三物理机与第一物理机不同,第三物理机的数量为多个。The third physical machine is different from the first physical machine, and the number of the third physical machine is multiple.
本发明实施例中,系统在确定第三物理机时,还可以从云计算管理平台中的物理机中选取负载最小的物理机并确定为第一第三物理机。进而基于该第一第三物理机执行步骤308c,如果该第一第三物理机对应的预测负载即第七负载不是最小的,那么,从云计算管理平台中的物理机中重新选择除了第一第三物理机之外最小的物理机为第二第三物理机,并执行后续步骤。In the embodiment of the present invention, when determining the third physical machine, the system may also select the physical machine with the smallest load from the physical machines in the cloud computing management platform and determine the first and third physical machines. Further, based on the first and third physical machines, step 308c is executed. If the predicted load corresponding to the first and third physical machines, that is, the seventh load, is not the smallest, then reselect the physical machine in the cloud computing management platform except the first The smallest physical machine other than the third physical machine is the second and third physical machines, and the subsequent steps are performed.
步骤308c、预测第四时刻每个第三物理机上的虚拟机的第七负载。Step 308c: Predict the seventh load of the virtual machine on each third physical machine at the fourth moment.
其中,第四时刻在第一时刻之后。Among them, the fourth moment is after the first moment.
步骤308d、计算每个第三物理机的第七负载与待迁移虚拟机的负载的和,得到多个目标负载。Step 308d: Calculate the sum of the seventh load of each third physical machine and the load of the virtual machine to be migrated to obtain multiple target loads.
步骤308e、确定多个目标负载中小于第六阈值的目标负载。Step 308e: Determine a target load among the multiple target loads that is less than the sixth threshold.
步骤308f、从第三物理机中选取小于第六阈值的目标负载对应的第三物理机,并确定为第四物理机。Step 308f: Select the third physical machine corresponding to the target load less than the sixth threshold from the third physical machine, and determine it as the fourth physical machine.
其中,第四物理机的数量为至少一个。Among them, the number of the fourth physical machine is at least one.
步骤308g、从至少一个第四物理机中确定第二物理机。Step 308g: Determine a second physical machine from at least one fourth physical machine.
本发明实施例中,步骤308g从至少一个第四物理机中确定第二物理机可以通过如下步骤实现:In the embodiment of the present invention, the step 308g determining the second physical machine from the at least one fourth physical machine may be implemented by the following steps:
首先,计算每个第四物理机的第七负载减去每个第四物理机的第六负载的值,得到每个第四物理机的资源需求伸缩量。First, calculate the value of the seventh load of each fourth physical machine minus the sixth load of each fourth physical machine to obtain the amount of resource demand expansion and contraction of each fourth physical machine.
本发明实施例中,资源需求伸缩量为负值,表明未来负载在减少。资源需求伸缩量为正值,表明未来负载在增加。In the embodiment of the present invention, the amount of resource demand expansion and contraction is a negative value, indicating that the future load is decreasing. The amount of resource demand expansion and contraction is positive, indicating that the future load is increasing.
其次,计算每个第四物理机的资源总量减去每个第四物理机的第六负载的 值,得到每个第四物理机的未分配资源量。Secondly, the value of each fourth physical machine minus the sixth load of each fourth physical machine is calculated to obtain the unallocated resource amount of each fourth physical machine.
再次,计算每个第四物理机的未分配资源量减去每个第四物理机的资源需求伸缩量的值,得到每个第四物理机的预测剩余资源量。Thirdly, the value of the unallocated resource amount of each fourth physical machine minus the resource demand expansion and contraction amount of each fourth physical machine is calculated to obtain the predicted remaining resource amount of each fourth physical machine.
最后,根据每个第四物理机的预测剩余资源量,从第四物理机中确定第二物理机。Finally, according to the predicted remaining resource amount of each fourth physical machine, the second physical machine is determined from the fourth physical machine.
本发明实施例中,根据每个第四物理机的预测剩余资源量,从第四物理机中确定第二物理机,可以通过如下步骤实现:确定第四物理机的预测剩余资源量中的最大值对应的第四物理机为第二物理机。In the embodiment of the present invention, determining the second physical machine from the fourth physical machine according to the predicted remaining resource amount of each fourth physical machine may be achieved by the following steps: determining the maximum of the predicted remaining resource amount of the fourth physical machine The fourth physical machine corresponding to the value is the second physical machine.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that the description of the same steps and the same content in this embodiment and other embodiments can refer to the descriptions in other embodiments, and are not repeated here.
基于前述实施例,本发明实施例提供一种虚拟机迁移方法,应用于云计算管理平台,该方法包括以下步骤:Based on the foregoing embodiments, embodiments of the present invention provide a virtual machine migration method, which is applied to a cloud computing management platform. The method includes the following steps:
步骤401、若第一负载大于第一阈值,获取预设时间段内至少两个时刻的第三负载。Step 401: If the first load is greater than the first threshold, obtain third loads at least two moments within a preset time period.
其中,预设时间段包括第一时刻以及第一时刻之前的至少一个第三时刻,至少两个时刻中每一时刻的第三负载包括至少两个不同属性的负载。The preset time period includes the first time and at least one third time before the first time, and the third load at each time in the at least two times includes at least two loads with different attributes.
参见图10所示,本发明实施例中,每一时刻的第三负载包括距离,其中,距离表征第一物理机与接收到用户请求的数据中心之间的距离,云计算管理平台还包括数据中心,数据中心用于管理第三物理机,第三物理机包括第一物理机;同时,每一时刻的第三负载还包括第一物理机的中央处理器的利用率、第一物理机的内存的利用率、第一物理机的输入接口/输出接口的利用率以及第一物理机的网络带宽的利用率中的至少两个。As shown in FIG. 10, in the embodiment of the present invention, the third load at each moment includes a distance, where the distance represents the distance between the first physical machine and the data center that receives the user request, and the cloud computing management platform also includes data The data center is used to manage the third physical machine. The third physical machine includes the first physical machine. At the same time, the third load at each moment also includes the utilization rate of the central processor of the first physical machine and the At least two of the utilization rate of the memory, the utilization rate of the input interface/output interface of the first physical machine, and the utilization rate of the network bandwidth of the first physical machine.
需要说明的是,大型云计算平台通常包含多个数据中心,即通常所说的同城数据中心,多个数据中心一般不在一栋楼里面,而是分布在不同地点的数据中心机房中,各个地点之间相距5-10公里,如果虚拟机进行了跨数据中心迁移,由于距离的影响,业务的服务等级协议会受到影响,因此对虚拟机跨数据中心迁移进行限制。It should be noted that a large cloud computing platform usually includes multiple data centers, commonly known as data centers in the same city. Multiple data centers are generally not located in a building, but are distributed in data center computer rooms in different locations. The distance between them is 5-10 kilometers. If the virtual machines are migrated across data centers, the service level agreement of the business will be affected due to the distance. Therefore, the migration of virtual machines across data centers is restricted.
本发明实施例中,根据当前第一时刻以及第一时刻之前的多个第二时刻的负载数据,通过加权平均计算下一时刻的工作负载预测值,在计算加权平均的 时候,除了CPU、内存、I/O和网络带宽四个指标,加入距离指标,单位可以是公里。这样实现的效果就是本地数据中心的预测负载低,远端的数据中心负载高,有效防止了虚拟机迁移到远端数据中心。In the embodiment of the present invention, according to the load data of the current first time and a plurality of second times before the first time, the weighted average is used to calculate the predicted workload value at the next time. When calculating the weighted average, except for CPU and memory , I/O and network bandwidth are four indicators, and the distance indicator is added, and the unit can be kilometers. The effect achieved in this way is that the predicted load of the local data center is low and the load of the remote data center is high, which effectively prevents the virtual machine from migrating to the remote data center.
步骤402、获取每一时刻的第三负载中每一负载的属性。Step 402: Acquire the attribute of each load in the third load at each moment.
本发明实施例中,不同属性的负载表征第一物理机中被占用的资源的类型不同。In the embodiment of the present invention, loads with different attributes represent different types of resources occupied in the first physical machine.
步骤403、根据每一时刻的第三负载中每一负载的属性,确定每一时刻的第三负载中每一负载的权重值。Step 403: Determine the weight value of each load in the third load at each moment according to the attribute of each load in the third load at each moment.
参见图10所示,示例性的,如CPU利用率权重值为20%、内存利用率权重值为20%、输入接口/输出接口利用率权重值为20%、网络利用率带宽权重值为20%。As shown in FIG. 10, for example, the CPU utilization weight value is 20%, the memory utilization weight value is 20%, the input interface/output interface utilization weight value is 20%, and the network utilization bandwidth weight value is 20. %.
步骤404、根据每一时刻的第三负载和每一时刻的第三负载的权重值计算每一时刻的第四负载。Step 404: Calculate the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment.
步骤405、根据每一时刻的第四负载计算第二负载。Step 405: Calculate the second load according to the fourth load at each moment.
本发明实施例中,计算多个时刻的第四负载的平均值,得到第二负载。In the embodiment of the present invention, the average value of the fourth load at multiple times is calculated to obtain the second load.
步骤406、若第二负载大于第二阈值,从第一物理机上的虚拟机中选择待迁移虚拟机。Step 406: If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine.
其中,第二阈值大于第一阈值。在实际应用中,当物理机发生过载情况时如CPU利用率超过80%和低载情况时如CPU利用率低于20%,需要根据当前状态将该物理机上的部分或全部虚拟机迁移到其它物理机上运行。当处于过载状态时,将虚拟机按未来工作负载量进行降序排列,选择未来工作负载排名前列的虚拟机进行迁移。选择准则是将预测负载最大的虚拟机率先迁移出当前物理机,并使得主机能够满足剩下的虚拟机的未来资源需求。当处于低载状态时,将所有虚拟机都迁移出当前物理机。Among them, the second threshold is greater than the first threshold. In practical applications, when the physical machine is overloaded, such as CPU utilization exceeding 80% and low load, such as CPU utilization being less than 20%, some or all of the virtual machines on the physical machine need to be migrated to other according to the current state Run on the physical machine. When in an overload state, the virtual machines are sorted in descending order according to the amount of future workload, and the virtual machines with the highest workload in the future are selected for migration. The selection criterion is to migrate the virtual machine with the largest predicted load out of the current physical machine first, and enable the host to meet the future resource requirements of the remaining virtual machines. When in a low-load state, all virtual machines are migrated out of the current physical machine.
步骤407、确定第二物理机,并将待迁移虚拟机迁移至第二物理机。Step 407: Determine the second physical machine, and migrate the virtual machine to be migrated to the second physical machine.
其中,第二物理机与第一物理机不同。Among them, the second physical machine is different from the first physical machine.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that the description of the same steps and the same content in this embodiment and other embodiments can refer to the descriptions in other embodiments, and are not repeated here.
综上,本发明实施例具有以下有益效果:In summary, the embodiments of the present invention have the following beneficial effects:
(1)提出了工作负载预测方法,负载综合考虑了CPU占用率、内存占用率、磁盘IO、网络带宽、距离多个要素,通过对虚拟机所执行任务的未来负载量进行预测,并通过对业务请求的分类来调整负载指标的权重,从而精确的筛选出需要迁移的虚拟机和安置主机,减少虚拟机迁移次数,避免了迁移震荡。(1) A workload prediction method is proposed. The load comprehensively considers multiple factors such as CPU usage, memory usage, disk IO, network bandwidth, and distance. By predicting the future load of tasks performed by the virtual machine, and by The classification of business requests adjusts the weight of the load index, so as to accurately select the virtual machines that need to be migrated and install the hosts, reduce the number of virtual machine migrations, and avoid migration shocks.
(2)提出了基于资源分类的虚拟机集群部署方法,按资源类型划分不同的虚拟机集群,这样能快速的筛选出待迁移的虚拟机以及目标物理主机,辅助提高虚拟机动态迁移的效率。(2) A virtual machine cluster deployment method based on resource classification is proposed. Different virtual machine clusters are divided according to resource types, which can quickly select the virtual machines to be migrated and the target physical host, and help improve the efficiency of virtual machine dynamic migration.
(3)提出了基于镜像副本分裂的镜像快速传递方法,该方法以镜像库的镜像及副本为根结点,通过多次的循环拷贝,使虚拟机镜像能以M、2M、4M...速度快速复制,辅助提高虚拟机动态迁移的效率。(3) A fast image transfer method based on image copy split is proposed. This method uses the image and copy of the image library as the root node, and through multiple cyclic copies, the virtual machine image can be M, 2M, 4M... Fast copy speed, help improve the efficiency of virtual machine dynamic migration.
(4)提出了预防虚拟机跨数据中心迁移的方法,通过将数据中心距离指标引入负载预测的计算,有效防止多数据中心场景下虚拟机的迁移,从而保证业务的服务等级协议。(4) A method to prevent the migration of virtual machines across data centers is proposed. By introducing the data center distance index into the calculation of load prediction, the migration of virtual machines in multiple data center scenarios is effectively prevented, thereby ensuring the service level agreement of the business.
基于前述实施例,本发明的实施例提供一种云计算管理平台,该云计算管理平台可以应用于图5、7对应的实施例提供的一种虚拟机迁移方法中,参照图11示,该云计算管理平台11包括:处理器1101、存储器1102和通信总线1103,其中:Based on the foregoing embodiments, embodiments of the present invention provide a cloud computing management platform that can be applied to a virtual machine migration method provided in the embodiments corresponding to FIGS. 5 and 7. Referring to FIG. 11, The cloud computing management platform 11 includes: a processor 1101, a memory 1102, and a communication bus 1103, where:
通信总线1103用于实现处理器1101和存储器1102之间的通信连接。The communication bus 1103 is used to implement a communication connection between the processor 1101 and the memory 1102.
处理器1101用于执行存储器1102中存储的虚拟机迁移程序,以实现以下步骤:The processor 1101 is used to execute a virtual machine migration program stored in the memory 1102 to implement the following steps:
若当前第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻第一物理机的第二负载;其中,第二时刻在第一时刻之后;If the first load of the first physical machine at the current first moment is greater than the first threshold, the second load of the first physical machine at the second moment is predicted; where the second moment is after the first moment;
若第二负载大于第二阈值,从第一物理机上的虚拟机中选择待迁移虚拟机;其中,第二阈值大于第一阈值;If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine; wherein, the second threshold is greater than the first threshold;
确定第二物理机,并将待迁移虚拟机迁移至第二物理机;其中,第二物理机与第一物理机不同。Determine the second physical machine, and migrate the virtual machine to be migrated to the second physical machine; where the second physical machine is different from the first physical machine.
在本发明的其他实施例中,处理器1101用于执行存储器1102中若当前的第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻第一物理机的第二负载时,可以通过以下步骤实现:In other embodiments of the present invention, the processor 1101 is used to execute in the memory 1102 if the first load of the first physical machine at the first moment is greater than the first threshold, predict the second load of the first physical machine at the second moment , Can be achieved by the following steps:
若第一负载大于第一阈值,获取预设时间段内至少两个时刻的第三负载;其中,预设时间段包括第一时刻以及第一时刻之前的至少一个第三时刻,至少两个时刻中每一时刻的第三负载包括至少两个不同属性的负载;不同属性的负载表征第一物理机中被占用的资源的类型不同;If the first load is greater than the first threshold, obtain a third load at least two moments within a preset time period; wherein the preset time period includes the first moment and at least one third moment before the first moment, at least two moments The third load at each moment in includes at least two loads with different attributes; the loads with different attributes represent different types of resources occupied in the first physical machine;
根据每一时刻的第三负载和每一时刻的第三负载的权重值计算每一时刻的第四负载;Calculate the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment;
根据每一时刻的第四负载计算第二负载。The second load is calculated based on the fourth load at each moment.
在本发明的其他实施例中,处理器1101用于执行存储器1102中根据每一时刻的第四负载计算第二负载时,可以通过以下步骤实现:In other embodiments of the present invention, when the processor 1101 is used to execute the calculation of the second load according to the fourth load at each moment in the memory 1102, the following steps may be implemented:
计算多个时刻的第四负载的平均值,得到第二负载。The average value of the fourth load at multiple times is calculated to obtain the second load.
在本发明的其他实施例中,处理器1101用于执行存储器1102中虚拟机迁移程序,以实现以下步骤:In other embodiments of the present invention, the processor 1101 is used to execute a virtual machine migration program in the memory 1102 to implement the following steps:
接收用户请求,并获取用户请求的请求类型;其中,请求类型包括静态请求或动态请求;Receive user requests and obtain the request types requested by users; where the request types include static requests or dynamic requests;
相应的,根据每一时刻的第三负载和每一时刻的第三负载的权重值计算每一时刻的第四负载之前,方法还包括:Correspondingly, before calculating the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment, the method further includes:
获取每一时刻的第三负载中每一负载的属性;Obtain the attributes of each load in the third load at each moment;
根据请求类型和每一时刻的第三负载中每一负载的属性,确定每一时刻的第三负载中每一负载的权重值。According to the request type and the attribute of each load in the third load at each moment, the weight value of each load in the third load at each moment is determined.
在本发明的其他实施例中,每一时刻的第三负载还包括距离,其中,距离表征第一物理机与接收到用户请求的数据中心之间的距离,云计算管理平台还包括数据中心,数据中心用于管理第三物理机,第三物理机包括第一物理机。In other embodiments of the present invention, the third load at each moment also includes a distance, where the distance represents the distance between the first physical machine and the data center that receives the user request, and the cloud computing management platform also includes a data center, The data center is used to manage the third physical machine, and the third physical machine includes the first physical machine.
在本发明的其他实施例中,处理器1101用于执行存储器1102中虚拟机迁移程序,以实现以下步骤:In other embodiments of the present invention, the processor 1101 is used to execute a virtual machine migration program in the memory 1102 to implement the following steps:
获取每一时刻的第三负载中每一负载的属性;Obtain the attributes of each load in the third load at each moment;
根据每一时刻的第三负载中每一负载的属性,确定每一时刻的第三负载中每一负载的权重值。According to the attribute of each load in the third load at each moment, the weight value of each load in the third load at each moment is determined.
在本发明的其他实施例中,处理器1101用于执行存储器1102中第一物理机上的虚拟机的数量为多个,若第二负载大于第二阈值,从第一物理机上的虚 拟机中选择待迁移虚拟机时,可以通过以下步骤实现:In other embodiments of the present invention, the processor 1101 is used to execute a plurality of virtual machines on the first physical machine in the memory 1102. If the second load is greater than the second threshold, select from the virtual machines on the first physical machine When you want to migrate a virtual machine, you can use the following steps:
若第二负载大于第二阈值,获取第一物理机的资源利用率;If the second load is greater than the second threshold, obtain the resource utilization rate of the first physical machine;
根据资源利用率从第一物理机上的多个虚拟机中选择待迁移虚拟机。The virtual machine to be migrated is selected from multiple virtual machines on the first physical machine according to the resource utilization rate.
在本发明的其他实施例中,处理器1101用于执行存储器1102中根据资源利用率从第一物理机上的多个虚拟机中选择待迁移虚拟机时,可以通过以下步骤实现:In other embodiments of the present invention, the processor 1101 is used to execute the selection of a virtual machine to be migrated from multiple virtual machines on the first physical machine in the memory 1102 according to the resource utilization rate by the following steps:
若资源利用率大于或等于第三阈值,预测第三时刻第一物理机上的每一虚拟机的第五负载;其中,第三时刻在第一时刻之后;If the resource utilization rate is greater than or equal to the third threshold, predict the fifth load of each virtual machine on the first physical machine at the third moment; where the third moment is after the first moment;
从第一物理机上的虚拟机中选取第五负载中最大负载对应的虚拟机,并确定为待迁移虚拟机。The virtual machine corresponding to the maximum load in the fifth load is selected from the virtual machines on the first physical machine, and determined as the virtual machine to be migrated.
在本发明的其他实施例中,处理器1101用于执行存储器1102中根据资源利用率从第一物理机上的多个虚拟机中选择待迁移虚拟机时,可以通过以下步骤实现:In other embodiments of the present invention, the processor 1101 is used to execute the selection of a virtual machine to be migrated from multiple virtual machines on the first physical machine in the memory 1102 according to the resource utilization rate by the following steps:
若资源利用率小于或等于第四阈值,确定第一物理机上的每一虚拟机为待迁移虚拟机;其中,第四阈值小于第三阈值。If the resource utilization rate is less than or equal to the fourth threshold, it is determined that each virtual machine on the first physical machine is a virtual machine to be migrated; wherein, the fourth threshold is less than the third threshold.
在本发明的其他实施例中,处理器1101用于执行存储器1102中确定第二物理机时,可以通过以下步骤实现:In other embodiments of the present invention, when the processor 1101 is used to execute the determination of the second physical machine in the memory 1102, the following steps may be implemented:
获取第一时刻云计算管理平台中的每个物理机的第六负载;Obtain the sixth load of each physical machine in the cloud computing management platform at the first moment;
从云计算管理平台中的物理机中选取第六负载小于第五阈值的物理机,并确定为第三物理机;其中,第三物理机与第一物理机不同,第三物理机的数量为多个;Select the physical machine with the sixth load less than the fifth threshold from the physical machines in the cloud computing management platform and determine it as the third physical machine; where the third physical machine is different from the first physical machine, the number of third physical machines is Multiple
预测第四时刻每个第三物理机上的虚拟机的第七负载;其中,第四时刻在第一时刻之后;Predict the seventh load of the virtual machine on each third physical machine at the fourth moment; where the fourth moment is after the first moment;
计算每个第三物理机的第七负载与待迁移虚拟机的负载的和,得到多个目标负载;Calculate the sum of the seventh load of each third physical machine and the load of the virtual machine to be migrated to obtain multiple target loads;
确定多个目标负载中小于第六阈值的目标负载;Determine a target load that is less than the sixth threshold among multiple target loads;
从第三物理机中选取小于第六阈值的目标负载对应的第三物理机,并确定为第四物理机;其中,第四物理机的数量为至少一个;The third physical machine corresponding to the target load less than the sixth threshold is selected from the third physical machines, and determined as the fourth physical machine; wherein the number of the fourth physical machine is at least one;
从至少一个第四物理机中确定第二物理机。The second physical machine is determined from at least one fourth physical machine.
在本发明的其他实施例中,处理器1101用于执行存储器1102中从至少一个第四物理机中确定第二物理机时,可以通过以下步骤实现:In other embodiments of the present invention, when the processor 1101 is used to execute determining the second physical machine from the at least one fourth physical machine in the memory 1102, the following steps may be implemented:
计算每个第四物理机的第七负载减去每个第四物理机的第六负载的值,得到每个第四物理机的资源需求伸缩量;Calculate the value of the seventh load of each fourth physical machine minus the sixth load of each fourth physical machine to obtain the resource demand expansion and contraction amount of each fourth physical machine;
计算每个第四物理机的资源总量减去每个第四物理机的第六负载的值,得到每个第四物理机的未分配资源量;Calculate the total resource of each fourth physical machine minus the value of the sixth load of each fourth physical machine to obtain the unallocated resource amount of each fourth physical machine;
计算每个第四物理机的未分配资源量减去每个第四物理机的资源需求伸缩量的值,得到每个第四物理机的预测剩余资源量;Calculate the value of the unallocated resources of each fourth physical machine minus the resource demand expansion and contraction of each fourth physical machine to obtain the predicted remaining resource amount of each fourth physical machine;
根据每个第四物理机的预测剩余资源量,从第四物理机中确定第二物理机。The second physical machine is determined from the fourth physical machine according to the predicted remaining resource amount of each fourth physical machine.
在本发明的其他实施例中,处理器1101用于执行存储器1102中根据第四物理机的预测剩余资源量从第四物理机中确定第二物理机时,可以通过以下步骤实现:In other embodiments of the present invention, the processor 1101 is used to execute the determination of the second physical machine from the fourth physical machine according to the predicted remaining resource amount of the fourth physical machine in the memory 1102 by the following steps:
确定第四物理机的预测剩余资源量中的最大值对应的第四物理机为第二物理机。It is determined that the fourth physical machine corresponding to the maximum value in the predicted remaining resource amount of the fourth physical machine is the second physical machine.
在本发明的其他实施例中,在云计算管理平台的物理机上建立有虚拟机集群,待迁移虚拟机的数量为至少两个,待迁移虚拟机的数量和第二物理机的数量相同,处理器1101用于执行存储器1102中虚拟机迁移程序,以实现以下步骤:In other embodiments of the present invention, a virtual machine cluster is established on the physical machine of the cloud computing management platform, the number of virtual machines to be migrated is at least two, and the number of virtual machines to be migrated is the same as the number of second physical machines. The device 1101 is used to execute a virtual machine migration program in the storage 1102 to implement the following steps:
获取每个待迁移虚拟机的负载;Obtain the load of each virtual machine to be migrated;
从多个第二物理机中确定每个待迁移虚拟机对应的目标物理机;其中,多个第二物理机包括目标物理机;Determining the target physical machine corresponding to each virtual machine to be migrated from the plurality of second physical machines; wherein the plurality of second physical machines include the target physical machine;
获取多个目标物理机的负载;Obtain the load of multiple target physical machines;
根据每个待迁移虚拟机的负载和每个目标物理机的负载,对多个目标物理机进行排序,得到优先级队列。According to the load of each virtual machine to be migrated and the load of each target physical machine, the multiple target physical machines are sorted to obtain a priority queue.
在本发明的其他实施例中,处理器1101用于执行存储器1102中根据每个待迁移虚拟机的负载和每个目标物理机的负载,对多个第二物理机进行排序,得到优先级队列时,可以通过以下步骤实现:In other embodiments of the present invention, the processor 1101 is used to execute, in the memory 1102, sort multiple second physical machines according to the load of each virtual machine to be migrated and the load of each target physical machine to obtain a priority queue Can be achieved by the following steps:
计算每个待迁移虚拟机的负载以及与每个待迁移虚拟机对应的目标物理机 的负载的和,得到传输负载;Calculate the sum of the load of each virtual machine to be migrated and the load of the target physical machine corresponding to each virtual machine to be migrated to obtain the transmission load;
根据传输负载对多个目标物理机进行排序,得到优先级队列。Sort multiple target physical machines according to the transmission load to obtain a priority queue.
在本发明的其他实施例中,处理器1101用于执行存储器1102中根将待迁移虚拟机迁移至第二物理机时,可以通过以下步骤实现:In other embodiments of the present invention, when the processor 1101 is used to execute the root migration of the virtual machine to be migrated to the second physical machine in the memory 1102, the following steps may be implemented:
根据优先级队列确定每一目标物理机的优先级;Determine the priority of each target physical machine according to the priority queue;
按照优先级由高到低的顺序,对每个目标物理机对应的待迁移虚拟机进行镜像传输;其中,优先级高的目标物理机对应的传输负载小于优先级低的目标物理机对应的传输负载。Mirror the virtual machines corresponding to each target physical machine to be migrated in order of high priority to low priority; where the transmission load corresponding to the target physical machine with high priority is less than that corresponding to the target physical machine with low priority load.
需要说明的是,本实施例中处理器所执行的步骤的具体实现过程,可以参照图5、7对应的实施例提供的虚拟机迁移方法中的实现过程,此处不再赘述。It should be noted that, for the specific implementation process of the steps performed by the processor in this embodiment, reference may be made to the implementation process in the virtual machine migration method provided in the embodiments corresponding to FIGS. 5 and 7, and details are not described here.
基于前述实施例,本发明的实施例提供一种存储介质,该存储介质存储有一个或者多个程序,该一个或者多个程序可被一个或者多个处理器执行,以实现如图5、7对应的实施例提供的虚拟机迁移方法中的步骤。Based on the foregoing embodiments, the embodiments of the present invention provide a storage medium that stores one or more programs, and the one or more programs may be executed by one or more processors to implement Figures 5 and 7 Steps in the method for migrating a virtual machine provided by the corresponding embodiment.
需要说明的是,上述计算机存储介质可以是只读存储器(Read Only Memory,ROM)、可编程只读存储器(Programmable Read-Only Memory,PROM)、可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM)、电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性随机存取存储器(Ferromagnetic Random Access Memory,FRAM)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(Compact Disc Read-Only Memory,CD-ROM)等存储器;也可以是包括上述存储器之一或任意组合的各种电子设备,如移动电话、计算机、平板设备、个人数字助理等。It should be noted that the above-mentioned computer storage media may be read-only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-memory) Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Random Access Memory (Ferromagnetic Random Access Memory, FRAM), Flash Memory (Flash) Memory, Magnetic Surface memory, compact disc, or read-only compact disc (Compact Disc Read-Only Memory, CD-ROM) and other memories; can also be one of the above memories or any combination of various electronic devices, such as mobile phones, computers, tablet devices, Personal digital assistant, etc.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,从语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, It also includes other elements that are not explicitly listed, or include elements inherent to this process, method, article, or device. In the absence of more restrictions, the element defined by the sentence "include one..." does not exclude that there are other identical elements in the process, method, article or device that includes the element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The sequence numbers of the above embodiments of the present invention are for description only, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所描述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods in the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware, but in many cases the former is better Implementation. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence or part that contributes to the existing technology, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, The CD-ROM includes several instructions to enable a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the embodiments of the present invention.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可从计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and/or block in the flowchart and/or block diagram and a combination of the flow and/or block in the flowchart and/or block diagram may be implemented from computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processing machine, or other programmable data processing device to produce a machine that enables the generation of instructions executed by the processor of the computer or other programmable data processing device A device for realizing the functions specified in one block or multiple blocks of one flow or multiple flows of a flowchart and/or one block or multiple blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instructions The device implements the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, which is executed on the computer or other programmable device The instructions provide steps for implementing the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by the description and drawings of the present invention, or directly or indirectly used in other related technical fields The same reason is included in the patent protection scope of the present invention.
工业实用性Industrial applicability
本发明实施例,解决了相关技术中瞬间的突发性负载达到固定阈值便会触发虚拟机迁移,如此导致频繁的虚拟机迁移,造成不必要的迁移开销的问题,避免了突发性负载对系统的干扰,提高了系统的可靠性。The embodiment of the present invention solves the problem that the sudden burst load in the related art will trigger the migration of the virtual machine when it reaches a fixed threshold, thus causing frequent virtual machine migration, causing unnecessary migration overhead, and avoiding the sudden load The interference of the system improves the reliability of the system.

Claims (17)

  1. 一种虚拟机迁移方法,应用于云计算管理平台,所述方法包括:A virtual machine migration method is applied to a cloud computing management platform. The method includes:
    若当前第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻所述第一物理机的第二负载;其中,所述第二时刻在所述第一时刻之后;If the first load of the first physical machine is greater than the first threshold at the current first moment, the second load of the first physical machine at the second moment is predicted; wherein, the second moment is after the first moment;
    若所述第二负载大于第二阈值,从所述第一物理机上的虚拟机中选择待迁移虚拟机;其中,所述第二阈值大于所述第一阈值;If the second load is greater than the second threshold, select the virtual machine to be migrated from the virtual machines on the first physical machine; wherein, the second threshold is greater than the first threshold;
    确定第二物理机,并将所述待迁移虚拟机迁移至所述第二物理机;其中,所述第二物理机与所述第一物理机不同。Determine a second physical machine, and migrate the virtual machine to be migrated to the second physical machine; wherein the second physical machine is different from the first physical machine.
  2. 根据权利要求1所述的方法,其中,所述若当前的第一时刻第一物理机的第一负载大于第一阈值,预测第二时刻所述第一物理机的第二负载,包括:The method according to claim 1, wherein, if the first load of the first physical machine at the current first moment is greater than a first threshold, predicting the second load of the first physical machine at the second moment includes:
    若所述第一负载大于所述第一阈值,获取预设时间段内至少两个时刻的第三负载;其中,所述预设时间段包括所述第一时刻以及所述第一时刻之前的至少一个第三时刻,所述至少两个时刻中每一时刻的第三负载包括至少两个不同属性的负载;不同属性的负载表征第一物理机中被占用的资源的类型不同;If the first load is greater than the first threshold, obtain a third load at least two moments within a preset time period; wherein the preset time period includes the first time and the time before the first time At least one third moment, the third load at each moment in the at least two moments includes at least two loads with different attributes; the loads with different attributes represent different types of resources occupied in the first physical machine;
    根据所述每一时刻的第三负载和所述每一时刻的第三负载的权重值计算所述每一时刻的第四负载;Calculating the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment;
    根据所述每一时刻的第四负载计算所述第二负载。The second load is calculated based on the fourth load at each moment.
  3. 根据权利要求2所述的方法,其中,所述根据所述每一时刻的第四负载计算所述第二负载,包括:The method according to claim 2, wherein the calculating the second load according to the fourth load at each moment includes:
    计算多个时刻的第四负载的平均值,得到所述第二负载。The average value of the fourth load at multiple times is calculated to obtain the second load.
  4. 根据权利要求2所述的方法,其中,所述若所述第一负载大于所述第一阈值,获取所述第一时刻之前的多个时刻中的每一时刻的多个不同种类的负载数据之前,所述方法还包括:The method according to claim 2, wherein, if the first load is greater than the first threshold, acquiring a plurality of different kinds of load data at each time in a plurality of times before the first time Previously, the method also included:
    接收用户请求,并获取所述用户请求的请求类型;其中,所述请求类型包括静态请求或动态请求;Receiving a user request, and obtaining the request type of the user request; wherein, the request type includes a static request or a dynamic request;
    相应的,所述根据所述每一时刻的第三负载和所述每一时刻的第三负载的权重值计算所述每一时刻的第四负载之前,所述方法还包括:Correspondingly, before calculating the fourth load at each moment according to the third load at each moment and the weight value of the third load at each moment, the method further includes:
    获取所述每一时刻的第三负载中每一负载的属性;Acquiring the attribute of each load in the third load at each moment;
    根据所述请求类型和所述每一时刻的第三负载中每一负载的属性,确定所述每一时刻的第三负载中每一负载的权重值。According to the request type and the attribute of each load in the third load at each moment, the weight value of each load in the third load at each moment is determined.
  5. 根据权利要求2所述的方法,其中,所述每一时刻的第三负载还包括距离,其中,所述距离表征所述第一物理机与接收到用户请求的数据中心之间的距离,所述云计算管理平台还包括所述数据中心,所述数据中心用于管理第三物理机,所述第三物理机包括所述第一物理机。The method according to claim 2, wherein the third load at each moment further comprises a distance, wherein the distance characterizes the distance between the first physical machine and the data center receiving the user request, so The cloud computing management platform further includes the data center, and the data center is used to manage a third physical machine, and the third physical machine includes the first physical machine.
  6. 根据权利要求5所述的方法,其中,所述根据所述每一时刻的第三负载和所述每一时刻的第三负载的权重值计算所述每一时刻的第四负载之前,所述方法还包括:The method according to claim 5, wherein before calculating the fourth load at each moment according to the weight value of the third load at each moment and the third load at each moment, the The method also includes:
    获取所述每一时刻的第三负载中每一负载的属性;Acquiring the attribute of each load in the third load at each moment;
    根据所述每一时刻的第三负载中每一负载的属性,确定所述每一时刻的第三负载中每一负载的权重值。According to the attribute of each load in the third load at each moment, the weight value of each load in the third load at each moment is determined.
  7. 根据权利要求1所述的方法,其中,所述第一物理机上的虚拟机的数量为多个,所述若所述第二负载大于第二阈值,从所述第一物理机上的虚拟机中选择待迁移虚拟机,包括:The method according to claim 1, wherein the number of virtual machines on the first physical machine is multiple, and if the second load is greater than a second threshold, from the virtual machines on the first physical machine Select the virtual machine to be migrated, including:
    若所述第二负载大于所述第二阈值,获取所述第一物理机的资源利用率;If the second load is greater than the second threshold, obtain the resource utilization rate of the first physical machine;
    根据所述资源利用率从所述第一物理机上的多个虚拟机中选择待迁移虚拟机。The virtual machine to be migrated is selected from multiple virtual machines on the first physical machine according to the resource utilization rate.
  8. 根据权利要求7所述的方法,其中,所述根据所述资源利用率从所 述第一物理机上的多个虚拟机中选择待迁移虚拟机,包括:The method according to claim 7, wherein the selecting a virtual machine to be migrated from a plurality of virtual machines on the first physical machine according to the resource utilization rate includes:
    若所述资源利用率大于或等于第三阈值,预测第三时刻所述第一物理机上的每一虚拟机的第五负载;其中,所述第三时刻在所述第一时刻之后;If the resource utilization rate is greater than or equal to a third threshold, predict a fifth load of each virtual machine on the first physical machine at the third moment; wherein the third moment is after the first moment;
    从所述第一物理机上的虚拟机中选取第五负载中最大负载对应的虚拟机,并确定为所述待迁移虚拟机。Select the virtual machine corresponding to the maximum load among the fifth loads from the virtual machines on the first physical machine, and determine the virtual machine to be migrated.
  9. 根据权利要求7所述的方法,其中,所述根据所述资源利用率从所述第一物理机上的多个虚拟机中选择待迁移虚拟机,包括:The method according to claim 7, wherein the selecting a virtual machine to be migrated from a plurality of virtual machines on the first physical machine according to the resource utilization rate includes:
    若所述资源利用率小于或等于第四阈值,确定所述第一物理机上的每一虚拟机为所述待迁移虚拟机;其中,所述第四阈值小于第三阈值。If the resource utilization rate is less than or equal to a fourth threshold, it is determined that each virtual machine on the first physical machine is the virtual machine to be migrated; wherein, the fourth threshold is less than the third threshold.
  10. 根据权利要求1所述的方法,其中,所述确定第二物理机,包括:The method of claim 1, wherein the determining the second physical machine comprises:
    获取所述第一时刻所述云计算管理平台中的每个物理机的第六负载;Acquiring the sixth load of each physical machine in the cloud computing management platform at the first moment;
    从所述云计算管理平台中的物理机中选取第六负载小于第五阈值的物理机,并确定为第三物理机;其中,所述第三物理机与所述第一物理机不同,所述第三物理机的数量为多个;The physical machine with the sixth load less than the fifth threshold is selected from the physical machines in the cloud computing management platform, and determined as the third physical machine; wherein the third physical machine is different from the first physical machine, so The number of the third physical machine is multiple;
    预测第四时刻每个所述第三物理机上的虚拟机的第七负载;其中,所述第四时刻在所述第一时刻之后;Predicting the seventh load of the virtual machine on each third physical machine at the fourth moment; wherein, the fourth moment is after the first moment;
    计算每个所述第三物理机的第七负载与所述待迁移虚拟机的负载的和,得到多个目标负载;Calculating the sum of the seventh load of each third physical machine and the load of the virtual machine to be migrated to obtain multiple target loads;
    确定所述多个目标负载中小于第六阈值的目标负载;Determining a target load less than a sixth threshold among the plurality of target loads;
    从所述第三物理机中选取所述小于第六阈值的目标负载对应的第三物理机,并确定为第四物理机;其中,所述第四物理机的数量为至少一个;Selecting the third physical machine corresponding to the target load less than the sixth threshold from the third physical machine and determining it as the fourth physical machine; wherein the number of the fourth physical machine is at least one;
    从至少一个所述第四物理机中确定所述第二物理机。The second physical machine is determined from at least one fourth physical machine.
  11. 根据权利要求10所述的方法,其中,所述从至少一个所述第四物理机中确定所述第二物理机,包括:The method of claim 10, wherein the determining the second physical machine from at least one of the fourth physical machines comprises:
    计算每个所述第四物理机的第七负载减去每个所述第四物理机的第六负载的值,得到每个所述第四物理机的资源需求伸缩量;Calculating the value of the seventh load of each fourth physical machine minus the value of the sixth load of each fourth physical machine to obtain the resource demand expansion and contraction amount of each fourth physical machine;
    计算每个所述第四物理机的资源总量减去每个所述第四物理机的第六负载的值,得到每个所述第四物理机的未分配资源量;Calculating the value of the total resources of each fourth physical machine minus the value of the sixth load of each fourth physical machine to obtain the amount of unallocated resources of each fourth physical machine;
    计算每个所述第四物理机的未分配资源量减去每个所述第四物理机的资源需求伸缩量的值,得到每个所述第四物理机的预测剩余资源量;Calculating the value of the unallocated resources of each fourth physical machine minus the amount of resource demand expansion and contraction of each fourth physical machine to obtain the predicted remaining resource amount of each fourth physical machine;
    根据每个所述第四物理机的预测剩余资源量,从所述第四物理机中确定所述第二物理机。The second physical machine is determined from the fourth physical machine according to the predicted remaining resource amount of each of the fourth physical machine.
  12. 根据权利要求11所述的方法,其中,所述根据所述第四物理机的预测剩余资源量从所述第四物理机中确定所述第二物理机,包括:The method according to claim 11, wherein the determining the second physical machine from the fourth physical machine according to the predicted remaining resource amount of the fourth physical machine comprises:
    确定所述第四物理机的预测剩余资源量中的最大值对应的第四物理机为所述第二物理机。It is determined that the fourth physical machine corresponding to the maximum value in the predicted remaining resource amount of the fourth physical machine is the second physical machine.
  13. 根据权利要求1所述的方法,其中,在所述云计算管理平台的物理机上建立有虚拟机集群,所述待迁移虚拟机的数量为至少两个,所述待迁移虚拟机的数量和所述第二物理机的数量相同;所述将所述待迁移虚拟机迁移至所述第二物理机之前,所述方法还包括:The method according to claim 1, wherein a virtual machine cluster is established on a physical machine of the cloud computing management platform, the number of the virtual machines to be migrated is at least two, and the number and the number of the virtual machines to be migrated are The number of the second physical machines is the same; before migrating the virtual machine to be migrated to the second physical machine, the method further includes:
    获取每个所述待迁移虚拟机的负载;Obtaining the load of each of the virtual machines to be migrated;
    从多个第二物理机中确定每个所述待迁移虚拟机对应的目标物理机;其中,所述多个第二物理机包括所述目标物理机;Determining a target physical machine corresponding to each virtual machine to be migrated from a plurality of second physical machines; wherein the plurality of second physical machines include the target physical machine;
    获取多个所述目标物理机的负载;Acquiring loads of multiple of the target physical machines;
    根据每个所述待迁移虚拟机的负载和每个所述目标物理机的负载,对多个目标物理机进行排序,得到优先级队列。According to the load of each of the virtual machines to be migrated and the load of each of the target physical machines, sort the multiple target physical machines to obtain a priority queue.
  14. 根据权利要求13所述的方法,其中,所述根据每个所述待迁移虚拟机的负载和每个所述目标物理机的负载,对多个第二物理机进行排序,得到优先级队列,包括:The method according to claim 13, wherein, according to the load of each of the virtual machines to be migrated and the load of each of the target physical machines, sorting the plurality of second physical machines to obtain a priority queue, include:
    计算每个所述待迁移虚拟机的负载以及与每个所述待迁移虚拟机对应的目标物理机的负载的和,得到传输负载;Calculating the sum of the load of each virtual machine to be migrated and the load of the target physical machine corresponding to each virtual machine to be migrated to obtain a transmission load;
    根据所述传输负载对多个目标物理机进行排序,得到优先级队列。Sort multiple target physical machines according to the transmission load to obtain a priority queue.
  15. 根据权利要求14所述的方法,其中,所述将所述待迁移虚拟机迁移至所述第二物理机,包括:The method according to claim 14, wherein the migrating the virtual machine to be migrated to the second physical machine comprises:
    根据所述优先级队列确定每一所述目标物理机的优先级;Determine the priority of each of the target physical machines according to the priority queue;
    按照优先级由高到低的顺序,对每个所述目标物理机对应的待迁移虚拟机进行镜像传输;其中,所述优先级高的目标物理机对应的传输负载小于所述优先级低的目标物理机对应的传输负载。Mirroring the virtual machines to be migrated corresponding to each of the target physical machines in order of high priority to low priority; wherein the transmission load corresponding to the target physical machine with high priority is less than that with low priority The transmission load corresponding to the target physical machine.
  16. 一种云计算管理平台,所述云计算管理平台包括:A cloud computing management platform. The cloud computing management platform includes:
    存储器,用于存储可执行指令;Memory, used to store executable instructions;
    处理器,用于执行所述存储器中存储的可执行指令,实现如权利要求1至15中任一项所述的虚拟机迁移方法。A processor, configured to execute executable instructions stored in the memory, to implement the virtual machine migration method according to any one of claims 1 to 15.
  17. 一种存储介质,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如权利要求1至15中任一项所述的虚拟机迁移方法的步骤。A storage medium storing one or more programs, the one or more programs may be executed by one or more processors, so as to realize the virtual according to any one of claims 1 to 15. Steps of the machine migration method.
PCT/CN2019/110999 2018-12-28 2019-10-14 Virtual machine migration method, cloud computing management platform, and storage medium WO2020134364A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811628466.0A CN111381928B (en) 2018-12-28 2018-12-28 Virtual machine migration method, cloud computing management platform and storage medium
CN201811628466.0 2018-12-28

Publications (1)

Publication Number Publication Date
WO2020134364A1 true WO2020134364A1 (en) 2020-07-02

Family

ID=71126855

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/110999 WO2020134364A1 (en) 2018-12-28 2019-10-14 Virtual machine migration method, cloud computing management platform, and storage medium

Country Status (2)

Country Link
CN (1) CN111381928B (en)
WO (1) WO2020134364A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565431A (en) * 2020-12-08 2021-03-26 西藏宁算科技集团有限公司 Cross-region cluster migration method and device based on user access amount and electronic equipment
CN113032225B (en) * 2021-05-24 2021-08-06 上海有孚智数云创数字科技有限公司 Monitoring data processing method, device and equipment of data center and storage medium
CN114448897B (en) * 2021-12-29 2024-01-02 天翼云科技有限公司 Target migration method and device
CN115794314B (en) * 2023-01-29 2023-05-09 国网信息通信产业集团有限公司 Virtual machine migration method in cloud computing environment
CN117454856B (en) * 2023-12-22 2024-04-16 达州爱迦飞诗特科技有限公司 Medical diagnosis data editing method and system based on-line point-to-point mode

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159751A (en) * 2015-09-17 2015-12-16 河海大学常州校区 Energy-efficient virtual machine migration method in cloud data center
CN105279023A (en) * 2015-11-27 2016-01-27 浪潮(北京)电子信息产业有限公司 Virtual machine migration method and device
CN105302632A (en) * 2015-11-19 2016-02-03 国家电网公司 Cloud computing working load dynamic integration method
CN105607948A (en) * 2015-12-18 2016-05-25 国云科技股份有限公司 Virtual machine migration prediction method based on SLA
CN108563489A (en) * 2018-04-02 2018-09-21 郑州云海信息技术有限公司 A kind of virtual machine migration method and system of data center's total management system

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593133B (en) * 2009-06-29 2012-07-04 北京航空航天大学 Method and device for load balancing of resources of virtual machine
CN102096601A (en) * 2011-02-11 2011-06-15 浪潮(北京)电子信息产业有限公司 Virtual machine migration management method and system
CN103218261A (en) * 2013-03-12 2013-07-24 浙江大学 Dynamic migrating method of virtual machine based on performance prediction
US9558005B2 (en) * 2014-05-19 2017-01-31 Intel Corporation Reliable and deterministic live migration of virtual machines
CN104468734A (en) * 2014-11-18 2015-03-25 国云科技股份有限公司 Virtual cluster expanding method based on cloning
CN105607947A (en) * 2015-12-11 2016-05-25 西北工业大学 Novel cloud environment virtual machine scheduling method
JP2017211709A (en) * 2016-05-23 2017-11-30 株式会社日立ソリューションズ東日本 Virtual machine management method and virtual machine management system
CN106598733A (en) * 2016-12-08 2017-04-26 南京航空航天大学 Three-dimensional virtual resource scheduling method of cloud computing energy consumption key
CN106933650B (en) * 2017-03-03 2020-08-04 北方工业大学 Load management method and system of cloud application system
CN107273211B (en) * 2017-06-19 2020-11-27 北京格林威尔科技发展有限公司 Data processing method based on virtual machine in cloud computing environment
CN109032801B (en) * 2018-07-26 2022-02-18 郑州云海信息技术有限公司 Request scheduling method, system, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159751A (en) * 2015-09-17 2015-12-16 河海大学常州校区 Energy-efficient virtual machine migration method in cloud data center
CN105302632A (en) * 2015-11-19 2016-02-03 国家电网公司 Cloud computing working load dynamic integration method
CN105279023A (en) * 2015-11-27 2016-01-27 浪潮(北京)电子信息产业有限公司 Virtual machine migration method and device
CN105607948A (en) * 2015-12-18 2016-05-25 国云科技股份有限公司 Virtual machine migration prediction method based on SLA
CN108563489A (en) * 2018-04-02 2018-09-21 郑州云海信息技术有限公司 A kind of virtual machine migration method and system of data center's total management system

Also Published As

Publication number Publication date
CN111381928B (en) 2021-05-25
CN111381928A (en) 2020-07-07

Similar Documents

Publication Publication Date Title
JP7138126B2 (en) Timeliness resource migration to optimize resource placement
US11165667B2 (en) Dynamic scaling of storage volumes for storage client file systems
WO2020134364A1 (en) Virtual machine migration method, cloud computing management platform, and storage medium
US9635101B2 (en) Proposed storage system solution selection for service level objective management
US10193819B2 (en) Adaptive throttling for shared resources
US11290360B2 (en) Analyzing resource placement fragmentation for capacity planning
CN103595780B (en) Cloud computing resource scheduling method based on the weight that disappears
CN103139302A (en) Real-time copy scheduling method considering load balancing
CN110515539A (en) Cloud disk hanging method, device, equipment and storage medium based on cloud storage
US10505862B1 (en) Optimizing for infrastructure diversity constraints in resource placement
US10972555B2 (en) Function based dynamic traffic management for network services
US10616134B1 (en) Prioritizing resource hosts for resource placement
JP2012069056A (en) Cloud service relocation system and method, and program
CN103077197A (en) Data storing method and device
US10983873B1 (en) Prioritizing electronic backup
Limam et al. Data replication strategy with satisfaction of availability, performance and tenant budget requirements
US10594620B1 (en) Bit vector analysis for resource placement in a distributed system
US10812408B1 (en) Preventing concentrated selection of resource hosts for placing resources
US11336519B1 (en) Evaluating placement configurations for distributed resource placement
US11121981B1 (en) Optimistically granting permission to host computing resources
US10721181B1 (en) Network locality-based throttling for automated resource migration
US11381468B1 (en) Identifying correlated resource behaviors for resource allocation
Hassannezhad Najjari et al. A systematic overview of live virtual machine migration methods
Li et al. A service performance based dynamic provisioning approach in containerized cloud environments
Xie et al. A Utility-Based Fault Handling Approach for Efficient Job Rescue in Clouds

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19902683

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 12.11.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19902683

Country of ref document: EP

Kind code of ref document: A1