CN106155782B - Virtual machine migration method and device - Google Patents
Virtual machine migration method and device Download PDFInfo
- Publication number
- CN106155782B CN106155782B CN201510165952.3A CN201510165952A CN106155782B CN 106155782 B CN106155782 B CN 106155782B CN 201510165952 A CN201510165952 A CN 201510165952A CN 106155782 B CN106155782 B CN 106155782B
- Authority
- CN
- China
- Prior art keywords
- physical server
- virtual machine
- virtual
- time slice
- model
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000013508 migration Methods 0.000 title claims abstract description 33
- 230000005012 migration Effects 0.000 title claims abstract description 33
- 238000004364 calculation method Methods 0.000 claims abstract description 35
- 238000006243 chemical reaction Methods 0.000 claims description 68
- 230000007704 transition Effects 0.000 claims description 34
- 238000012360 testing method Methods 0.000 claims description 26
- 230000009466 transformation Effects 0.000 claims description 5
- 238000012545 processing Methods 0.000 claims description 2
- 230000008569 process Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 4
- 239000011159 matrix material Substances 0.000 description 4
- 238000011156 evaluation Methods 0.000 description 2
- 238000005265 energy consumption Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the invention discloses a kind of virtual machine migration method and devices, it presets timeslice of the virtual machine of same virtual cpu core number when running on the physical server of different model and shares ratio transformational relation, when carrying out virtual machine (vm) migration, ratio transformational relation, which is shared, by above-mentioned timeslice determines candidate physical type of server, and second timeslice of the virtual machine to be migrated when running on the physical server of candidate physical server model shares ratio, then purpose physical server is determined, the model of purpose physical server belongs to the candidate physical server model, the CPU core calculation of purpose physical server is greater than or equal to the virtual cpu core number of the virtual machine to be migrated;By virtual machine (vm) migration to be migrated into purpose physical server, and the timeslice of virtual machine to be migrated is shared into ratio and is adjusted to the shared ratio of the second timeslice corresponding with the model of purpose physical server, reduce the difference of the practical calculated performance before and after virtual machine (vm) migration.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a virtual machine migration method and apparatus.
Background
Virtualization technology is one of the key technologies of cloud computing. The physical server is virtualized into a plurality of logical virtual machines, so that the utilization efficiency of computing resources in a cloud computing environment can be greatly improved, the energy consumption is saved, and meanwhile, the load of cloud computing services is efficiently managed and expanded due to dynamic migration and resource scheduling provided by the virtualization technology, so that the cloud computing services are more elastic and flexible.
Virtual machine migration refers to a process of migrating a virtual machine from one physical server to another physical server when resource allocation of the virtual machine needs to be adjusted between physical servers or when a certain physical server needs to be maintained.
However, because there may be performance differences between physical servers, when a virtual machine is migrated between different physical servers, there may also be differences in actual computing performance before and after the migration. Such a difference may directly affect the service application of the user running in the virtual machine, and cannot guarantee a Service Level Agreement (SLA) of the cloud computing service. Therefore, how to reduce the difference of actual computing performance before and after the virtual machine migration becomes an urgent problem to be solved.
Disclosure of Invention
The invention aims to provide a virtual machine migration method and a virtual machine migration device so as to reduce the difference of actual computing performance before and after virtual machine migration.
In order to achieve the purpose, the invention provides the following technical scheme:
a virtual machine migration method includes:
acquiring a first time slice sharing proportion of a virtual machine to be migrated on a source physical server;
determining candidate physical server models and a second time slice sharing proportion of the virtual machines to be migrated when the virtual machines to be migrated run on the physical servers of the candidate physical server models based on the first time slice sharing proportion, the model of the source physical server and a time slice sharing proportion conversion relation of the preset virtual CPU core number when the virtual machines run on the physical servers of different models, wherein the second time slice sharing proportion is less than or equal to 1;
determining a target physical server, wherein the model of the target physical server belongs to the model of the candidate physical server, and the number of CPU cores of the target physical server is greater than or equal to the number of virtual CPU cores of the virtual machine to be migrated;
and migrating the virtual machine to be migrated to the target physical server, and adjusting the time slice sharing proportion of the virtual machine to be migrated in the target physical server to a second time slice sharing proportion corresponding to the model of the target physical server.
In the above method, preferably, the time slice sharing proportion conversion relationship when the virtual machines with the same virtual CPU core number run on physical servers of different models includes:
the computing performance of a virtual machine with m virtual CPU cores when running on a physical server with j model is equivalent to that of a virtual machine with m virtual CPU cores when running on a physical server with i model according to a time slice sharing proportion of 1, wherein the virtual machine with m virtual CPU cores is locatedThe sharing proportion of the time slices required by the operation on the physical server of the model j is tij。
In the above method, preferably, the determining a candidate physical server model based on the first time slice sharing ratio, the model of the source physical server, and a time slice sharing ratio conversion relationship when the virtual machine with the preset same virtual CPU core number runs on physical servers with different models, and the second time slice sharing ratio when the virtual machine to be migrated runs on a physical server with the candidate physical server model includes:
if the first time slice sharing proportion is not 1, determining the model of a transition physical server according to the model of the source physical server, the first time slice sharing proportion and the time slice sharing proportion conversion relation of the preset virtual machines with the same virtual CPU core number when the virtual machines run on physical servers with different models; the computing performance of the virtual machine to be migrated when the physical CPU time slice of the physical server of the transition physical server model is used on the physical server of the transition physical server model with the time slice proportion of 1 is the same as the computing performance of the virtual machine to be migrated when the physical CPU time slice of the source physical server is used on the source physical server with the first time slice sharing proportion;
and determining a candidate physical server model and a second time slice sharing proportion of the virtual machine to be migrated when the virtual machine runs on the physical server of the candidate physical server model according to the transition physical server model and the time slice sharing proportion conversion relation of the preset virtual CPU core number when the virtual machine runs on the physical servers of different models, wherein the second time slice sharing proportion is less than or equal to 1.
Preferably, the method determines, through testing, a time slice sharing ratio transformation relationship when the virtual machines with the same virtual CPU core number run on physical servers of different models, and includes:
respectively operating virtual machines with m virtual CPU cores on a physical server of type i and a physical server of type j according to a time slice sharing proportion of 1;
running different types of workloads in the virtual machine with the number of the virtual CPU cores m on the physical server of the type i, and testing the virtual machine with the number of the virtual CPU cores m to obtain a first calculation performance parameter Ci of the virtual machine with the number of the virtual CPU cores m;
running the different types of workloads in the virtual machines with the number of the virtual CPU cores m on the physical servers with the type j, and testing the virtual machines with the number of the virtual CPU cores m to obtain a second computing performance parameter Cj of the virtual machines with the number of the virtual CPU cores m;
if said Ci is<Cj, adjusting the time slice sharing proportion of the physical CPU in the j type physical server which can be occupied by the virtual machine with m virtual CPU cores when the virtual machine runs on the j type physical server until the difference between Ci and Cj is in a preset range, and t isijWhen the difference between Ci and Cj is in a preset range, the virtual machine with m virtual CPU cores can occupy the time slice sharing proportion of the physical CPU in the physical server of the type j when running on the physical server of the type j;
if Ci>Cj, adjusting the time slice sharing proportion of the physical CPU in the i-type physical server which can be occupied by the virtual machine with m virtual CPU cores when the virtual machine runs on the i-type physical server until the difference between Ci and Cj is within a preset range, and t isijWhen the difference between Ci and Cj is within a preset range, the virtual machine with m virtual CPU cores can occupy the reciprocal of the time slice sharing proportion of the physical CPU in the physical server of the i model when running on the physical server of the i model;
if Ci is Cj, tij=1。
Preferably, the method determines, by calculation, a time slice sharing proportional transformation relationship when the virtual machines with the same virtual CPU core number run on physical servers of different models, and includes:
calculating a first calculation performance parameter Ci when the virtual machine with the virtual CPU core number m runs on a physical server of the type i;
calculating a second calculation performance parameter Cj of the virtual machine with the virtual CPU core number of m when the virtual machine runs on the physical server with the model j;
wherein, tij=Ci/Cj。
A virtual machine migration apparatus, the apparatus comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a first time slice sharing proportion of a virtual machine to be migrated on a source physical server;
a first determining module, configured to determine, based on the first time slice sharing ratio, the model of the source physical server, and a time slice sharing ratio conversion relationship when a preset virtual machine with the same virtual CPU core number runs on physical servers of different models, a candidate physical server model and a second time slice sharing ratio when a virtual machine to be migrated runs on a physical server of the candidate physical server model, where the second time slice sharing ratio is less than or equal to 1;
a second determining module, configured to determine a destination physical server, where a model of the destination physical server belongs to the model of the candidate physical server, and a number of CPU cores of the destination physical server is greater than or equal to a number of virtual CPU cores of the virtual machine to be migrated;
and the migration module is used for migrating the virtual machine to be migrated to the target physical server and adjusting the time slice sharing proportion of the virtual machine to be migrated in the target physical server to a second time slice sharing proportion corresponding to the model of the target physical server.
Preferably, in the apparatus, the time slice sharing ratio conversion relationship when the virtual machines with the same virtual CPU core number run on physical servers of different models includes:
the computing performance of a virtual machine with m virtual CPU cores running on a physical server of j model is equivalent to the computing performance of a virtual machine with m virtual CPU cores running on a physical server of i model with a time slice sharing proportion of 1, and the time slice sharing proportion of the virtual machine with m virtual CPU cores running on the physical server of j model is tij。
The above apparatus, preferably, the first determining module includes:
a first determining unit, configured to determine, if the first time slice sharing ratio is not 1, a model of a transition physical server according to a relationship among the model of the source physical server, the first time slice sharing ratio, and a time slice sharing ratio conversion relationship when the preset virtual machines with the same virtual CPU core number run on physical servers of different models; the computing performance of the virtual machine to be migrated when the physical CPU time slice of the physical server of the transition physical server model is used on the physical server of the transition physical server model with the time slice proportion of 1 is the same as the computing performance of the virtual machine to be migrated when the physical CPU time slice of the source physical server is used on the source physical server with the first time slice sharing proportion;
and a second determining unit, configured to determine a candidate physical server model and a second time slice sharing proportion when the virtual machine to be migrated runs on a physical server of the candidate physical server model according to the transition physical server model and a time slice sharing proportion conversion relation when the virtual machine with the preset same virtual CPU core number runs on physical servers of different models, where the second time slice sharing proportion is less than or equal to 1.
The above apparatus, preferably, the apparatus further comprises:
a first conversion relation determining module, configured to determine, through testing, a time slice sharing proportional conversion relation when the virtual machines with the same virtual CPU core number run on physical servers of different models, where the time slice sharing proportional conversion relation includes:
the first testing unit is used for testing the virtual machine with the number of the virtual CPU cores being m to obtain a first computing performance parameter Ci of the virtual machine with the number of the virtual CPU cores being m when the virtual machine with the number of the virtual CPU cores being m runs different types of workloads in the virtual machine with the number of the virtual CPU cores being m on an i-type physical server according to a time slice sharing ratio being 1;
the second testing unit is used for testing the virtual machine with the number of the virtual CPU cores m to obtain a second computing performance parameter Cj of the virtual machine with the number of the virtual CPU cores m when the virtual machine with the number of the virtual CPU cores m runs the different types of workloads in the virtual machine with the number of the virtual CPU cores m on the physical server with the j model according to the time slice sharing proportion of 1;
a third determining unit for determining if Ci is greater than<Cj, adjusting the time slice sharing proportion of the physical CPU in the j type physical server which can be occupied by the virtual machine with m virtual CPU cores when the virtual machine runs on the j type physical server until the difference between Ci and Cj is in a preset range, and determining tijWhen the difference between Ci and Cj is in a preset range, the virtual machine with m virtual CPU cores can occupy the time slice sharing proportion of the physical CPU in the physical server of the type j when running on the physical server of the type j;
a fourth determination unit for determining if Ci>Cj, adjusting the time slice sharing proportion of the physical CPU in the i-type physical server which can be occupied by the virtual machine with m virtual CPU cores when the virtual machine runs on the i-type physical server until the difference between Ci and Cj is within a preset range, and determining tijWhen the difference between Ci and Cj is within a preset range, the virtual machine with m virtual CPU cores can occupy the time slice share of the physical CPU in the physical server of the i model when running on the physical server of the i modelThe inverse of the ratio;
a fifth determining unit configured to determine t if Ci ═ Cjij=1。
The above apparatus, preferably, the apparatus further comprises:
a second conversion relation determining module, configured to determine, through calculation, a time slice sharing proportional conversion relation when the virtual machines with the same virtual CPU core number run on physical servers of different models, where the second conversion relation determining module is configured to:
the first calculation unit is used for calculating a first calculation performance parameter Ci when the virtual machine with the virtual CPU core number m runs on the physical server of the i type;
the second calculation unit is used for calculating a second calculation performance parameter Cj when the virtual machine with the virtual CPU core number of m runs on the physical server with the model j;
a sixth determination unit for determining tij:tij=Ci/Cj。
According to the scheme, a time slice sharing proportion conversion relation of virtual machines with the same virtual CPU core number when running on physical servers of different models is preset, when the virtual machines are migrated, the type of a candidate physical server and the second time slice sharing proportion of the virtual machines to be migrated when running on the physical server of the candidate physical server model are determined according to the time slice sharing proportion conversion relation and the first time slice sharing proportion of the virtual machines to be migrated on a source physical server, then a target physical server is determined, the model of the target physical server belongs to the candidate physical server model, and the CPU core number of the target physical server is greater than or equal to the virtual CPU core number of the virtual machines to be migrated; the virtual machine to be migrated is migrated to the target physical server, and the time slice sharing proportion of the virtual machine to be migrated in the target physical server is adjusted to be a second time slice sharing proportion corresponding to the model of the target physical server, so that the difference of actual computing performance before and after the virtual machine is migrated is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of an implementation of a virtual machine migration method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a virtual machine migration apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a first determining module according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a first conversion relation determining module according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a second conversion relation determining module according to an embodiment of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be practiced otherwise than as specifically illustrated.
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.
Referring to fig. 1, fig. 1 is a flowchart of an implementation of a virtual machine migration method according to an embodiment of the present application, where the implementation of the virtual machine migration method includes:
step S11: acquiring a first time slice sharing proportion of a virtual machine to be migrated on a source physical server;
in the physical servers that create virtual machines, one physical CPU may handle both virtual CPU threads and other threads (non-virtual CPU threads). Suppose a physical CPU handles both a virtual CPU thread, thread1, and a non-virtual CPU thread, thread2, of a virtual machine, which are time-shared using the physical CPU. If their time sharing ratio to the physical CPU is 1:1 (i.e. the time slice sharing ratio of the thread1 is 1), the scheduling period of the thread is t, then the thread1 uses the physical CPU of t time, then the thread2 uses the physical CPU of t time, then the thread1 reuses the physical CPU of t time, and the cycle is repeated; if the time sharing ratio of the thread1 and thread2 to the physical CPU is 1:2 (i.e. the time slice sharing ratio of thread1 is 1/2), thread2 will use the physical CPU of 2t after thread1 uses the physical CPU of t time, then thread1 uses the physical CPU of t time, and the process is cycled.
For convenience of description, in the embodiment of the present invention, the time slice sharing ratio of the virtual machine to be migrated on the source physical server is referred to as a first time slice sharing ratio.
Step S12: determining candidate physical server models and a second time slice sharing proportion of the virtual machines to be migrated when the virtual machines to be migrated run on the physical servers of the candidate physical server models based on the first time slice sharing proportion, the model of the source physical server and a time slice sharing proportion conversion relation of the preset virtual CPU core number when the virtual machines run on the physical servers of different models, wherein the second time slice sharing proportion is less than or equal to 1;
the computing power of a virtual machine depends on the number of virtual CPUs and the performance of the physical servers, typically one virtual CPU core is checking one physical core or hyper-threaded logical core corresponding to a physical CPU.
In the embodiment of the invention, the time slice sharing proportion conversion relation of the virtual machines with the same virtual CPU core number when running on the physical servers with different models is pre-established.
Assuming that the number of virtual CPU cores of a virtual machine is m, the computing performance of the virtual machine with the number of virtual CPU cores m when the virtual machine runs on a physical server of a first model at a time slice sharing ratio of s1 is equivalent to the computing performance of the virtual machine with the number of virtual CPU cores m when the virtual machine runs on a physical server of a second model at a time slice sharing ratio of s2, in the embodiment of the present invention, the time slice sharing ratio conversion relationship of the virtual machine with the number of virtual CPU cores m when the virtual machine runs on a physical server of the first model and on a physical server of the second model is: when the computing performance of the virtual machine with the number of m virtual CPU cores when running on the physical server of the first model at the time slice sharing ratio s1 is equivalent to the computing performance of the virtual machine with the number of m virtual CPU cores when running on the physical server of the second model, the time slice sharing ratio of the virtual machine with the number of m virtual CPU cores when running on the physical server of the second model is s 2.
In the embodiment of the invention, the candidate physical server type is determined through the time slice sharing proportion conversion relation when the virtual machine with the same virtual CPU core number corresponding to the core number of the CPU of the virtual machine to be migrated runs on the physical servers with different models.
The method comprises the steps that the physical server models determined based on the time slice sharing proportion conversion relation when virtual machines with the same virtual CPU core number run on physical servers of different models can be various, and when the computing performance of the virtual machines to be migrated when running on the physical servers of the models is equivalent to the computing performance of the virtual machines to be migrated when running on a source physical server at a first time slice sharing proportion, the time slice sharing proportion of the virtual machines to be migrated can be larger than 1 and can also be smaller than or equal to 1.
Step S13: determining a target physical server, wherein the model of the target physical server belongs to the model of the candidate physical server, and the number of CPU cores of the target physical server is greater than or equal to the number of virtual CPU cores of the virtual machine to be migrated;
in the embodiment of the invention, a physical server with the number of CPU cores of one physical server being greater than or equal to the number of virtual CPU cores of the virtual machine to be migrated is determined from physical servers with the models of the candidate physical machines as a target physical server.
If the target physical server is not found, it indicates that the virtual machine to be migrated cannot be migrated.
Step S14: and migrating the virtual machine to be migrated to the target physical server, and adjusting the time slice sharing proportion of the virtual machine to be migrated in the target physical server to a second time slice sharing proportion corresponding to the model of the target physical server.
And migrating the virtual machine to be migrated to the destination physical server, and setting the time slice sharing proportion of the virtual machine to be migrated in the destination physical server as a second time slice sharing proportion, wherein the computing performance of the virtual machine to be migrated when running on the destination physical server at the second time slice sharing proportion is equivalent to the computing performance of the virtual machine to be migrated when running on the source physical server at the first time slice sharing proportion.
The virtual machine migration method provided by the embodiment of the invention is characterized in that a time slice sharing proportion conversion relation of virtual machines with the same virtual CPU core number when running on physical servers with different models is preset, when the virtual machine migration is carried out, a candidate physical server type and a second time slice sharing proportion of a virtual machine to be migrated when running on a physical server with the candidate physical server model are determined according to the time slice sharing proportion conversion relation and a first time slice sharing proportion of the virtual machine to be migrated on a source physical server, then a target physical server is determined, the model of the target physical server belongs to the candidate physical server model, and the CPU core number of the target physical server is greater than or equal to that of the virtual CPU core number of the virtual machine to be migrated; the virtual machine to be migrated is migrated to the target physical server, and the time slice sharing proportion of the virtual machine to be migrated in the target physical server is adjusted to be a second time slice sharing proportion corresponding to the model of the target physical server, so that the difference of actual computing performance before and after the virtual machine is migrated is reduced.
Optionally, the time slice sharing ratio conversion relationship when the virtual machines with the same virtual CPU core number run on physical servers of different models may include:
the computing performance of a virtual machine with m virtual CPU cores running on a physical server of j model is equivalent to the computing performance of a virtual machine with m virtual CPU cores running on a physical server of i model with a time slice sharing proportion of 1, and the time slice sharing proportion of the virtual machine with m virtual CPU cores running on the physical server of j model is tij。
Generally, when a virtual machine is created on a physical server, the slice sharing ratio of the virtual machine on the physical server is initialized to 1.
For easier understanding, in the embodiment of the present invention, the matrix T may be usedmRepresenting the time slice sharing proportion conversion relation of a virtual machine with m virtual CPU cores when running on physical servers of different models (different models are represented by different numbers), whereinThe matrix is as follows:
wherein, tij(i is more than or equal to 1 and less than or equal to N, and j is more than or equal to 1 and less than or equal to N) represents that the computing performance of the virtual machine with the number of virtual CPU cores m when running on the physical server with the j model is equivalent to the time slice sharing proportion of the virtual machine with the number of virtual CPU cores m when running on the physical server with the i model with the time slice sharing proportion of 1. That is, the computing performance of a virtual machine with m virtual CPU cores when running on a physical server of i model at a time slice sharing ratio of 1 is equivalent to that of a virtual machine with m virtual CPU cores when running on a physical server of j model at a time slice sharing ratio of tijComputational performance at runtime.
Optionally, the determining a candidate physical server model based on the first time slice sharing ratio, the model of the source physical server, and a time slice sharing ratio conversion relationship when the virtual machine with the preset same virtual CPU core number runs on physical servers with different models, and the second time slice sharing ratio when the virtual machine to be migrated runs on a physical server with the candidate physical server model may include:
if the sharing ratio of the first time slice is 1, T can be directly searchedmFind all candidate physical server types k, where trkAnd r is less than or equal to 1, the model of the source physical server where the virtual machine to be migrated is located, and k belongs to {1,2, …, N }. In this embodiment of the present invention, if the model of the destination physical server is k1, the sharing ratio of the second time slice corresponding to the model of the destination physical server is trk1。
If the first time slice sharing proportion is not 1, determining a transition physical server model h according to the model of the source physical server, the first time slice sharing proportion and the time slice sharing proportion conversion relation of the preset virtual machines with the same virtual CPU core number when the virtual machines run on physical servers with different models; the computing performance of the virtual machine to be migrated when the physical CPU time slice of the physical server of the transition physical server model is used on the physical server of the transition physical server model with the time slice proportion of 1 is the same as the computing performance of the virtual machine to be migrated when the physical CPU time slice of the source physical server is used on the source physical server with the first time slice sharing proportion;
specifically, can be represented by thrFinding a transition physical server model h, wherein s is a first time slice sharing proportion of the virtual machine to be migrated when running on the source physical server, r is a model of the source physical server where the virtual machine to be migrated is located, and h belongs to {1,2, …, N }.
When the first time slice sharing ratio is not 1, the virtual machine to be migrated is migrated from another physical server to the source physical server. In the embodiment of the invention, if the first time slice sharing proportion is not 1, the physical server model when the time slice sharing proportion of the virtual machine to be migrated is 1, namely the transition physical server model, is found through the time slice sharing proportion conversion relation when the virtual machine with the same virtual CPU core number runs on the physical servers with different models, and then the candidate physical server is found through the transition physical server model and the time slice sharing proportion conversion relation when the virtual machine with the same virtual CPU core number runs on the physical servers with different models.
And determining a candidate physical server model and a second time slice sharing proportion of the virtual machine to be migrated when the virtual machine runs on the physical server of the candidate physical server model according to the transition physical server model and the time slice sharing proportion conversion relation of the preset virtual CPU core number when the virtual machine runs on the physical servers of different models, wherein the second time slice sharing proportion is less than or equal to 1.
In particularCandidate physical server model k may be determined by transition server model h, where thkAnd h is less than or equal to 1, the model of the transition physical server is h, and k belongs to {1,2, …, N }. At this time, if the model of the destination physical server is k1, the second time slice sharing ratio corresponding to the model of the destination physical server is thk1。
Optionally, the time slice sharing ratio conversion relationship when the virtual machines with the same virtual CPU core number run on physical servers of different models may be determined through testing, and specifically includes:
respectively operating virtual machines with m virtual CPU cores on a physical server of type i and a physical server of type j according to a time slice sharing proportion of 1; when the test is carried out specifically, the test platform,
on the physical server of the type i, different types of workloads are operated in the virtual machine with the number of the virtual CPU cores being m, and the virtual machine with the number of the virtual CPU cores being m is tested to obtain a first calculation performance parameter Ci of the virtual machine with the number of the virtual CPU cores being m;
on the physical server of the type j, the different types of workloads are operated in the virtual machine with the number of the virtual CPU cores being m, and the virtual machine with the number of the virtual CPU cores being m is tested to obtain a second computing performance parameter Cj of the virtual machine with the number of the virtual CPU cores being m;
the different types described above may include: CPU intensive, memory intensive, disk IO intensive, and any combination of these types.
The computing Performance of the virtual machine can be tested using a reference test tool such as SPEC (Standard Performance Evaluation Corporation).
The computational performance parameter may be characterized by an average number of instructions executed per second (i.e., instructions/second).
If said Ci is<Cj, the object of the virtual machine with m virtual CPU cores in the j model numberWhen the physical server runs on the physical server, the time slice sharing proportion of the physical CPU in the physical server with the j type can be occupied, the time slice sharing proportion is adjusted until the difference between Ci and Cj is within a preset range, and t isijWhen the difference between Ci and Cj is in a preset range, the virtual machine with m virtual CPU cores can occupy the time slice sharing proportion of the physical CPU in the physical server of the type j when running on the physical server of the type j;
and if the first calculation performance parameter is smaller than the second calculation performance parameter, finding a process corresponding to the virtual machine when the virtual machine runs on the physical machine of the j model, and adjusting the time slice proportion of the physical CPU of the j model which can be occupied by the process until the difference between Ci and Cj is within a preset range. When the difference between Ci and Cj is within a preset range, when a virtual machine with m virtual CPU cores runs on a physical server of the j model, the time slice sharing proportion of the physical CPU in the physical server of the j model can be occupied by the virtual machineij。
If Ci>Cj, adjusting the time slice sharing proportion of the physical CPU in the i-type physical server which can be occupied by the virtual machine with m virtual CPU cores when the virtual machine runs on the i-type physical server until the difference between Ci and Cj is within a preset range, and t isijWhen the difference between Ci and Cj is within a preset range, the virtual machine with m virtual CPU cores can occupy the reciprocal of the time slice sharing proportion of the physical CPU in the physical server of the i model when running on the physical server of the i model;
and if the first calculation performance parameter is larger than the second calculation performance parameter, finding a process corresponding to the virtual machine when the virtual machine runs on the physical machine of the i model, and adjusting the time slice proportion of the physical CPU of the i model which can be occupied by the process until the difference between Ci and Cj is within a preset range. When the difference between Ci and Cj is within a preset range, when a virtual machine with m virtual CPU cores runs on a physical server of the i model, the reciprocal of the time slice sharing proportion of the physical CPU in the physical server of the i model can be occupied by tij。
If Ci is Cj, tij=1。
Optionally, the time slice sharing proportion conversion relationship when the virtual machines with the same virtual CPU core number run on physical servers of different models may also be determined by calculation, and the method specifically includes:
calculating a first calculation performance parameter Ci when the virtual machine with the virtual CPU core number m runs on a physical server of the type i;
calculating a second calculation performance parameter Cj of the virtual machine with the virtual CPU core number of m when the virtual machine runs on the physical server with the model j;
wherein, tij=Ci/Cj。
In the embodiment of the present invention, the number x of instructions executed by the CPU of the physical server per second may be obtained, and the time allocated to the Virtual Machine process by the physical CPU per second is calculated as T based on an algorithm for scheduling the physical CPU to the Virtual Machine process by a Virtual Machine Monitor (VMM), and the calculation performance parameter of the Virtual Machine is x/T.
Corresponding to the method embodiment, an embodiment of the present invention further provides a virtual machine migration apparatus, and a schematic structural diagram of the virtual machine migration apparatus according to the embodiment of the present invention is shown in fig. 2, and may include:
an acquisition module 21, a first determination module 22, a second determination module 23 and a migration module 24; wherein,
the obtaining module 21 is configured to obtain a first time slice sharing ratio of the virtual machine to be migrated on the source physical server;
in the physical servers that create virtual machines, one physical CPU may handle both virtual CPU threads and other threads (non-virtual CPU threads). Suppose a physical CPU handles both a virtual CPU thread, thread1, and a non-virtual CPU thread, thread2, of a virtual machine, which are time-shared using the physical CPU. If their time sharing ratio to the physical CPU is 1:1 (i.e. the time slice sharing ratio of the thread1 is 1), the scheduling period of the thread is t, then the thread1 uses the physical CPU of t time, then the thread2 uses the physical CPU of t time, then the thread1 reuses the physical CPU of t time, and the cycle is repeated; if the time sharing ratio of the thread1 and thread2 to the physical CPU is 1:2 (i.e. the time slice sharing ratio of thread1 is 1/2), thread2 will use the physical CPU of 2t after thread1 uses the physical CPU of t time, then thread1 uses the physical CPU of t time, and the process is cycled.
For convenience of description, in the embodiment of the present invention, the time slice sharing ratio of the virtual machine to be migrated on the source physical server is referred to as a first time slice sharing ratio.
The first determining module 22 is configured to determine, based on the first time slice sharing ratio, the model of the source physical server, and a time slice sharing ratio conversion relationship when a preset virtual machine with the same virtual CPU core number runs on physical servers of different models, a candidate physical server model and a second time slice sharing ratio when a virtual machine to be migrated runs on a physical server of the candidate physical server model, where the second time slice sharing ratio is less than or equal to 1;
the computing power of a virtual machine depends on the number of virtual CPUs and the performance of the physical servers, typically one virtual CPU core is checking one physical core or hyper-threaded logical core corresponding to a physical CPU.
In the embodiment of the invention, the time slice sharing proportion conversion relation of the virtual machines with the same virtual CPU core number when running on the physical servers with different models is pre-established.
Assuming that the number of virtual CPU cores of a virtual machine is m, the computing performance of the virtual machine with the number of virtual CPU cores m when the virtual machine runs on a physical server of a first model at a time slice sharing ratio of s1 is equivalent to the computing performance of the virtual machine with the number of virtual CPU cores m when the virtual machine runs on a physical server of a second model at a time slice sharing ratio of s2, in the embodiment of the present invention, the time slice sharing ratio conversion relationship of the virtual machine with the number of virtual CPU cores m when the virtual machine runs on a physical server of the first model and on a physical server of the second model is: when the computing performance of the virtual machine with the number of m virtual CPU cores when running on the physical server of the first model at the time slice sharing ratio s1 is equivalent to the computing performance of the virtual machine with the number of m virtual CPU cores when running on the physical server of the second model, the time slice sharing ratio of the virtual machine with the number of m virtual CPU cores when running on the physical server of the second model is s 2.
In the embodiment of the invention, the candidate physical server type is determined through the time slice sharing proportion conversion relation when the virtual machine with the same virtual CPU core number corresponding to the core number of the CPU of the virtual machine to be migrated runs on the physical servers with different models.
The method comprises the steps that the physical server models determined based on the time slice sharing proportion conversion relation when virtual machines with the same virtual CPU core number run on physical servers of different models can be various, and when the computing performance of the virtual machines to be migrated when running on the physical servers of the models is equivalent to the computing performance of the virtual machines to be migrated when running on a source physical server at a first time slice sharing proportion, the time slice sharing proportion of the virtual machines to be migrated can be larger than 1 and can also be smaller than or equal to 1.
The second determining module 23 is configured to determine a destination physical server, where the model of the destination physical server belongs to the model of the candidate physical server, and the number of CPU cores of the destination physical server is greater than or equal to the number of virtual CPU cores of the virtual machine to be migrated;
in the embodiment of the invention, a physical server with the number of CPU cores of one physical server being greater than or equal to the number of virtual CPU cores of the virtual machine to be migrated is determined from physical servers with the models of the candidate physical machines as a target physical server.
If the target physical server is not found, it indicates that the virtual machine to be migrated cannot be migrated.
The migration module 24 is configured to migrate the virtual machine to be migrated to the destination physical server, and adjust a time slice sharing ratio of the virtual machine to be migrated in the destination physical server to a second time slice sharing ratio corresponding to the model of the destination physical server.
And migrating the virtual machine to be migrated to the destination physical server, and setting the time slice sharing proportion of the virtual machine to be migrated in the destination physical server as a second time slice sharing proportion, wherein the computing performance of the virtual machine to be migrated when running on the destination physical server at the second time slice sharing proportion is equivalent to the computing performance of the virtual machine to be migrated when running on the source physical server at the first time slice sharing proportion.
The virtual machine migration device provided by the embodiment of the invention presets a time slice sharing proportion conversion relation of virtual machines with the same virtual CPU core number when running on physical servers with different models, determines a candidate physical server type and a second time slice sharing proportion of a virtual machine to be migrated when running on a physical server with the candidate physical server type through the time slice sharing proportion conversion relation and the first time slice sharing proportion of the virtual machine to be migrated on a source physical server, and then determines a target physical server, wherein the model of the target physical server belongs to the candidate physical server type, and the CPU core number of the target physical server is greater than or equal to the virtual CPU core number of the virtual machine to be migrated; the virtual machine to be migrated is migrated to the target physical server, and the time slice sharing proportion of the virtual machine to be migrated in the target physical server is adjusted to be a second time slice sharing proportion corresponding to the model of the target physical server, so that the difference of actual computing performance before and after the virtual machine is migrated is reduced.
Optionally, the time slice sharing ratio conversion relationship when the virtual machines with the same virtual CPU core number run on physical servers of different models may include:
the computing performance of a virtual machine with m virtual CPU cores running on a physical server of j model is equivalent to the computing performance of a virtual machine with m virtual CPU cores running on a physical server of i model with a time slice sharing proportion of 1, and the time slice sharing proportion of the virtual machine with m virtual CPU cores running on the physical server of j model is tij。
Generally, when a virtual machine is created on a physical server, the slice sharing ratio of the virtual machine on the physical server is initialized to 1.
For easier understanding, in the embodiment of the present invention, the matrix T may be usedmRepresenting the time slice sharing proportion conversion relation of a virtual machine with m virtual CPU cores when running on physical servers of different models (different models are represented by different numbers), wherein the matrix is as follows:
wherein, tij(i is more than or equal to 1 and less than or equal to N, and j is more than or equal to 1 and less than or equal to N) represents that the computing performance of the virtual machine with the number of virtual CPU cores m when running on the physical server with the j model is equivalent to the time slice sharing proportion of the virtual machine with the number of virtual CPU cores m when running on the physical server with the i model with the time slice sharing proportion of 1. That is, the computing performance of a virtual machine with m virtual CPU cores when running on a physical server of i model at a time slice sharing ratio of 1 is equivalent to that of a virtual machine with m virtual CPU cores when running on a physical server of j model at a time slice sharing ratio of tijComputational performance at runtime.
Optionally, a schematic structural diagram of the first determining module 22 is shown in fig. 3, and may include:
a first determining unit 31 and a second determining unit 32; wherein,
the first determining unit 31 is configured to determine, if the first time slice sharing ratio is not 1, a model of a transition physical server according to a relationship among the model of the source physical server, the first time slice sharing ratio, and a time slice sharing ratio conversion relationship when the preset virtual machines with the same virtual CPU core number run on physical servers of different models; the computing performance of the virtual machine to be migrated when the physical CPU time slice of the physical server of the transition physical server model is used on the physical server of the transition physical server model with the time slice proportion of 1 is the same as the computing performance of the virtual machine to be migrated when the physical CPU time slice of the source physical server is used on the source physical server with the first time slice sharing proportion;
specifically, can be represented by thrFinding a transition physical server model h, wherein s is a first time slice sharing proportion of the virtual machine to be migrated when running on the source physical server, r is a model of the source physical server where the virtual machine to be migrated is located, and h belongs to {1,2, …, N }.
When the first time slice sharing ratio is not 1, the virtual machine to be migrated is migrated from another physical server to the source physical server. In the embodiment of the invention, if the first time slice sharing proportion is not 1, the physical server model when the time slice sharing proportion of the virtual machine to be migrated is 1, namely the transition physical server model, is found through the time slice sharing proportion conversion relation when the virtual machine with the same virtual CPU core number runs on the physical servers with different models, and then the candidate physical server is found through the transition physical server model and the time slice sharing proportion conversion relation when the virtual machine with the same virtual CPU core number runs on the physical servers with different models.
The first determining unit 31 may be further configured to directly search T if the first time slice sharing ratio is 1mFind outAll candidate physical server types k are derived, where trkAnd r is less than or equal to 1, the model of the source physical server where the virtual machine to be migrated is located, and k belongs to {1,2, …, N }. In this embodiment of the present invention, if the model of the destination physical server is k1, the sharing ratio of the second time slice corresponding to the model of the destination physical server is trk1。
The second determining unit 32 is configured to determine a candidate physical server model and a second time slice sharing proportion when the virtual machine to be migrated runs on a physical server of the candidate physical server model according to the transition physical server model and a time slice sharing proportion conversion relation when the virtual machine with the preset same virtual CPU core number runs on physical servers of different models, where the second time slice sharing proportion is less than or equal to 1.
Specifically, candidate physical server model k may be determined by transition server model h, where thkAnd h is less than or equal to 1, the model of the transition physical server is h, and k belongs to {1,2, …, N }. At this time, if the model of the destination physical server is k1, the second time slice sharing ratio corresponding to the model of the destination physical server is thk1。
Optionally, on the basis of the embodiment shown in fig. 2, the virtual machine migration apparatus provided in the embodiment of the present invention may further include:
and the first conversion relation determining module is used for determining the time slice sharing proportion conversion relation of the virtual machines with the same virtual CPU core number when running on the physical servers with different models through testing.
Specifically, a schematic structural diagram of the first conversion relation determining module provided in the embodiment of the present invention is shown in fig. 4, and may include:
a first testing unit 41, configured to, when a virtual machine with m virtual CPU cores runs on an i-type physical server at a time slice sharing ratio of 1 and different types of workloads run in the virtual machine with m virtual CPU cores, test the virtual machine with m virtual CPU cores to obtain a first computation performance parameter Ci of the virtual machine with m virtual CPU cores;
the second testing unit 42 is configured to, when a virtual machine with m virtual CPU cores runs on a physical server of the j model according to a time slice sharing ratio of 1 and the different types of workloads run in the virtual machine with m virtual CPU cores, test the virtual machine with m virtual CPU cores to obtain a second computing performance parameter Cj of the virtual machine with m virtual CPU cores;
the different types described above may include: CPU intensive, memory intensive, disk IO intensive, and any combination of these types.
The computing Performance of the virtual machine can be tested using a reference test tool such as SPEC (Standard Performance Evaluation Corporation).
The computational performance parameter may be characterized by an average number of instructions executed per second (i.e., instructions/second).
A third determining unit 43 for determining if Ci is greater than<Cj, adjusting the time slice sharing proportion of the physical CPU in the j type physical server which can be occupied by the virtual machine with m virtual CPU cores when the virtual machine runs on the j type physical server until the difference between Ci and Cj is in a preset range, and determining tijWhen the difference between Ci and Cj is in a preset range, the virtual machine with m virtual CPU cores can occupy the time slice sharing proportion of the physical CPU in the physical server of the type j when running on the physical server of the type j;
and if the first calculation performance parameter is smaller than the second calculation performance parameter, finding a process corresponding to the virtual machine when the virtual machine runs on the physical machine of the j model, and adjusting the time slice proportion of the physical CPU of the j model which can be occupied by the process until the difference between Ci and Cj is within a preset range. When the difference between Ci and Cj is within a preset range, a virtual machine with m virtual CPU cores can occupy the j type physical server when running on the j type physical serverThe time slice sharing ratio of the physical CPU in the j type physical server is tij。
A fourth determination unit 44 for determining if Ci>Cj, adjusting the time slice sharing proportion of the physical CPU in the i-type physical server which can be occupied by the virtual machine with m virtual CPU cores when the virtual machine runs on the i-type physical server until the difference between Ci and Cj is within a preset range, and determining tijWhen the difference between Ci and Cj is within a preset range, the virtual machine with m virtual CPU cores can occupy the reciprocal of the time slice sharing proportion of the physical CPU in the physical server of the i model when running on the physical server of the i model;
and if the first calculation performance parameter is larger than the second calculation performance parameter, finding a process corresponding to the virtual machine when the virtual machine runs on the physical machine of the i model, and adjusting the time slice proportion of the physical CPU of the i model which can be occupied by the process until the difference between Ci and Cj is within a preset range. When the difference between Ci and Cj is within a preset range, when a virtual machine with m virtual CPU cores runs on a physical server of the i model, the reciprocal of the time slice sharing proportion of the physical CPU in the physical server of the i model can be occupied by tij。
A fifth determining unit 45, configured to determine t if Ci ═ Cjij=1。
Optionally, on the basis of the embodiment shown in fig. 2, the virtual machine migration apparatus provided in the embodiment of the present invention may further include:
and the second conversion relation determining module is used for determining the time slice sharing proportion conversion relation of the virtual machines with the same virtual CPU core number when running on the physical servers with different models through calculation.
Specifically, a schematic structural diagram of the second conversion relation determining module provided in the embodiment of the present invention is shown in fig. 5, and may include:
a first calculating unit 51, configured to calculate a first calculation performance parameter Ci when a virtual machine with the number of virtual CPU cores m runs on a physical server of an i-type;
a second calculating unit 52, configured to calculate a second calculation performance parameter Cj when the virtual machine with the virtual CPU core number m runs on the physical server of the j model;
a sixth determining unit 53 for determining tij:tij=Ci/Cj。
In the embodiment of the present invention, the number x of instructions executed by the CPU of the physical server per second may be obtained, and the time allocated to the Virtual Machine process by the physical CPU per second is calculated as T based on an algorithm for scheduling the physical CPU to the Virtual Machine process by a Virtual Machine Monitor (VMM), and the calculation performance parameter of the Virtual Machine is x/T.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A virtual machine migration method is characterized by comprising the following steps:
acquiring a first time slice sharing proportion of a virtual machine to be migrated on a source physical server;
determining candidate physical server models and a second time slice sharing proportion of the virtual machines to be migrated when the virtual machines to be migrated run on the physical servers of the candidate physical server models based on the first time slice sharing proportion, the model of the source physical server and a time slice sharing proportion conversion relation of the preset virtual CPU core number when the virtual machines run on the physical servers of different models, wherein the second time slice sharing proportion is less than or equal to 1;
determining a target physical server, wherein the model of the target physical server belongs to the model of the candidate physical server, and the number of CPU cores of the target physical server is greater than or equal to the number of virtual CPU cores of the virtual machine to be migrated;
and migrating the virtual machine to be migrated to the target physical server, and adjusting the time slice sharing proportion of the virtual machine to be migrated in the target physical server to a second time slice sharing proportion corresponding to the model of the target physical server.
2. The method of claim 1, wherein the time slice sharing proportional transformation relation of the virtual machines with the same virtual CPU core number when running on different types of physical servers comprises:
the computing performance of a virtual machine with m virtual CPU cores running on a physical server of j model is equivalent to the computing performance of a virtual machine with m virtual CPU cores running on a physical server of i model with a time slice sharing proportion of 1, and the time slice sharing proportion of the virtual machine with m virtual CPU cores running on the physical server of j model is tij。
3. The method of claim 2, wherein the determining a candidate physical server model based on the first time slice sharing ratio, the model of the source physical server, and a time slice sharing ratio conversion relationship when a preset virtual machine with the same virtual CPU core number runs on a physical server with a different model, and the second time slice sharing ratio when the virtual machine to be migrated runs on the physical server with the candidate physical server model comprises:
if the first time slice sharing proportion is not 1, determining the model of a transition physical server according to the model of the source physical server, the first time slice sharing proportion and the time slice sharing proportion conversion relation of the preset virtual machines with the same virtual CPU core number when the virtual machines run on physical servers with different models; the computing performance of the virtual machine to be migrated when the physical CPU time slice of the physical server of the transition physical server model is used on the physical server of the transition physical server model with the time slice proportion of 1 is the same as the computing performance of the virtual machine to be migrated when the physical CPU time slice of the source physical server is used on the source physical server with the first time slice sharing proportion;
and determining a candidate physical server model and a second time slice sharing proportion of the virtual machine to be migrated when the virtual machine runs on the physical server of the candidate physical server model according to the transition physical server model and the time slice sharing proportion conversion relation of the preset virtual CPU core number when the virtual machine runs on the physical servers of different models, wherein the second time slice sharing proportion is less than or equal to 1.
4. The method of claim 2, wherein determining the time slice sharing proportional transformation relation of the virtual machines with the same number of virtual CPU cores when running on different types of physical servers through testing comprises:
respectively operating virtual machines with m virtual CPU cores on a physical server of type i and a physical server of type j according to a time slice sharing proportion of 1;
running different types of workloads in the virtual machine with the number of the virtual CPU cores m on the physical server of the type i, and testing the virtual machine with the number of the virtual CPU cores m to obtain a first calculation performance parameter Ci of the virtual machine with the number of the virtual CPU cores m;
running the different types of workloads in the virtual machines with the number of the virtual CPU cores m on the physical servers with the type j, and testing the virtual machines with the number of the virtual CPU cores m to obtain a second computing performance parameter Cj of the virtual machines with the number of the virtual CPU cores m;
if said Ci is<Cj, then the number of the virtual CPU cores isWhen the m virtual machine runs on the j-type physical server, the time slice sharing proportion of a physical CPU in the j-type physical server can be occupied for adjustment until the difference between Ci and Cj is within a preset range, and t isijWhen the difference between Ci and Cj is in a preset range, the virtual machine with m virtual CPU cores can occupy the time slice sharing proportion of the physical CPU in the physical server of the type j when running on the physical server of the type j;
if Ci>Cj, adjusting the time slice sharing proportion of the physical CPU in the i-type physical server which can be occupied by the virtual machine with m virtual CPU cores when the virtual machine runs on the i-type physical server until the difference between Ci and Cj is within a preset range, and t isijWhen the difference between Ci and Cj is within a preset range, the virtual machine with m virtual CPU cores can occupy the reciprocal of the time slice sharing proportion of the physical CPU in the physical server of the i model when running on the physical server of the i model;
if Ci is Cj, tij=1。
5. The method of claim 2, wherein the calculating the time slice sharing ratio conversion relationship when the virtual machines with the same number of virtual CPU cores run on different types of physical servers comprises:
calculating a first calculation performance parameter Ci when the virtual machine with the virtual CPU core number m runs on a physical server of the type i;
calculating a second calculation performance parameter Cj of the virtual machine with the virtual CPU core number of m when the virtual machine runs on the physical server with the model j;
wherein, tij=Ci/Cj。
6. An apparatus for virtual machine migration, the apparatus comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a first time slice sharing proportion of a virtual machine to be migrated on a source physical server;
a first determining module, configured to determine, based on the first time slice sharing ratio, the model of the source physical server, and a time slice sharing ratio conversion relationship when a preset virtual machine with the same virtual CPU core number runs on physical servers of different models, a candidate physical server model and a second time slice sharing ratio when a virtual machine to be migrated runs on a physical server of the candidate physical server model, where the second time slice sharing ratio is less than or equal to 1;
a second determining module, configured to determine a destination physical server, where a model of the destination physical server belongs to the model of the candidate physical server, and a number of CPU cores of the destination physical server is greater than or equal to a number of virtual CPU cores of the virtual machine to be migrated;
and the migration module is used for migrating the virtual machine to be migrated to the target physical server and adjusting the time slice sharing proportion of the virtual machine to be migrated in the target physical server to a second time slice sharing proportion corresponding to the model of the target physical server.
7. The apparatus of claim 6, wherein the time slice sharing proportional transformation relation of the virtual machines with the same virtual CPU core number when running on different types of physical servers comprises:
the computing performance of a virtual machine with m virtual CPU cores running on a physical server of j model is equivalent to the computing performance of a virtual machine with m virtual CPU cores running on a physical server of i model with a time slice sharing proportion of 1, and the time slice sharing proportion of the virtual machine with m virtual CPU cores running on the physical server of j model is tij。
8. The apparatus of claim 7, wherein the first determining module comprises:
a first determining unit, configured to determine, if the first time slice sharing ratio is not 1, a model of a transition physical server according to a relationship among the model of the source physical server, the first time slice sharing ratio, and a time slice sharing ratio conversion relationship when the preset virtual machines with the same virtual CPU core number run on physical servers of different models; the computing performance of the virtual machine to be migrated when the physical CPU time slice of the physical server of the transition physical server model is used on the physical server of the transition physical server model with the time slice proportion of 1 is the same as the computing performance of the virtual machine to be migrated when the physical CPU time slice of the source physical server is used on the source physical server with the first time slice sharing proportion;
and a second determining unit, configured to determine a candidate physical server model and a second time slice sharing proportion when the virtual machine to be migrated runs on a physical server of the candidate physical server model according to the transition physical server model and a time slice sharing proportion conversion relation when the virtual machine with the preset same virtual CPU core number runs on physical servers of different models, where the second time slice sharing proportion is less than or equal to 1.
9. The apparatus of claim 7, further comprising:
a first conversion relation determining module, configured to determine, through testing, a time slice sharing proportional conversion relation when the virtual machines with the same virtual CPU core number run on physical servers of different models, where the time slice sharing proportional conversion relation includes:
the first testing unit is used for testing the virtual machine with the number of the virtual CPU cores being m to obtain a first computing performance parameter Ci of the virtual machine with the number of the virtual CPU cores being m when the virtual machine with the number of the virtual CPU cores being m runs different types of workloads in the virtual machine with the number of the virtual CPU cores being m on an i-type physical server according to a time slice sharing ratio being 1;
the second testing unit is used for testing the virtual machine with the number of the virtual CPU cores m to obtain a second computing performance parameter Cj of the virtual machine with the number of the virtual CPU cores m when the virtual machine with the number of the virtual CPU cores m runs the different types of workloads in the virtual machine with the number of the virtual CPU cores m on the physical server with the j model according to the time slice sharing proportion of 1;
a third determining unit for determining if Ci is greater than<Cj, adjusting the time slice sharing proportion of the physical CPU in the j type physical server which can be occupied by the virtual machine with m virtual CPU cores when the virtual machine runs on the j type physical server until the difference between Ci and Cj is in a preset range, and determining tijWhen the difference between Ci and Cj is in a preset range, the virtual machine with m virtual CPU cores can occupy the time slice sharing proportion of the physical CPU in the physical server of the type j when running on the physical server of the type j;
a fourth determination unit for determining if Ci>Cj, adjusting the time slice sharing proportion of the physical CPU in the i-type physical server which can be occupied by the virtual machine with m virtual CPU cores when the virtual machine runs on the i-type physical server until the difference between Ci and Cj is within a preset range, and determining tijWhen the difference between Ci and Cj is within a preset range, the virtual machine with m virtual CPU cores can occupy the reciprocal of the time slice sharing proportion of the physical CPU in the physical server of the i model when running on the physical server of the i model;
a fifth determining unit configured to determine t if Ci ═ Cjij=1。
10. The apparatus of claim 7, further comprising:
a second conversion relation determining module, configured to determine, through calculation, a time slice sharing proportional conversion relation when the virtual machines with the same virtual CPU core number run on physical servers of different models, where the second conversion relation determining module is configured to:
the first calculation unit is used for calculating a first calculation performance parameter Ci when the virtual machine with the virtual CPU core number m runs on the physical server of the i type;
the second calculation unit is used for calculating a second calculation performance parameter Cj when the virtual machine with the virtual CPU core number of m runs on the physical server with the model j;
sixth aspect of the inventionA determination unit for determining tij:tij=Ci/Cj。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510165952.3A CN106155782B (en) | 2015-04-09 | 2015-04-09 | Virtual machine migration method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510165952.3A CN106155782B (en) | 2015-04-09 | 2015-04-09 | Virtual machine migration method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106155782A CN106155782A (en) | 2016-11-23 |
CN106155782B true CN106155782B (en) | 2019-06-25 |
Family
ID=57335916
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510165952.3A Active CN106155782B (en) | 2015-04-09 | 2015-04-09 | Virtual machine migration method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106155782B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108874534B (en) * | 2018-04-18 | 2022-09-16 | 华为技术有限公司 | Method and device for scheduling PCPU (physical packet Unit) resources |
CN114546637B (en) * | 2022-01-16 | 2024-09-06 | 华东师范大学 | Virtual machine allocation method with limited types |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7203944B1 (en) * | 2003-07-09 | 2007-04-10 | Veritas Operating Corporation | Migrating virtual machines among computer systems to balance load caused by virtual machines |
CN102253857A (en) * | 2011-06-24 | 2011-11-23 | 华中科技大学 | Xen virtual machine scheduling control method in multi-core environment |
CN103294546A (en) * | 2013-04-03 | 2013-09-11 | 华中科技大学 | Multi-dimensional resource performance interference aware on-line virtual machine migration method and system |
CN104156255A (en) * | 2014-07-31 | 2014-11-19 | 华为技术有限公司 | Virtual machine migration method, virtual machine migration device and source physical host |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8468230B2 (en) * | 2007-10-18 | 2013-06-18 | Fujitsu Limited | Method, apparatus and recording medium for migrating a virtual machine |
JP6044131B2 (en) * | 2012-06-25 | 2016-12-14 | 富士通株式会社 | Program, management server, and virtual machine migration control method |
-
2015
- 2015-04-09 CN CN201510165952.3A patent/CN106155782B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7203944B1 (en) * | 2003-07-09 | 2007-04-10 | Veritas Operating Corporation | Migrating virtual machines among computer systems to balance load caused by virtual machines |
CN102253857A (en) * | 2011-06-24 | 2011-11-23 | 华中科技大学 | Xen virtual machine scheduling control method in multi-core environment |
CN103294546A (en) * | 2013-04-03 | 2013-09-11 | 华中科技大学 | Multi-dimensional resource performance interference aware on-line virtual machine migration method and system |
CN104156255A (en) * | 2014-07-31 | 2014-11-19 | 华为技术有限公司 | Virtual machine migration method, virtual machine migration device and source physical host |
Non-Patent Citations (1)
Title |
---|
云计算环境下虚拟机实时迁移及负载均衡研究;姜雅楠;《中国优秀硕士学位论文全文数据库 信息科技辑》;20150228;I137-8 |
Also Published As
Publication number | Publication date |
---|---|
CN106155782A (en) | 2016-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106776005B (en) | Resource management system and method for containerized application | |
TWI591542B (en) | Cloud compute node,method and system,and computer readable medium | |
Nghiem et al. | Towards efficient resource provisioning in MapReduce | |
Yang et al. | Design adaptive task allocation scheduler to improve MapReduce performance in heterogeneous clouds | |
CN102567080B (en) | Virtual machine position selection system facing load balance in cloud computation environment | |
US10365936B2 (en) | Idle processor management by guest in virtualized systems | |
RU2015114568A (en) | AUTOMATED RESOURCE USE PROFILING | |
US9367359B2 (en) | Optimized resource management for map/reduce computing | |
JP2017511940A5 (en) | ||
WO2018086467A1 (en) | Method, apparatus and system for allocating resources of application clusters under cloud environment | |
US9161064B2 (en) | Auto-scaling management of web content | |
Enokido et al. | Power consumption and computation models of virtual machines to perform computation type application processes | |
WO2016134542A1 (en) | Virtual machine migration method, apparatus and device | |
CN102521055B (en) | Virtual machine resource allocating method and virtual machine resource allocating system | |
US9954757B2 (en) | Shared resource contention | |
WO2015032201A1 (en) | Virtual machine placing method and device | |
Lee et al. | A dynamic resource management with energy saving mechanism for supporting cloud computing | |
Guzek et al. | A holistic model of the performance and the energy efficiency of hypervisors in a high‐performance computing environment | |
Hasan et al. | Heuristic based energy-aware resource allocation by dynamic consolidation of virtual machines in cloud data center | |
US20210303327A1 (en) | Gpu-remoting latency aware virtual machine migration | |
CN109558248B (en) | Method and system for determining resource allocation parameters for ocean mode calculation | |
CN107624181B (en) | Virtual machine management method and apparatus including idling and scheduling of virtual processors | |
Ali et al. | Performance testing as a service for web applications | |
Chaudhary et al. | A new load balancing technique for virtual machine cloud computing environment | |
CN106155782B (en) | Virtual machine migration method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |