CN107562512B - Method, device and system for migrating virtual machine - Google Patents

Method, device and system for migrating virtual machine Download PDF

Info

Publication number
CN107562512B
CN107562512B CN201610519099.5A CN201610519099A CN107562512B CN 107562512 B CN107562512 B CN 107562512B CN 201610519099 A CN201610519099 A CN 201610519099A CN 107562512 B CN107562512 B CN 107562512B
Authority
CN
China
Prior art keywords
load
virtual machine
target
moment
determining
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201610519099.5A
Other languages
Chinese (zh)
Other versions
CN107562512A (en
Inventor
李昕杰
周建华
舒曦辉
祝斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201610519099.5A priority Critical patent/CN107562512B/en
Publication of CN107562512A publication Critical patent/CN107562512A/en
Application granted granted Critical
Publication of CN107562512B publication Critical patent/CN107562512B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a method, a device and a system for migrating a virtual machine, which relate to the technical field of communication and can solve the problem of excessive resource consumption in migration, thereby effectively reducing resource waste. The method of the embodiment of the invention comprises the following steps: acquiring the historical load of each virtual machine; determining the load change degree of each virtual machine according to the discrete condition of the historical load; determining the virtual machine with the load change degree within a threshold interval as a target virtual machine; determining a target predicted load of the target virtual machine according to the change trend of the historical load of the target virtual machine; according to the target predicted load and the actual residual capacity of each physical server, determining the physical server of which the actual residual capacity is greater than or equal to the target predicted load as a target physical server; and migrating the target virtual machine to the target physical server. The method and the device are suitable for the process of migrating the virtual machine.

Description

Method, device and system for migrating virtual machine
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, and a system for migrating a virtual machine.
Background
With the development of communication technology, especially the popularization of cloud computing virtualization technology, physical resources of the same physical server are shared by a plurality of service systems by virtualizing the physical resources into virtual resources, that is, by arranging a plurality of virtual machines on the physical server, so that the utilization rate of the physical resources is improved.
At present, in order to avoid the waste of physical resources, all virtual machines on a physical server with a load smaller than a certain threshold value in the physical server may be migrated to other physical servers, and the physical server of the migrated virtual machine may be in a dormant state or a shutdown state. However, since the size of the traffic affects the use of the physical resources, and the size of the traffic changes with time, the above method requires frequent migration of the virtual machine to ensure that the physical resources are fully utilized. However, when the virtual machine is frequently migrated, too many migration resources are often consumed, which also causes a certain waste of resources.
Disclosure of Invention
The embodiment of the invention provides a method, a device and a system for migrating a virtual machine, which can solve the problem of excessive resource consumption in migration, thereby effectively reducing resource waste.
In order to achieve the purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a method for migrating a virtual machine, where the method includes: acquiring historical load of each virtual machine, wherein the historical load is the load of each sampling point of the virtual machine in a first time period, and the first time period is a time period taking the current moment as a cut-off moment; determining the load change degree of each virtual machine according to the discrete condition of the historical load, wherein the load change degree is used for representing the intensity degree of the load change of the virtual machine in the first time period; determining a virtual machine with the load change degree within a threshold interval as a target virtual machine, wherein the threshold interval is used for distinguishing a virtual machine suitable for fixed deployment from a virtual machine suitable for non-fixed deployment, and the virtual machine suitable for non-fixed deployment is positioned within the threshold interval; determining a target predicted load of the target virtual machine according to a change trend of the historical load of the target virtual machine, wherein the target predicted load is used for representing an average predicted load of the virtual machine in a second time period, and the second time period is a time period taking the current time as a starting time; according to the target predicted load and the actual residual capacity of each physical server, determining the physical server of which the actual residual capacity is greater than or equal to the target predicted load as a target physical server; and migrating the target virtual machine to the target physical server.
To avoid frequent migration of virtual machines, a target virtual machine may be determined and then assigned to a target physical server according to a target predicted load. The physical server which can be used as the target physical server is determined by considering the load change trend of the target virtual machine in a future period of time, and then the target virtual machine is migrated to the target physical server, so that the possibility of frequent migration of the target virtual machine is reduced, the problem of excessive migration resource consumption is solved, and the resource waste is effectively reduced.
In a possible design, the first time period includes at least one period, and the determining the load variation degree of each virtual machine according to the discrete condition of the historical load may specifically include: determining an average load of each virtual machine according to the historical load, wherein the average load comprises an average actual load of each period in the at least one period; determining an average load standard deviation of each virtual machine according to the historical load and the average load of each virtual machine, wherein the average load standard deviation is an average value of the load standard deviations of each period; determining the average load standard deviation as the load change degree.
Considering that the average load standard deviation can effectively reflect the load change degree of the virtual machines, the method can be adopted to determine the average load standard deviation of each virtual machine in the invention, so as to determine the load change degree of the virtual machine in the first time period.
In one possible design, the second time period has N times, where the N times include a 1 st time to an nth time, where N is a positive integer greater than 1, and the determining the target predicted load of the target virtual machine according to the change trend of the historical load of the target virtual machine includes: determining the average load variation trend of each sampling point according to the historical load, wherein the average load variation trend is the average value of the load variation trends of the sampling points at the same moment in each period; respectively determining the predicted load of the target virtual machine from the 1 st moment to the N (N) th moment, wherein the predicted load of the 1 st moment is the product of the actual load of the target virtual machine at the current moment and the average load variation trend of the sampling point corresponding to the current moment, the 1 st moment is the position of the sampling point at the next moment after the current moment and adjacent to the sampling point at the current moment, the predicted load of the N (N) th moment is the product of the predicted load at the N-1 th moment and the average load variation trend of the sampling point corresponding to the N-1 th moment, and the N (N) th moment is the position of the sampling point at the next moment after the N-1 th moment and adjacent to the sampling point at the N-1 th moment; and determining the average value of the predicted loads from the 1 st moment to the Nth moment as the target predicted load of the target virtual machine.
The invention provides a specific implementation mode for determining the target predicted load of the target virtual machines, which can obtain the predicted load of each target virtual machine from the 1 st moment to the Nth moment through calculation, then relatively accurately estimate the target predicted load of the target virtual machines, and finish the migration process of the target virtual machines by taking the target predicted load as the basis.
In one possible design, the determining, according to the target predicted load and the actual remaining capacity of each physical server, that the physical server whose actual remaining capacity is greater than or equal to the target predicted load is a target physical server includes: determining the allocable capacity of each physical server according to the actual residual capacity of each physical server, wherein the allocable capacity of the same physical server is smaller than the actual residual capacity; and sequentially determining the target physical servers corresponding to each target virtual machine according to the sequence of the target predicted load of each target virtual machine from large to small, wherein the target physical servers are the physical servers with the smallest allocable capacity in the physical servers with the allocable capacity larger than or equal to the target predicted load of the allocated target virtual machine.
The target virtual machines are placed in sequence from large to small in the migration process, and meanwhile in the placement process, the target physical server needs to meet the requirement that the target physical server is the physical server with the minimum allocable capacity in the physical servers with the allocable capacity larger than or equal to the predicted load of the allocated target virtual machines, so that the situation that a target virtual machine with a small load is preferentially placed in a physical server with a large allocable capacity, and a physical server with enough allocable capacity does not exist in the process of placing the target virtual machine with a large load, so that a new physical server needs to be started for the target virtual machine, and meanwhile, the waste of physical resources of the occupied physical server is caused is avoided. Therefore, the probability of causing waste of physical resources is further reduced.
In one possible design, after the determining that the virtual machine with the load variation degree within the threshold interval is the target virtual machine, the method includes: and migrating all the virtual machines on the physical server with the load of the physical server being less than the threshold value to other physical servers according to the loads of the physical servers of other virtual machines except the target virtual machine, wherein the other virtual machines are the virtual machines with the load change degree being not within the threshold value interval.
For other virtual machines with load variation degrees not within the threshold interval, the virtual machine placement scheme described in the background art may be adopted to place the virtual machines, so as to ensure that all the virtual machines can complete the virtual machine placement operation according to the placement scheme suitable for themselves, or complete the virtual machine migration operation according to the migration scheme suitable for themselves.
In a second aspect, an embodiment of the present invention provides an apparatus for migrating a virtual machine, where the apparatus includes: the acquisition module is used for acquiring the historical load of each virtual machine, wherein the historical load is the load of each sampling point of the virtual machine in a first time period, and the first time period is a time period taking the current time as a cut-off time; a determining module, configured to determine a load change degree of each virtual machine according to the discrete condition of the historical load acquired by the acquiring module, where the load change degree is used to indicate a severity degree of load change of the virtual machine in the first time period; the determining module is further configured to determine that the virtual machine with the load change degree within a threshold interval is a target virtual machine, where the threshold interval is used to distinguish a virtual machine suitable for fixed deployment from a virtual machine suitable for non-fixed deployment, and a virtual machine suitable for non-fixed deployment is located within the threshold interval; the determining module is further configured to determine a target predicted load of the target virtual machine according to a change trend of a historical load of the target virtual machine, where the target predicted load is used to represent an average predicted load of the virtual machine in a second time period, and the second time period is a time period in which the current time is used as a starting time; the determining module is further configured to determine, according to the target predicted load obtained by the obtaining module and the actual remaining capacity of each physical server, that the physical server of which the actual remaining capacity is greater than or equal to the target predicted load is a target physical server; and the migration module is used for migrating the target virtual machine to the target physical server determined by the determination module.
In one possible design, the first time period includes at least one period, and the determining module is specifically configured to: determining an average load of each virtual machine according to the historical load, wherein the average load comprises an average actual load of each period in the at least one period; determining an average load standard deviation of each virtual machine according to the historical load and the average load of each virtual machine, wherein the average load standard deviation is an average value of the load standard deviations of each period; determining the average load standard deviation as the load change degree.
In one possible design, the second time period has N times, where the N times include a 1 st time to an nth time, where N is a positive integer greater than 1, and the determining module is specifically configured to: determining the average load variation trend of each sampling point according to the historical load, wherein the average load variation trend is the average value of the load variation trends of the sampling points at the same moment in each period; respectively determining the predicted load of the target virtual machine from the 1 st moment to the N (N) th moment, wherein the predicted load of the 1 st moment is the product of the actual load of the target virtual machine at the current moment and the average load variation trend of the sampling point corresponding to the current moment, the 1 st moment is the position of the sampling point at the next moment after the current moment and adjacent to the sampling point at the current moment, the predicted load of the N (N) th moment is the product of the predicted load at the N-1 th moment and the average load variation trend of the sampling point corresponding to the N-1 th moment, and the N (N) th moment is the position of the sampling point at the next moment after the N-1 th moment and adjacent to the sampling point at the N-1 th moment; and determining the average value of the predicted loads from the 1 st moment to the Nth moment as the target predicted load of the target virtual machine.
In one possible design, the determining module is specifically configured to: determining the allocable capacity of each physical server according to the actual residual capacity of each physical server, wherein the allocable capacity of the same physical server is smaller than the actual residual capacity; and sequentially determining the target physical servers corresponding to each target virtual machine according to the sequence of the target predicted load of each target virtual machine from large to small, wherein the target physical servers are the physical servers with the smallest allocable capacity in the physical servers with the allocable capacity larger than or equal to the target predicted load of the allocated target virtual machine.
In one possible design, the migration module is further configured to migrate, according to loads of physical servers where other virtual machines except the target virtual machine are located, all the virtual machines on the physical server where the load of the physical server is smaller than the threshold value to other physical servers, where the other virtual machines are virtual machines whose load change degree is not within the threshold value interval.
In a third aspect, an embodiment of the present invention provides a storage medium for storing computer software instructions for the apparatus for migrating a virtual machine, which includes a program designed to execute the above aspects.
In a fourth aspect, an embodiment of the present invention provides a network system, where the network system includes a virtual machine, a physical server, and a virtual energy-saving scheduler, where the virtual energy-saving scheduler includes at least the apparatus described in the second aspect.
According to the method, the device and the system for migrating the virtual machines, the load change degree of each virtual machine is determined according to the obtained discrete degree of the historical load of each virtual machine, then the virtual machine with the load change degree within the threshold value interval is determined as the target virtual machine, the target prediction load of the target virtual machine is determined according to the change trend of the historical load of the target virtual machine, the physical server with the actual residual capacity larger than or equal to the target prediction load is determined as the target physical server according to the actual residual capacity of each physical server, and then the target virtual machine is migrated to the target physical server. The historical load is the load of each sampling point of the virtual machine in a first time period, the load change degree is used for representing the intensity of load change of the virtual machine in the first time period, the first time period is a period of time taking the current moment as a cut-off moment, the target predicted load is used for representing the average predicted load of the virtual machine in a second time period, and the second time period is a period of time taking the current moment as a start moment. Compared with the prior art that the virtual machines are frequently migrated due to the change of the traffic, the method and the system for allocating the target virtual machines to the target physical server can avoid the frequent migration of the virtual machines by determining the target virtual machines and then allocating the target virtual machines to the target physical server according to the target predicted load. The physical server which can be used as the target physical server is determined by considering the load change trend of the target virtual machine in a future period of time, and then the target virtual machine is migrated to the target physical server, so that the possibility of frequent migration of the target virtual machine is reduced, the problem of excessive migration resource consumption is solved, and the resource waste is effectively reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a network system according to an embodiment of the present invention;
fig. 2 is a schematic view illustrating load changes of a virtual machine according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating load changes of another virtual machine according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating load changes of another virtual machine according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for migrating a virtual machine according to an embodiment of the present invention;
fig. 6 is a flowchart of another method for migrating a virtual machine according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of sampling points of a virtual machine load in one period according to an embodiment of the present invention;
fig. 8 is a flowchart of another method for migrating a virtual machine according to an embodiment of the present invention;
FIG. 9 is a schematic diagram illustrating load changes of a virtual machine during a period according to an embodiment of the present invention;
fig. 10 is a schematic diagram of load changes of virtual machines at adjacent time points according to an embodiment of the present invention;
fig. 11 is a schematic diagram illustrating a predicted load change of a virtual machine according to an embodiment of the present invention;
fig. 12 is a flowchart of another method for migrating a virtual machine according to an embodiment of the present invention;
fig. 13 is a schematic diagram of virtual machine placement by using a BFD binning algorithm according to an embodiment of the present invention;
fig. 14 is a flowchart of another method for migrating a virtual machine according to an embodiment of the present invention;
fig. 15 is a schematic structural diagram of an apparatus for migrating a virtual machine according to an embodiment of the present invention;
fig. 16 is a schematic structural diagram of a virtual energy-saving scheduler according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention can be used for a network system, and the network system can comprise a virtual machine, a physical server and a virtual machine energy-saving scheduler. As shown in fig. 1, in the network system, a virtual machines, B physical servers, and a virtual machine energy-saving scheduler may be included. Wherein A and B are both positive integers greater than 1. In the embodiment of the present invention, the virtual machine energy saving scheduler may be a device, a software module, or a software function. The virtual machine energy-saving scheduler can self-learn the load change condition of each virtual machine in a plurality of historical periods, classify the virtual machines according to the load change condition, and then finish the migration or deployment of the virtual machines according to the classified classes. In the embodiment of the present invention, the Network system may specifically be an NFV system, and the NFV (Network Function Virtualization, chinese) system may include a virtual machine energy saving scheduler and an NFV architecture. The virtual machine energy-saving scheduler communicates with a virtualization layer arranged in the NFVI in the NFV architecture to determine a deployment mode of a virtual machine on a physical server, and places or migrates the virtual machine into the physical server. In the NFV architecture, VNF may be included in addition to NFVI (Network function virtualization architecture, chinese). C business software may be included in the VNF, and each business software may be deployed on at least one virtual machine. Wherein C is a positive integer greater than or equal to 1. It should be noted that the category of the virtual machine may be specifically classified into three categories, that is, the load change degree is smaller than the first threshold, the load change degree is within a threshold interval formed by the first threshold and the second threshold, and the load change degree is greater than the second threshold. The first threshold is smaller than the second threshold, the first threshold is a lower limit of a threshold interval, the second threshold is an upper limit of the threshold interval, and the first threshold and the second threshold can be preset by a worker according to the influence of the load change condition of the virtual machine on the load change degree and are used for distinguishing whether the virtual machine is suitable for adopting a fixed deployment scheme or a non-fixed deployment scheme, namely a migration scheme.
It should be noted that, as shown in fig. 2, the load change degree of the virtual machine is smaller than the first threshold, that is, the load is basically unchanged, or the load is changed, but the change is relatively moderate, and the virtual machine is not suitable for virtual machine migration, so that a fixed deployment scheme is adopted, that is, the virtual machine is deployed on a fixed target physical server, and the virtual machine is not migrated in the virtual machine migration process after the deployment of the virtual machine is completed; as shown in fig. 3, the load change degree of the virtual machine is within a threshold interval formed by a first threshold and a second threshold, that is, the load is changed, and the change period is longer, which is generally greater than the time consumed by the virtual machine in the migration process, and is suitable for virtual machine migration, therefore, a non-fixed deployment scheme is adopted, that is, after the virtual machine is migrated to the target physical server, the virtual machine is migrated next time every certain time, but since the virtual machine completes the migration process according to the target predicted load, the virtual machine does not need to be migrated frequently; as shown in fig. 4, the load variation degree of the virtual machine is greater than the second threshold, that is, the load variation is large, and the virtual machine frequently oscillates in a short time, that is, the load variation is severe, and due to the instability of the virtual machine, a fixed deployment scheme is also adopted.
An embodiment of the present invention provides a method for migrating a virtual machine, as shown in fig. 5, where the method is executed by a virtual machine energy-saving scheduler, and the method includes:
101. and acquiring the historical load of each virtual machine.
The historical load is the load of each sampling point of the virtual machine in a first time period, and the first time period is a time period taking the current time as a cut-off time. That is, the first time period is a continuous historical time period before the current time, and the load of the virtual machine which can be acquired in the historical time period can be used as a basis for predicting the target predicted load of the virtual machine.
102. And determining the load change degree of each virtual machine according to the discrete condition of the historical load.
The load change degree is used for representing the intensity degree of the load change of the virtual machine in the first time period.
103. And determining the virtual machine with the load change degree within the threshold interval as the target virtual machine.
The threshold interval is used for distinguishing a virtual machine suitable for fixed deployment from a virtual machine suitable for non-fixed deployment, and the virtual machine suitable for non-fixed deployment is located in the threshold interval.
104. And determining the target predicted load of the target virtual machine according to the change trend of the historical load of the target virtual machine. The target predicted load is used for representing the average predicted load of the virtual machine in a second time period, and the second time period is a time period taking the current time as the starting time. That is, the second period of time is a continuous period of time after the current time, and in the present invention, the target predicted load of the second period of time may be determined according to the load of the virtual machine in the continuous historical period of time mentioned in the above step 101.
105. And determining the physical server with the actual residual capacity larger than or equal to the target predicted load as the target physical server according to the target predicted load and the actual residual capacity of each physical server.
106. And migrating the target virtual machine to the target physical server.
In the embodiment of the present invention, for a virtual machine whose value of the load change degree is within the threshold interval, migration of a target virtual machine needs to be performed according to a non-fixed deployment scheme, and for a virtual machine whose value of the load change degree is not within the threshold interval, a fixed deployment scheme is needed, that is, the position of a physical server where the current virtual machine is located is reserved, and migration of the virtual machine is not performed. Because the value of the load change degree of the virtual machine is not in the threshold interval, that is, the load change degree of the virtual machine is smaller than the first threshold or larger than the second threshold, the migration of the virtual machine is not required to be completed according to the target predicted loads of all sampling points of the virtual machine in a certain time adjacent to the current moment, and the actual residual capacity of the physical server where the virtual machine is located is only required to be determined according to the actual load of the virtual machine at the current moment, so that in the subsequent migration process of the target virtual machine, whether the target virtual machine and the virtual machine which does not need to be migrated can be placed on the same physical server can be determined.
According to the method for migrating the virtual machines, the load change degree of each virtual machine is determined according to the obtained discrete degree of the historical load of each virtual machine, then the virtual machine with the load change degree within the threshold value interval is determined as the target virtual machine, the target prediction load of the target virtual machine is determined according to the change trend of the historical load of the target virtual machine, the physical server with the actual residual capacity larger than or equal to the target prediction load is determined as the target physical server according to the actual residual capacity of each physical server, and then the target virtual machine is migrated to the target physical server. The historical load is the load of each sampling point of the virtual machine in a first time period, the load change degree is used for representing the intensity of load change of the virtual machine in the first time period, the first time period is a period of time taking the current moment as a cut-off moment, the target predicted load is used for representing the average predicted load of the virtual machine in a second time period, and the second time period is a period of time taking the current moment as a start moment. Compared with the prior art that the virtual machines are frequently migrated due to the change of the traffic, the method and the system for allocating the target virtual machines to the target physical server can avoid the frequent migration of the virtual machines by determining the target virtual machines and then allocating the target virtual machines to the target physical server according to the target predicted load. The physical server which can be used as the target physical server is determined by considering the load change trend of the target virtual machine in a future period of time, and then the target virtual machine is migrated to the target physical server, so that the possibility of frequent migration of the target virtual machine is reduced, the problem of excessive migration resource consumption is solved, and the resource waste is effectively reduced.
In order to more accurately determine the load variation degree of each virtual machine, in one implementation manner of the embodiment of the present invention, the first time period includes at least one period, and the virtual machine energy saving scheduler may determine the load variation degree of each virtual machine by determining an average load standard deviation of each virtual machine. Therefore, on the basis of the implementation shown in fig. 5, the implementation shown in fig. 6 can also be realized. Step 102 determines the load change degree of each virtual machine according to the discrete condition of the historical load, which may be specifically implemented as steps 1021 to 1023:
1021. and determining the average load of each virtual machine according to the historical load.
Wherein the average load comprises an average actual load for each of the at least one cycle.
1022. And determining the standard deviation of the average load of each virtual machine according to the historical load and the average load of each virtual machine.
Wherein the average load standard deviation is the average of the load standard deviations of each period.
1023. The average load standard deviation is determined as the degree of load variation.
In order to accurately determine the average load standard deviation of each virtual machine in the first time period, in the embodiment of the present invention, the average load may be determined according to the obtained historical load, then the load standard deviation of each virtual machine may be determined according to the historical load and the average load, and then the average value is taken to obtain the average load standard deviation.
FIG. 7 is a graph showing the variation of the actual load of a virtual machine in a period, in which black solid circles are sampling points based on the same time interval and are used as reference points at tnThe actual load of the virtual machine corresponding to the sampling point taken at any moment is lnIf there are N sampling points in a period, the average value of the N sampling points is
Figure BDA0001038770580000101
The load norm of N sampling points in one periodThe difference is
Figure BDA0001038770580000102
Wherein, S is the load standard deviation of the virtual machine in the period. And then, calculating to obtain the load standard deviation of the virtual machine in each period within the preset time, and averaging to obtain the average load standard deviation of the virtual machine. Similarly, the average load standard deviation of each virtual machine is obtained by adopting the method.
According to the method for migrating the virtual machines, the average load is obtained through calculation according to the acquired historical load of each virtual machine in the first time period, the load standard deviation of each virtual machine is determined according to the historical load and the average load, the average value is obtained, and therefore the load change degree of each virtual machine is determined. Compared with the prior art that the virtual machines are frequently migrated due to the change of the traffic, the method and the system for allocating the target virtual machines to the target physical server can avoid the frequent migration of the virtual machines by determining the target virtual machines and then allocating the target virtual machines to the target physical server according to the target predicted load. The physical server which can be used as the target physical server is determined by considering the load change trend of the target virtual machine in a future period of time, and then the target virtual machine is migrated to the target physical server, so that the possibility of frequent migration of the target virtual machine is reduced, the problem of excessive migration resource consumption is solved, and the resource waste is effectively reduced. Moreover, since the average load standard deviation can effectively reflect the load change degree of the virtual machine, the method of steps 1021 to 1023 is adopted to determine the average load standard deviation of each virtual machine, so that the load change degree of the virtual machine in the first time period can be more accurately determined.
In order to accurately determine the target predicted load of the target virtual machine, in an implementation manner of the embodiment of the present invention, the second time period has N times, where the N times include the 1 st time to the nth time, specifically, the predicted loads of the virtual machines at the 1 st time to the nth time may be calculated by determining an average load variation trend of the target virtual machine in the first time period, and then determining an average value of the obtained predicted loads as the target predicted load. Wherein N is a positive integer greater than 1. Therefore, on the basis of the implementation shown in fig. 6, the implementation shown in fig. 8 can also be realized. Step 104 determines the target predicted load of the target virtual machine according to the change trend of the historical load of the target virtual machine, which may be specifically implemented as steps 1041 to 1043:
1041. and determining the average load change trend of each sampling point according to the historical load.
The average load variation trend is the average value of the load variation trends of the sampling points at the same moment in each period.
In the embodiment of the invention, the load of the virtual machine is periodically changed, because the average load change trend of the sampling points at the same moment in different periods can be obtained by acquiring the load change trend of each sampling point in each period of the target virtual machine in the first time period. It should be noted that, in order to ensure that the sampling points in different periods can correspond to each other one to one, in the embodiment of the present invention, the number of the sampling points in each period is the same, and the intervals of the sampling points are the same. FIG. 9 is a schematic diagram showing the load variation of a virtual machine in a period T, wherein T is represented on the time axis represented by the abscissa0To tMRepresenting a period T within which the sample points comprise T0To tMThe M +1 sampling points, wherein M is an integer greater than 1, t0Is the starting point of T from this cycle, and is the last sampling point in the previous cycle adjacent to the cycle T. In the embodiment of the present invention, sampling may be performed every 5 minutes in a period T with one day as a period T, that is, sampling in the period T is performed at a sampling interval Δ T ═ 5, so that there are 288 sampling points in one day, that is, M ═ 288. The load for a certain sampling point m is recorded as lmI.e. tmThe load of the sampling point corresponding to the moment is lmThen can be according to the formula sm=Δl/Δt=(ln+1-ln)/(tn+1-tn)=(ln+1-ln) The load change trend s of the sampling point m is obtained by calculationm. Where Δ l is the difference between the load of the sampling point m +1 and the load of the sampling point m, and the sampling interval between the sampling point m and the sampling point m +1 is Δ t, that is, the difference between the time of the sampling point m +1 and the time of the sampling point m, as shown in fig. 10. By adopting the calculation method, 288 sampling points in a day and the load variation trend of each sampling point can be obtained, and similarly, the load variation trend of the 288 sampling points in each period in the preset time can be calculated according to the method, so that the load variation trend of the 288 sampling points in each period can be obtained.
Such as: k periods are included in the preset time, and the load change trend of the sampling point m in the k periods includes sm1To smkThen the average load variation trend of the sampling point m can be according to the formula
Figure BDA0001038770580000111
And calculating to obtain the product. Wherein the content of the first and second substances,
Figure BDA0001038770580000112
and (3) the average load variation trend of the sampling point m, i is the ith period, and i and k are integers larger than 0.
1042. And respectively determining the predicted load of the target virtual machine from the 1 st moment to the Nth moment.
The predicted load at the 1 st moment is the product of the actual load of the target virtual machine at the current moment and the average load variation trend of the sampling point corresponding to the current moment, the 1 st moment is the position of the sampling point at the next moment after the current moment and adjacent to the sampling point at the current moment, the predicted load at the Nth moment is the product of the predicted load at the N-1 th moment and the average load variation trend of the sampling point corresponding to the N-1 th moment, and the Nth moment is the position of the sampling point at the next moment after the N-1 th moment and adjacent to the sampling point at the N-1 th moment.
In the embodiment of the present invention, as shown in fig. 11, the load of the virtual machine at the current time may be l0To indicate that the predicted load of the virtual machine at time 1 may beIs 11=l0×s0Wherein s is0The average load variation trend at the current moment is taken as the average load variation trend; the predicted load of the virtual machine at time N may be lN=lN-1×sN-1Wherein s isN-1Is the average load variation trend at time N-1,/N-1The predicted load of the virtual machine at the time point N-1. Note that Δ T is used to indicate a certain time after the current time.
1043. And determining the average value of the predicted loads from the 1 st moment to the Nth moment as the target predicted load of the target virtual machine.
As shown in fig. 11, the predicted load from time 1 to time N obtained in step 1042 may be then calculated according to the formula
Figure BDA0001038770580000121
Calculating to obtain the average predicted load of the first target virtual machine
Figure BDA0001038770580000122
Where j is the jth time. In the embodiment of the present invention, it is generally recommended for the telecommunication service that a certain time Δ T be 1 hour. Since the migration process of the virtual machine generally requires 10 to 30 minutes, after the migration is completed, the migration scheme of the virtual machine can be maintained for at least 30 minutes, and the unused physical servers, i.e., the redundant physical servers, can be in a sleep state or a power-off state within the 30 minutes of the maintenance of the migration scheme. That is, the value of Δ T is not fixed, and may be determined according to the load condition of the current virtual machine, the load change rule of the virtual machine, or the migration scheme of the virtual machine, and the setting principle of Δ T is to ensure that after the migration of the virtual machine is completed, the virtual machine can still maintain a better working state before the next Δ T starts, that is, before the next Δ T starts, the full utilization of physical resources is ensured as much as possible. Therefore, the migration frequency of the virtual machine can be greatly reduced, and the waste of physical resources can be reduced. In the embodiment of the present invention, when Δ T is 1 hour, N may be 12, which may ensure that the sampling interval Δ T is 5 minutes. Due to telecommunications trafficThe early and late peaks of the volume generally last 1 to 2 hours, and therefore, the Δ T can also be set to 1.5 hours, thereby being better suited for telecommunication services. For other service types, the setting can be performed according to the existing rule of the service type, so as to select the optimal delta T. In the embodiment of the present invention, the average predicted load of the virtual machine at a certain time Δ T in the future is equivalent to the sum of the areas of each rectangular portion within the range of Δ T at a certain time as shown in fig. 11 divided by Δ T, that is, the average predicted load of the virtual machine at a certain time Δ T in the future is equal to the sum of the areas of each rectangular portion within the range of Δ T
Figure BDA0001038770580000131
In the embodiment of the invention, the smaller the setting of the delta T is, the more frequent the migration process of the first target virtual machine is likely to be, the more accurate the obtained average predicted load is, and the waste of physical resources caused by inaccurate average predicted load is avoided; the larger the Δ T setting, the fewer the number of times the migration of the target virtual machine is performed, and the less migration resources are occupied. It should be noted that the smaller Δ T setting does not necessarily mean that the migration process is frequent, and the placement scheme of the virtual machine at the current time may still remain the placement scheme of the virtual machine at the previous time due to the smaller average predicted load difference between the start times of the two adjacent migration processes. That is, after the interval Δ T, the placement scheme of the virtual machines is the same, meaning that no further migration of the target virtual machine is required. Moreover, since the change cycle of the load of the target virtual machine is long, when the Δ T is set to be large, there may be a small average predicted load difference between the start times of two adjacent migration processes, so that it is not necessary to migrate the target virtual machine again. It should be noted that, for telecommunication services, the value of Δ T is usually 15 minutes, so as to ensure that the migration number of the target virtual machine is minimum.
According to the method for migrating the virtual machine, the average load change trend of each sampling point is determined according to the historical load, then the predicted loads of the target virtual machine from the 1 st moment to the Nth moment are respectively determined, and the average value of the predicted loads from the 1 st moment to the Nth moment is determined as the target predicted load of the target virtual machine. Compared with the prior art that the virtual machines are frequently migrated due to the change of the traffic, the method and the system determine the physical server which can be used as the target physical server by considering the load change trend of the target virtual machine in a period of time in the future, and then migrate the target virtual machine to the target physical server, so that the possibility of frequent migration of the target virtual machine is reduced, the problem of excessive migration resource consumption is solved, and the resource waste is effectively reduced. In addition, an implementation manner is provided, which is specifically used for determining the target predicted load of the target virtual machines, and the predicted load of each target virtual machine from the 1 st time to the nth time can be obtained through calculation, then the target predicted load of the target virtual machine is relatively accurately evaluated, and the migration process of the target virtual machine is completed based on the target predicted load.
In order to ensure that the target virtual machines are reasonably distributed to each physical server and avoid the waste of physical resources, in an implementation manner of the embodiment of the present invention, migration of all the target virtual machines may be performed in sequence according to the target predicted load of each target virtual machine and the actual capacity of each physical server. Therefore, on the basis of the implementation shown in fig. 5, the implementation shown in fig. 12 can also be realized. Step 105 determines, according to the target predicted load and the actual remaining capacity of each physical server, that the physical server whose actual remaining capacity is greater than or equal to the target predicted load is the target physical server, and may specifically execute steps 1051 and 1052:
1051. and determining the allocable capacity of each physical server according to the actual residual capacity of each physical server.
Wherein the allocable capacity of the same physical server is smaller than the actual remaining capacity.
Since the target virtual machine completes the migration process according to the target predicted load, and the target predicted load is only used as an average value of the predicted loads in a certain future time, that is, in the second time period, the actual load of the target virtual machine may be higher or lower than the target predicted load in the certain future time, but the difference between the actual load and the target predicted load is small. Therefore, in order to ensure that the physical server can support the operation of the virtual machine, in the process of allocating the target virtual machine, the migration of the target virtual machine cannot be completed according to the actual remaining capacity of the physical server, but a part of physical resources, namely the difference between the actual remaining capacity of the physical server and the allocable capacity, should be reserved for the virtual machine whose load may be higher than the target predicted load, so as to ensure that the target physical server can still provide enough physical resources for the virtual machine when the actual load of the target virtual machine is higher than the target predicted load within a certain time in the future after the migration of the target virtual machine is completed. In the embodiment of the present invention, the reserved resource may be set to 10% of all physical resources of the physical server, that is, all physical resources are defaulted to 90%, and the physical resource that is being occupied is removed from the 90% of the physical resources, so as to obtain the allocable capacity of the physical server. It should be noted that the reserved capacity may be set not only to be 10% of the total physical resources, but also to be higher than 10% of the total physical resources, so as to achieve a better guarantee effect, that is, to ensure that the virtual machine can be allocated to enough physical resources, for example, the reserved capacity is set to be 20% of the total physical resources, which is equivalent to removing occupied physical resources from the 80% of the physical resources, thereby obtaining the allocable capacity of the physical server. In the embodiment of the invention, the mode of setting the reserved capacity is adopted, so that the influence on the service quality of the service can be effectively reduced when the actual load of the virtual machine fluctuates instantly, or the reduction of the service quality of the service caused by the instant fluctuation of the actual load of the virtual machine can be completely avoided because the set reserved capacity is large.
1052. And sequentially determining the target physical servers corresponding to each target virtual machine according to the sequence of the target predicted load of each target virtual machine from large to small.
The target physical server is the physical server with the smallest allocable capacity in the physical servers with the allocable capacity larger than or equal to the target predicted load of the allocated target virtual machine.
FIG. 13 is a schematic diagram of a BFD (English: Best Fit last classification, Chinese: Best Fit descending) binning algorithm for virtual machine placement. In the embodiment of the present invention, 13 virtual machines need to be migrated to 9 physical servers. Wherein the target predicted load of the virtual machine and the occupied physical resources of the physical server are represented by the hatched areas. In order to ensure that the physical server can allow the load of the virtual machine to fluctuate instantaneously, in the embodiment of the invention, the allocable capacity of the physical server is determined according to the physical resources which are occupied by the physical server and 90% of all the physical resources. And migration of the target virtual machine is performed according to the target predicted load of each of the 13 virtual machines.
In the embodiment of the invention, the target predicted load of each target virtual machine can be used as the goods to be placed, and the goods queue A is obtained by sequencing according to the size of the target predicted load and the sequence from big to small; taking a good from the head of the queue A, namely the target virtual machine with the maximum target predicted load; traversing all the physical servers, namely traversing all the physical servers representing the boxes with the goods, finding one box, so that the box can not only put the goods, but also ensure that the residual space is minimum after the goods are put into the box, namely the residual physical resources are minimum, and if the box is not found, opening a new box, namely opening a new physical server; and (3) putting the goods into the box, namely migrating the target virtual machine to the physical server, and repeatedly executing the steps until all the target virtual machines in the goods queue A are migrated to the physical servers. It should be noted that the allocable capacity of a physical server is the difference between 90% of all physical resources of the physical server and occupied physical resources of the physical server.
According to the method for migrating the virtual machines, provided by the embodiment of the invention, the target physical servers corresponding to the target virtual machines are sequentially determined according to the sequence of the target predicted loads of the target virtual machines from large to small and the actual residual capacity of each physical server. Compared with the prior art that the virtual machines are frequently migrated due to the change of the traffic, the method and the system determine the physical server which can be used as the target physical server by considering the load change trend of the target virtual machine in a period of time in the future, and then migrate the target virtual machine to the target physical server, so that the possibility of frequent migration of the target virtual machine is reduced, the problem of excessive migration resource consumption is solved, and the resource waste is effectively reduced. Moreover, because the target virtual machines are placed in the order of the loads of the target virtual machines from large to small in the migration process, and meanwhile, in the placement process, the target physical server needs to meet the requirement that the target physical server is the physical server with the minimum allocable capacity in the physical servers with the allocable capacity larger than or equal to the predicted load of the allocated target virtual machines, the situation that a new physical server needs to be started for the target virtual machine due to the fact that the target virtual machine with the smaller load is preferentially placed in the physical server with the larger allocable capacity and the physical server with the sufficient allocable capacity does not exist in the process of placing the target virtual machine with the larger load is avoided, and meanwhile, the waste of the physical resources of the occupied physical server is caused. Therefore, the probability of causing waste of physical resources is further reduced.
In order to ensure that each virtual machine can have a placement scheme adapted to the degree of its own load variation, it can be implemented as shown in fig. 14 on the basis of the implementation shown in fig. 5. After step 103 is executed to determine that the virtual machine with the load change degree within the threshold interval is the target virtual machine, step 107 may also be executed:
107. and migrating all the virtual machines on the physical server of which the load of the physical server is less than the threshold value to other physical servers according to the load of the physical server of other virtual machines except the target virtual machine.
And the other virtual machines are the virtual machines of which the load change degree is not within the threshold interval.
In the embodiment of the present invention, the fixed deployment manner is similar to the virtual machine placement scheme described in the background art, and reference may be made to the virtual machine placement scheme adopted in the prior art, which is not described herein again.
According to the method for migrating the virtual machines, provided by the embodiment of the invention, for the virtual machines with the load change degree not within the threshold interval, all the virtual machines on the physical server with the load of the physical server smaller than the threshold can be migrated to other physical servers. Compared with the prior art that the virtual machines are frequently migrated due to the change of the traffic, the method and the device determine the migration scheme by considering the load change trend of the target virtual machine in a period of time in the future, and then migrate the target virtual machine according to the migration scheme, so that the possibility of frequent migration of the target virtual machine is reduced, the problem of excessive migration resource consumption is solved, and the resource waste is effectively reduced. In addition, for other virtual machines whose load change degree is not within the threshold interval, the virtual machine placement scheme described in the background art may be adopted to place the virtual machines, so as to ensure that all the virtual machines can complete the placement operation of the virtual machines according to the placement scheme suitable for themselves, or complete the migration operation of the virtual machines according to the migration scheme suitable for themselves.
An embodiment of the present invention provides an apparatus 20 for migrating a virtual machine, as shown in fig. 15, where the apparatus 20 may be disposed in a virtual machine energy-saving scheduler, and the apparatus 20 may be configured to execute the method flows shown in fig. 5, fig. 6, fig. 8, fig. 12, and fig. 14, where the apparatus 20 includes:
an obtaining module 21, configured to obtain a historical load of each virtual machine.
And a determining module 22, configured to determine a load change degree of each virtual machine according to the discrete condition of the historical load acquired by the acquiring module 21.
The determining module 22 is further configured to determine the virtual machine with the load change degree within the threshold interval as the target virtual machine.
The determining module 22 is further configured to determine a target predicted load of the target virtual machine according to a change trend of the historical load of the target virtual machine.
The determining module 22 is further configured to determine, according to the target predicted load obtained by the obtaining module 21 and the actual remaining capacity of each physical server, that the physical server whose actual remaining capacity is greater than or equal to the target predicted load is the target physical server.
And the migration module 23 is configured to migrate the target virtual machine to the target physical server determined by the determination module 22.
In an implementation manner of the embodiment of the present invention, the first time period includes at least one period, and the determining module 22 is specifically configured to:
determining the average load of each virtual machine according to the historical load; determining the standard deviation of the average load of each virtual machine according to the historical load and the average load of each virtual machine; the average load standard deviation is determined as the degree of load variation.
In an implementation manner of the embodiment of the present invention, the second time period has N times, where the N times include a 1 st time to an nth time, where N is a positive integer greater than 1, and the determining module 22 is specifically configured to:
determining the average load variation trend of each sampling point according to the historical load; respectively determining the predicted load of the target virtual machine from the 1 st moment to the Nth moment; and determining the average value of the predicted loads from the 1 st moment to the Nth moment as the target predicted load of the target virtual machine.
In an implementation manner of the embodiment of the present invention, the determining module 22 is specifically configured to:
determining the allocable capacity of each physical server according to the actual residual capacity of each physical server; and sequentially determining the target physical servers corresponding to each target virtual machine according to the sequence of the target predicted load of each target virtual machine from large to small.
In an implementation manner of the embodiment of the present invention, the migration module 23 is further configured to migrate, according to the load of the physical server where the other virtual machines except the target virtual machine are located, all the virtual machines on the physical server whose load of the physical server is smaller than the threshold value to the other physical servers.
It should be noted that, for the explanation of the terms in the device-side embodiment, and the execution sequence and the execution conditions of the functions implemented by each module, reference may be made to the description in the method-side embodiment, which is not described herein again.
According to the device for migrating the virtual machines, the load change degree of each virtual machine is determined according to the obtained discrete degree of the historical load of each virtual machine, then the virtual machine with the load change degree within the threshold value interval is determined as the target virtual machine, the target prediction load of the target virtual machine is determined according to the change trend of the historical load of the target virtual machine, the physical server with the actual residual capacity larger than or equal to the target prediction load is determined as the target physical server according to the actual residual capacity of each physical server, and then the target virtual machine is migrated to the target physical server. The historical load is the load of each sampling point of the virtual machine in a first time period, the load change degree is used for representing the intensity of load change of the virtual machine in the first time period, the first time period is a period of time taking the current moment as a cut-off moment, the target predicted load is used for representing the average predicted load of the virtual machine in a second time period, and the second time period is a period of time taking the current moment as a start moment. Compared with the prior art that the virtual machines are frequently migrated due to the change of the traffic, the method and the system for allocating the target virtual machines to the target physical server can avoid the frequent migration of the virtual machines by determining the target virtual machines and then allocating the target virtual machines to the target physical server according to the target predicted load. The physical server which can be used as the target physical server is determined by considering the load change trend of the target virtual machine in a future period of time, and then the target virtual machine is migrated to the target physical server, so that the possibility of frequent migration of the target virtual machine is reduced, the problem of excessive migration resource consumption is solved, and the resource waste is effectively reduced.
An embodiment of the present invention provides a virtual power-saving scheduler 30, as shown in fig. 16, where the virtual power-saving scheduler 30 may be configured to execute the method flows shown in fig. 5, fig. 6, fig. 8, fig. 12 and fig. 14, the virtual power-saving scheduler 30 includes a processor 31 and an interface circuit 32, and also shows a memory 33 and a bus 34, and the processor 31, the interface circuit 32 and the memory 33 are connected by the bus 34 and complete mutual communication.
It should be noted that the processor 31 may be a single processing element or may be a general term for multiple processing elements. For example, the Processing element may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention, such as: one or more microprocessors (digital signal processors, DSP for short), or one or more Field Programmable Gate arrays (FPGA for short).
The memory 33 may be a storage device or a combination of storage elements, and is used for storing executable program codes or parameters, data, etc. required by the operation of the access network management device. The memory 33 may include a Random Access Memory (RAM), or a non-volatile memory (Flash), such as a magnetic disk memory.
The bus 34 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus 34 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 16, but this is not intended to represent only one bus or type of bus.
The virtual power save scheduler 30 may also include an input/output device connected to the bus 34 to connect with other parts such as the processor 31 through the bus 34.
Wherein the processor 31 calls the program code in the memory 33 for executing the operations performed by the virtual energy-saving scheduler 30 in the above method embodiment. For example, it includes:
according to the discrete situation of the historical load of each virtual machine acquired through the interface circuit 32, the processor 31 is used for determining the load change degree of each virtual machine, the virtual machine with the load change degree within the threshold value interval is determined to be the target virtual machine through the processor 31, then the target predicted load of the target virtual machine is determined through the processor 31 according to the change trend of the historical load of the target virtual machine, and then the physical server with the actual residual capacity larger than or equal to the target predicted load is determined to be the target physical server through the processor 31 according to the target predicted load and the actual residual capacity of each physical server, and the target virtual machine is migrated to the target physical server.
In an implementation manner of the embodiment of the present invention, the first time period includes at least one cycle, and the processor 31 is specifically configured to:
determining the average load of each virtual machine according to the historical load; determining the standard deviation of the average load of each virtual machine according to the historical load and the average load of each virtual machine; the average load standard deviation is determined as the degree of load variation.
In an implementation manner of the embodiment of the present invention, the second time period has N times, where the N times include a 1 st time to an nth time, where N is a positive integer greater than 1, and the processor 31 is specifically configured to:
determining the average load variation trend of each sampling point according to the historical load; respectively determining the predicted load of the target virtual machine from the 1 st moment to the Nth moment; and determining the average value of the predicted loads from the 1 st moment to the Nth moment as the target predicted load of the target virtual machine.
In an implementation manner of the embodiment of the present invention, the processor 31 is specifically configured to:
determining the allocable capacity of each physical server according to the actual residual capacity of each physical server; and sequentially determining the target physical servers corresponding to each target virtual machine according to the sequence of the target predicted load of each target virtual machine from large to small.
In one implementation manner of the embodiment of the present invention, after determining that a virtual machine with a load change degree within a threshold interval is a target virtual machine, all virtual machines on a physical server with a load of the physical server being less than a threshold are migrated to other physical servers through the processor 31 according to loads of physical servers where other virtual machines except the target virtual machine are located.
It should be noted that, for the explanations about the nouns in the embodiment on the entity side, and the execution sequence and the execution conditions of the functions realized by each component, reference may be made to the description in the embodiment on the method side, which is not described herein again.
The virtual energy-saving scheduler provided by the embodiment of the invention determines the load change degree of each virtual machine according to the obtained discrete degree of the historical load of each virtual machine, then determines the virtual machine with the load change degree within the threshold interval as the target virtual machine, determines the target predicted load of the target virtual machine according to the change trend of the historical load of the target virtual machine, determines the physical server with the actual residual capacity greater than or equal to the target predicted load as the target physical server by combining the actual residual capacity of each physical server, and then migrates the target virtual machine to the target physical server. The historical load is the load of each sampling point of the virtual machine in a first time period, the load change degree is used for representing the intensity of load change of the virtual machine in the first time period, the first time period is a period of time taking the current moment as a cut-off moment, the target predicted load is used for representing the average predicted load of the virtual machine in a second time period, and the second time period is a period of time taking the current moment as a start moment. Compared with the prior art that the virtual machines are frequently migrated due to the change of the traffic, the method and the system for allocating the target virtual machines to the target physical server can avoid the frequent migration of the virtual machines by determining the target virtual machines and then allocating the target virtual machines to the target physical server according to the target predicted load. The physical server which can be used as the target physical server is determined by considering the load change trend of the target virtual machine in a future period of time, and then the target virtual machine is migrated to the target physical server, so that the possibility of frequent migration of the target virtual machine is reduced, the problem of excessive migration resource consumption is solved, and the resource waste is effectively reduced.
The embodiment of the invention provides a network system, which comprises a virtual machine, a physical server and a virtual energy-saving scheduler. Specifically, the virtual energy-saving scheduler may be as shown in fig. 16, and the virtual energy-saving scheduler includes the device shown in fig. 15.
According to the network system provided by the embodiment of the invention, the load change degree of each virtual machine is determined according to the obtained discrete degree of the historical load of each virtual machine, then the virtual machine with the load change degree within the threshold interval is determined as the target virtual machine, the target predicted load of the target virtual machine is determined according to the change trend of the historical load of the target virtual machine, the physical server with the actual residual capacity larger than or equal to the target predicted load is determined as the target physical server according to the actual residual capacity of each physical server, and then the target virtual machine is migrated to the target physical server. The historical load is the load of each sampling point of the virtual machine in a first time period, the load change degree is used for representing the intensity of load change of the virtual machine in the first time period, the first time period is a period of time taking the current moment as a cut-off moment, the target predicted load is used for representing the average predicted load of the virtual machine in a second time period, and the second time period is a period of time taking the current moment as a start moment. Compared with the prior art that the virtual machines are frequently migrated due to the change of the traffic, the method and the system for allocating the target virtual machines to the target physical server can avoid the frequent migration of the virtual machines by determining the target virtual machines and then allocating the target virtual machines to the target physical server according to the target predicted load. The physical server which can be used as the target physical server is determined by considering the load change trend of the target virtual machine in a future period of time, and then the target virtual machine is migrated to the target physical server, so that the possibility of frequent migration of the target virtual machine is reduced, the problem of excessive migration resource consumption is solved, and the resource waste is effectively reduced.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM) or a Random Access Memory (RAM).
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (11)

1. A method of migrating a virtual machine, the method comprising:
acquiring historical load of each virtual machine, wherein the historical load is the load of each sampling point of the virtual machine in a first time period, and the first time period is a time period taking the current moment as a cut-off moment;
determining the load change degree of each virtual machine according to the discrete condition of the historical load, wherein the load change degree is used for representing the oscillation frequency of the virtual machine in the first time period when the load number changes;
determining a virtual machine with the load change degree within a threshold interval as a target virtual machine, wherein the threshold interval is used for distinguishing a virtual machine suitable for fixed deployment from a virtual machine suitable for non-fixed deployment, and the virtual machine suitable for non-fixed deployment is positioned within the threshold interval;
determining a target predicted load of the target virtual machine according to a change trend of the historical load of the target virtual machine, wherein the target predicted load is used for representing an average predicted load of the virtual machine in a second time period, and the second time period is a time period taking the current time as a starting time;
according to the target predicted load and the actual residual capacity of each physical server, determining the physical server of which the actual residual capacity is greater than or equal to the target predicted load as a target physical server;
and migrating the target virtual machine to the target physical server.
2. The method of claim 1, wherein the first period of time comprises at least one period, and wherein determining the degree of load change of each virtual machine according to the discrete instances of the historical load comprises:
determining an average load of each virtual machine according to the historical load, wherein the average load comprises an average actual load of each period in the at least one period;
determining an average load standard deviation of each virtual machine according to the historical load and the average load of each virtual machine, wherein the average load standard deviation is an average value of the load standard deviations of each period;
determining the average load standard deviation as the load change degree.
3. The method according to claim 2, wherein the second time period has N times, the N times include 1 st time to N th time, where N is a positive integer greater than 1, and the determining the target predicted load of the target virtual machine according to the trend of the historical load of the target virtual machine includes:
determining the average load variation trend of each sampling point according to the historical load, wherein the average load variation trend is the average value of the load variation trends of the sampling points at the same moment in each period;
respectively determining the predicted load of the target virtual machine from the 1 st moment to the N (N) th moment, wherein the predicted load of the 1 st moment is the product of the actual load of the target virtual machine at the current moment and the average load variation trend of the sampling point corresponding to the current moment, the 1 st moment is the position of the sampling point at the next moment after the current moment and adjacent to the sampling point at the current moment, the predicted load of the N (N) th moment is the product of the predicted load at the N-1 th moment and the average load variation trend of the sampling point corresponding to the N-1 th moment, and the N (N) th moment is the position of the sampling point at the next moment after the N-1 th moment and adjacent to the sampling point at the N-1 th moment;
and determining the average value of the predicted loads from the 1 st moment to the Nth moment as the target predicted load of the target virtual machine.
4. The method according to any one of claims 1 to 3, wherein the determining, according to the target predicted load and the actual remaining capacity of each physical server, that the physical server with the actual remaining capacity greater than or equal to the target predicted load is the target physical server comprises:
determining the allocable capacity of each physical server according to the actual residual capacity of each physical server, wherein the allocable capacity of the same physical server is smaller than the actual residual capacity;
and sequentially determining target physical servers corresponding to each target virtual machine according to the sequence of the target predicted load of each target virtual machine from large to small, wherein the target physical servers are the physical servers with the smallest allocable capacity in the physical servers with the allocable capacity larger than or equal to the target predicted load of the allocated target virtual machine.
5. The method according to any one of claims 1 to 3, wherein after the determining that the virtual machine with the load change degree within the threshold interval is the target virtual machine, the method comprises:
and migrating all the virtual machines on the physical server with the load of the physical server being less than the threshold value to other physical servers according to the loads of the physical servers of other virtual machines except the target virtual machine, wherein the other virtual machines are the virtual machines with the load change degree being not within the threshold value interval.
6. An apparatus to migrate a virtual machine, the apparatus comprising:
the acquisition module is used for acquiring the historical load of each virtual machine, wherein the historical load is the load of each sampling point of the virtual machine in a first time period, and the first time period is a time period taking the current time as a cut-off time;
a determining module, configured to determine a load change degree of each virtual machine according to the discrete condition of the historical load acquired by the acquiring module, where the load change degree is used to indicate an oscillation frequency of a load number change of the virtual machine in the first time period;
the determining module is further configured to determine that the virtual machine with the load change degree within a threshold interval is a target virtual machine, where the threshold interval is used to distinguish a virtual machine suitable for fixed deployment from a virtual machine suitable for non-fixed deployment, and a virtual machine suitable for non-fixed deployment is located within the threshold interval;
the determining module is further configured to determine a target predicted load of the target virtual machine according to a change trend of a historical load of the target virtual machine, where the target predicted load is used to represent an average predicted load of the virtual machine in a second time period, and the second time period is a time period in which the current time is used as a starting time;
the determining module is further configured to determine, according to the target predicted load obtained by the obtaining module and the actual remaining capacity of each physical server, that the physical server of which the actual remaining capacity is greater than or equal to the target predicted load is a target physical server;
and the migration module is used for migrating the target virtual machine to the target physical server determined by the determination module.
7. The apparatus of claim 6, wherein the first time period comprises at least one period, and wherein the determining module is specifically configured to:
determining an average load of each virtual machine according to the historical load, wherein the average load comprises an average actual load of each period in the at least one period;
determining an average load standard deviation of each virtual machine according to the historical load and the average load of each virtual machine, wherein the average load standard deviation is an average value of the load standard deviations of each period;
determining the average load standard deviation as the load change degree.
8. The apparatus according to claim 7, wherein there are N times in the second time period, where the N times include a 1 st time to an nth time, where N is a positive integer greater than 1, and the determining module is specifically configured to:
determining the average load variation trend of each sampling point according to the historical load, wherein the average load variation trend is the average value of the load variation trends of the sampling points at the same moment in each period;
respectively determining the predicted load of the target virtual machine from the 1 st moment to the N (N) th moment, wherein the predicted load of the 1 st moment is the product of the actual load of the target virtual machine at the current moment and the average load variation trend of the sampling point corresponding to the current moment, the 1 st moment is the position of the sampling point at the next moment after the current moment and adjacent to the sampling point at the current moment, the predicted load of the N (N) th moment is the product of the predicted load at the N-1 th moment and the average load variation trend of the sampling point corresponding to the N-1 th moment, and the N (N) th moment is the position of the sampling point at the next moment after the N-1 th moment and adjacent to the sampling point at the N-1 th moment;
and determining the average value of the predicted loads from the 1 st moment to the Nth moment as the target predicted load of the target virtual machine.
9. The apparatus according to any one of claims 6 to 8, wherein the determining module is specifically configured to:
determining the allocable capacity of each physical server according to the actual residual capacity of each physical server, wherein the allocable capacity of the same physical server is smaller than the actual residual capacity;
and sequentially determining target physical servers corresponding to each target virtual machine according to the sequence of the target predicted load of each target virtual machine from large to small, wherein the target physical servers are the physical servers with the smallest allocable capacity in the physical servers with the allocable capacity larger than or equal to the target predicted load of the allocated target virtual machine.
10. The apparatus according to any one of claims 6 to 8, wherein the migration module is further configured to migrate, according to loads of physical servers where virtual machines other than the target virtual machine are located, all virtual machines on a physical server where the load of the physical server is smaller than a threshold to other physical servers, where the other virtual machines are virtual machines whose load change degree is not within the threshold interval.
11. A network system, characterized in that the network system comprises virtual machines, physical servers and a virtual energy-saving scheduler, the virtual energy-saving scheduler comprising at least the apparatus of any of claims 6 to 10.
CN201610519099.5A 2016-07-01 2016-07-01 Method, device and system for migrating virtual machine Active CN107562512B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610519099.5A CN107562512B (en) 2016-07-01 2016-07-01 Method, device and system for migrating virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610519099.5A CN107562512B (en) 2016-07-01 2016-07-01 Method, device and system for migrating virtual machine

Publications (2)

Publication Number Publication Date
CN107562512A CN107562512A (en) 2018-01-09
CN107562512B true CN107562512B (en) 2020-06-26

Family

ID=60970079

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610519099.5A Active CN107562512B (en) 2016-07-01 2016-07-01 Method, device and system for migrating virtual machine

Country Status (1)

Country Link
CN (1) CN107562512B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804198A (en) * 2017-04-26 2018-11-13 北京邮电大学 A kind of virtual machine (vm) migration opportunity based on utilization rate trend determines method
CN108287749A (en) * 2018-01-11 2018-07-17 郑州云海信息技术有限公司 A kind of data center's total management system cloud resource dispatching method
CN108762935A (en) * 2018-06-04 2018-11-06 郑州云海信息技术有限公司 A kind of selection method and server of destination host
CN110928634B (en) * 2018-09-19 2023-04-07 阿里巴巴集团控股有限公司 Data processing method, device and equipment
CN109271257A (en) * 2018-10-11 2019-01-25 郑州云海信息技术有限公司 A kind of method and apparatus of virtual machine (vm) migration deployment
CN109783196B (en) * 2019-01-17 2021-03-12 新华三信息安全技术有限公司 Virtual machine migration method and device
KR102062157B1 (en) * 2019-04-29 2020-01-03 오케스트로 주식회사 Vitual machine placement method and virtual machine placement device implementing the same
CN110806918A (en) * 2019-09-24 2020-02-18 梁伟 Virtual machine operation method and device based on deep learning neural network
CN111182028A (en) * 2019-11-29 2020-05-19 腾讯云计算(北京)有限责任公司 Method and apparatus for distributing instances, computer readable storage medium
CN113315945B (en) * 2021-07-29 2021-11-09 江苏怀业信息技术股份有限公司 Terminal access method of distributed video conference system
CN114448897B (en) * 2021-12-29 2024-01-02 天翼云科技有限公司 Target migration method and device
CN115904616B (en) * 2022-11-04 2023-11-10 北京天融信网络安全技术有限公司 Virtual machine hot migration method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662750A (en) * 2012-03-23 2012-09-12 上海交通大学 Virtual machine resource optimal control method and control system based on elastic virtual machine pool
CN103353853A (en) * 2013-07-26 2013-10-16 浪潮电子信息产业股份有限公司 Automatic load adjusting method
CN103576829A (en) * 2012-08-01 2014-02-12 复旦大学 Hybrid genetic algorithm based dynamic cloud-computing virtual machine scheduling method
CN103916438A (en) * 2013-01-06 2014-07-09 上海计算机软件技术开发中心 Cloud testing environment scheduling method and system based on load forecast
CN104881316A (en) * 2015-05-22 2015-09-02 中国联合网络通信集团有限公司 Virtual machine transferring method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160019084A1 (en) * 2014-07-18 2016-01-21 Eco4Cloud S.R.L. Method and system for inter-cloud virtual machines assignment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662750A (en) * 2012-03-23 2012-09-12 上海交通大学 Virtual machine resource optimal control method and control system based on elastic virtual machine pool
CN103576829A (en) * 2012-08-01 2014-02-12 复旦大学 Hybrid genetic algorithm based dynamic cloud-computing virtual machine scheduling method
CN103916438A (en) * 2013-01-06 2014-07-09 上海计算机软件技术开发中心 Cloud testing environment scheduling method and system based on load forecast
CN103353853A (en) * 2013-07-26 2013-10-16 浪潮电子信息产业股份有限公司 Automatic load adjusting method
CN104881316A (en) * 2015-05-22 2015-09-02 中国联合网络通信集团有限公司 Virtual machine transferring method and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
基于数据中心的两阶段虚拟机能效优化部署算法;张小庆 等;《计算机应用》;20141110;第34卷(第11期);参见第322-3226页 *
基于虚拟机迁移的虚拟机集群资源调度;周文煜;《华中科技大学学报自然科学版》;20110617;第36卷;参见第130-133页 *
虚拟化资源调度技术的研究;张龙;《中国优秀硕士学位论文全文数据库信息科技辑》;20150115(第1期);参见第41-45页 *

Also Published As

Publication number Publication date
CN107562512A (en) 2018-01-09

Similar Documents

Publication Publication Date Title
CN107562512B (en) Method, device and system for migrating virtual machine
EP3847549B1 (en) Minimizing impact of migrating virtual services
CN109597685B (en) Task allocation method, device and server
US7992151B2 (en) Methods and apparatuses for core allocations
EP2742426B1 (en) Network-aware coordination of virtual machine migrations in enterprise data centers and clouds
JP2021521518A (en) Virtual machine scheduling method and equipment
CN111104227B (en) Resource control method and device of K8s platform and related components
US20160378557A1 (en) Task allocation determination apparatus, control method, and program
CN109992366B (en) Task scheduling method and task scheduling device
CN104331331A (en) Resource distribution method for reconfigurable chip multiprocessor with task number and performance sensing functions
CN111506423A (en) Resource scheduling method and device, electronic equipment and storage medium
WO2020172852A1 (en) Computing resource scheduling method, scheduler, internet of things system, and computer readable medium
US9128754B2 (en) Resource starvation management in a computer system
CN113032102A (en) Resource rescheduling method, device, equipment and medium
CN103488538A (en) Application extension device and application extension method in cloud computing system
CN115658311A (en) Resource scheduling method, device, equipment and medium
US10171572B2 (en) Server pool management
CN112860387A (en) Distributed task scheduling method and device, computer equipment and storage medium
CN110825212B (en) Energy-saving scheduling method and device and computer storage medium
CN109992408B (en) Resource allocation method, device, electronic equipment and storage medium
CN111930516B (en) Load balancing method and related device
CN110728372B (en) Cluster design method and cluster system for dynamic loading of artificial intelligent model
CN110806918A (en) Virtual machine operation method and device based on deep learning neural network
CN114598705B (en) Message load balancing method, device, equipment and medium
US20230418667A1 (en) Computing device for handling tasks in a multi-core processor, and method for operating computing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant