WO2016008316A1 - 一种虚拟机迁移方法及装置 - Google Patents

一种虚拟机迁移方法及装置 Download PDF

Info

Publication number
WO2016008316A1
WO2016008316A1 PCT/CN2015/075701 CN2015075701W WO2016008316A1 WO 2016008316 A1 WO2016008316 A1 WO 2016008316A1 CN 2015075701 W CN2015075701 W CN 2015075701W WO 2016008316 A1 WO2016008316 A1 WO 2016008316A1
Authority
WO
WIPO (PCT)
Prior art keywords
migration
virtual machine
migrated
time
data
Prior art date
Application number
PCT/CN2015/075701
Other languages
English (en)
French (fr)
Inventor
师斌
李博
赵洁玉
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2016008316A1 publication Critical patent/WO2016008316A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a virtual machine migration method and apparatus.
  • VM virtual machine
  • online migration online migration
  • the virtual machine online migration technology refers to the virtual machine migration between different physical hosts while ensuring the normal operation of the service on the virtual machine. To ensure that the services on the VM are available, the migration process allows only a very short switchover time. When the VMs are migrated between different physical hosts, the VMs are migrated from the source host to the destination host. , can run smoothly, so that the user does not feel the interruption of the service, so the migration process is transparent to the user. Online migration of virtual machines is suitable for scenarios where service availability is critical.
  • ARM Advanced RISC Machines
  • the virtualization technology for ARM platform has strong technical forward-looking and practical. value.
  • ARM processors are widely used in mobile terminals and embedded systems, and the network environment is often relatively complex.
  • the current virtual machine online migration technology is widely used in x86 platforms, x86 platforms are relatively ARM platforms, and the network environment is relatively simple. Therefore, the virtual machine migration technology based on the x86 platform is not applicable to the ARM platform.
  • Virtualization research based on ARM platform is still in a relatively blank stage. It is imperative to provide a virtual machine migration method suitable for ARM platform.
  • Embodiments of the present invention provide a virtual machine migration method and apparatus, which are applicable to virtual machine migration based on an ARM platform.
  • the first aspect provides a virtual machine migration method, which is applied to a virtual machine migration apparatus, and the method includes:
  • the migration time reaches the set time, determining a migration policy, where the migration policy is used to migrate the data to be migrated stored in the memory page marked as dirty page in the source virtual machine and not migrated;
  • the data to be migrated stored in the memory page marked as dirty page in the source virtual machine is migrated to the target virtual machine.
  • the method before determining the migration policy, the method further includes:
  • the accumulated transmission data amount being an amount of data migrated within the set time
  • Identify migration strategies including:
  • the migration policy is determined according to the accumulated transmission data amount and the actual transmission bandwidth.
  • determining a migration policy according to the accumulated transmission data volume and the actual transmission bandwidth including:
  • the migration policy is a process of returning the memory page that stores the data to be migrated in the source virtual machine memory as a dirty page, and reaches the increased waiting time in time. Afterwards, the data to be migrated stored in the memory page marked as dirty page is migrated to the target virtual machine;
  • the migration policy is determined based on the number of migrations performed.
  • the determining a migration policy according to the number of performed migrations includes:
  • the migration strategy is determined based on the expected remaining time recorded in the set number of migrations.
  • the determining, according to the expected remaining time recorded in the set migration times, determining a migration policy including:
  • the expected remaining time curve is a graph of the relationship between the expected remaining time and the migration time plotted on the horizontal axis and the expected remaining time as the vertical axis;
  • the migration policy is a process of returning a memory page that stores the data to be migrated in the source virtual machine memory as dirty pages.
  • the data to be migrated stored in the memory page marked as dirty pages is migrated to the target virtual machine in the set time, including:
  • the data to be migrated stored in the memory page marked as dirty page is migrated to the target virtual machine until the migration time reaches the set time;
  • the data to be migrated stored in the memory page marked as dirty page is continued to be migrated to the target virtual machine until the migration time reaches the set time.
  • a virtual machine migration apparatus including a marking unit, a migration unit, and a determining unit, wherein:
  • the marking unit is configured to mark a memory page in the source virtual machine memory that stores data to be migrated as a dirty page;
  • the migration unit is configured to migrate data to be migrated stored in a memory page marked as a dirty page in the marking unit to a target virtual machine within a set time;
  • the determining unit is configured to determine, when the migration time that the migration unit has performed reaches the set time, a migration policy, where the migration policy is used to migrate the memory page in the source virtual machine marked as dirty pages And unmigrated data to be migrated;
  • the migration unit is further configured to migrate, to the target virtual machine, the data to be migrated stored in the memory page marked as a dirty page in the source virtual machine according to the migration policy determined by the determining unit.
  • the determining unit is further configured to:
  • determining an accumulated transmission data amount wherein the accumulated transmission data amount is an amount of data migrated within the set time; determining a ratio between the accumulated transmission data amount and the set time as Actual transmission bandwidth; determining an expected remaining time, which is a time required to migrate the data to be migrated stored in the memory page marked as dirty in the source virtual machine and not migrated;
  • the device further includes a determining unit, wherein the determining unit is configured to:
  • the determining unit is specifically configured to determine a migration policy as follows:
  • the result of the determining by the determining unit is that the expected remaining time is less than a preset maximum down time, determining that the migration policy is to perform migration for shutdown;
  • the determining unit determines a migration policy according to the accumulated transmitted data amount and the actual transmission bandwidth.
  • the determining unit is further configured to:
  • the determining unit is specifically configured to determine a migration policy according to the accumulated sending data amount and the actual transmission bandwidth as follows:
  • the determining unit determines that the accumulated transmission data amount and the actual transmission bandwidth are both smaller than the set value.
  • increase the preset maximum waiting time and determine that the migration policy is to return to execute in the source virtual machine memory.
  • the migration policy is determined according to the number of migrations performed.
  • the determining unit is further configured to:
  • the determining unit is specifically configured to determine a migration policy according to the number of migrations performed as follows:
  • the judgment result of the determining unit is that the number of performed migrations exceeds a preset maximum number of migrations, it is determined that the migration policy is to perform migration for shutdown;
  • the migration policy is determined according to the expected remaining time recorded in the set migration times.
  • the determining unit is further configured to:
  • the determining unit is further configured to:
  • the determining unit is specifically configured to determine a migration policy according to the expected remaining time recorded in the set migration times as follows:
  • determining that the migration policy is a process of returning execution of marking a memory page storing data to be migrated in the source virtual machine memory as a dirty page.
  • the determining unit is further configured to:
  • the determining unit is further configured to:
  • the migration unit is specifically configured to migrate to the target virtual machine within a set time as follows Move the data to be migrated stored in the memory page marked as dirty:
  • the judgment result of the determining unit is that the current accumulated transmission data amount reaches the maximum threshold value, stopping the migration of the data to be migrated stored in the memory page marked as a dirty page to the target virtual machine until the migration time reaches the setting Fixed time
  • the judgment result of the determining unit is that the current accumulated transmission data amount does not reach the maximum threshold value, continue to migrate the data to be migrated stored in the memory page marked as a dirty page to the target virtual machine until the migration time reaches the Set time.
  • the virtual machine migration method and device mark a memory page storing the data to be migrated as a dirty page, and migrate the memory page recorded as a dirty page to the target virtual machine to be migrated within a set time.
  • Data if the migration time reaches the set time, determining a migration policy for migrating the data to be migrated stored in the memory page marked as dirty page in the source virtual machine and not being migrated, that is, in the embodiment of the present invention
  • the migration of the data to be migrated within the set time can limit the migration process, and after the set time is reached, determine the corresponding migration policy, and perform migration of the unmigrated data according to the determined migration policy.
  • the migration strategy is adjusted, so it has the ability to automatically adapt to the network environment, so it is suitable for ARM platforms with relatively complex network environments.
  • FIG. 1 is a flowchart of implementing a virtual machine migration method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a memory page page of an ARM virtual machine according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a process for implementing dirty page tracking and synchronization according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a dirty page bitmap mark according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of flow control according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of an iterative migration control process according to an embodiment of the present invention.
  • FIG. 7 is a comparison diagram of migration performance according to an embodiment of the present invention.
  • FIGS. 8A-8B are schematic diagrams showing the structure of a virtual machine migration apparatus according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a virtual machine migration apparatus according to an embodiment of the present invention.
  • the virtual machine migration method provided by the embodiment of the invention has the capability of automatically adapting to the network environment, and is suitable for virtual machine migration based on the ARM platform.
  • the memory pre-copy method (pre-copy) is used to implement dynamic migration of the virtual machine, that is, the memory page of the source virtual machine storing the data to be migrated is migrated to the target virtual machine by means of iterative transmission. Mark the memory pages in the source VM that store the data to be migrated as dirty pages, and set the corresponding time for each round of migration to migrate the data to be migrated, that is, perform the first migration within the set time.
  • the target VM migrates the data to be migrated stored in the memory page of the dirty page.
  • the data to be migrated for the second migration includes the remaining unmigrated raw data in the first migration, and the data to be migrated stored in the memory page modified in the first migration process, so the second migration is marked.
  • the data to be migrated stored in the memory page of the dirty page and not migrated includes the remaining unmigrated raw data in the first migration, and is modified during the first migration process.
  • FIG. 1 is a flowchart of a process for implementing a virtual machine migration method according to an embodiment of the present invention.
  • the execution entity of the method is a virtual machine migration device, and the virtual machine migration device may be a control with a control function installed on a physical host. For example, it can be a virtual machine monitor.
  • the virtual machine migration device may also be a component in the virtual machine monitor, for example, may be a component integrated in the virtual machine monitor and installed with a software program that performs the corresponding function.
  • the embodiments of the present invention are not limited thereto, and may be other control devices having a management function and capable of performing corresponding functions.
  • the method includes:
  • S101 Mark the memory page storing the data to be migrated in the source virtual machine memory as a dirty page.
  • the source virtual machine In the process of implementing virtual machine dynamic migration, the source virtual machine is still in working state, so the source virtual machine memory page may also be accessed, that is, the memory page of the source virtual machine may be modified, if the modified memory page has been sent to The target virtual machine causes the source virtual machine to be inconsistent with the data stored in the memory page of the target virtual machine. Therefore, if the virtual machine migration performed in the embodiment of the present invention is the first migration, the data to be migrated is the initial data to be migrated stored in the source virtual machine memory and needs to be migrated to the target virtual machine.
  • the migration data includes the initial data to be migrated that was not migrated in the previous migration and the data to be migrated stored in the memory page that was modified during the last migration.
  • the memory pages storing the data to be migrated in the memory of the source virtual machine are all marked as dirty pages, and the dirty pages of the mark are transmitted to the target virtual machine to ensure the consistency of the migration.
  • S102 The data to be migrated stored in the memory page marked as dirty page in S101 is migrated to the target virtual machine within a set time.
  • the migration time for completing the virtual machine migration may be divided into several time slices, and the time slice is the time used for each migration, and the specific time length of each time slice is migrated according to the actual time.
  • the situation is set, and it is determined that after all the set times are migrated each time, the data to be migrated stored in the memory page marked as a dirty page in S101 is migrated within the set time.
  • S103 Determine a migration policy if the migration time reaches a set time.
  • the migration time reaches the set time, which indicates that the migration is completed. After the migration is completed, it is determined that the migration is not performed in the memory page marked as dirty pages in the source virtual machine. Data migration strategy.
  • S104 The data to be migrated stored in the memory page marked as dirty page in the source virtual machine is migrated to the target virtual machine according to the migration policy determined in S103.
  • the virtual machine migration method marks the memory page storing the data to be migrated as a dirty page, and migrates the data to be migrated stored in the memory page marked as a dirty page to the target virtual machine within a set time. If the migration time reaches the set time, the migration policy for migrating the data to be migrated stored in the memory page marked as dirty page in the source virtual machine is not determined, that is, in the embodiment of the present invention
  • the migration of the data to be migrated within a certain period of time can limit the migration process, and after the set time is reached, determine the corresponding migration strategy, and perform migration of the unmigrated data according to the determined migration policy. After the migration is completed, the migration strategy is adjusted, so it has the ability to automatically adapt to the network environment, so it is suitable for the ARM platform with relatively complex network environment.
  • the process of storing the memory page of the data to be migrated in the memory of the source virtual machine as a dirty page may be implemented by using a dirty page bitmap tracking and synchronization mechanism.
  • the page table structure of the virtual machine memory page based on the ARM platform is as shown in FIG. 2.
  • the dirty page can be marked by the setting of the ap[2:1] bit, and the dirty page bitmap tracking and synchronization mechanism is adopted.
  • Implementation will be in the source virtual machine
  • the specific implementation process of storing the memory page of the data to be migrated and marking it as dirty page is as shown in FIG. 3, including:
  • all memory pages storing the initial data to be migrated in the source virtual machine are marked as "dirty page tracking" by marking the mem_slot of the virtual machine monitor in the source virtual machine.
  • the data in the source virtual machine needs to be migrated to the target virtual machine.
  • S1012 Restrict the write permission of all memory pages in the source virtual machine, so that the memory pages in the source virtual machine cannot be accessed.
  • the page directory of the source virtual machine can be accessed, and all the memory pages in the source virtual machine are sequentially traversed, and the ap[2:1] bits of all the memory page entries are set to 11.
  • S1013 Store a bitmap of a dirty page for the kernel layer and the user layer of the source virtual machine, respectively.
  • an alloc function may be used to store a bitmap of a dirty page for the kernel layer and the user layer of the source virtual machine, and the size of the bitmap is the same as the number of memory pages of the source virtual machine, and each bit represents the corresponding memory.
  • the page is a dirty page (modified memory page) or a net page (unmodified memory page), as shown in Figure 4.
  • S1014 Dirty all the locations of the bitmap of the source virtual machine user layer for the first migration, and net all the bitmaps of the source virtual machine kernel layer.
  • bitmap of the kernel layer is merged with the bitmap of the user layer, and the bitmap of the user layer is replaced by the merged bitmap to clear the bitmap of the kernel layer.
  • S1016 Track the modified memory page in the source virtual machine, and mark the corresponding position of the user layer bitmap as a dirty page.
  • the ap[2:1] bit of the memory page entry is set to 01, and the corresponding bitmap of the user layer is marked as dirty.
  • S1017 The data to be migrated stored in the memory page marked as dirty in the user layer is sequentially migrated to the target virtual machine. After the migration succeeds, the page entry of the corresponding user layer is set to be net, and the process returns to S1015 until the migration condition is reached. Conditions for downtime for migration.
  • the memory pages in the source virtual machine are accessed, the memory pages of the source virtual machine and the target virtual machine are inconsistent, and the above-mentioned inconsistent memory page is performed by the dirty page tracking and the dirty page synchronization. Record and transfer to ensure consistency of migration.
  • the embodiment of the present invention implements the process of migrating the data to be migrated stored in the memory page marked as dirty page to the target virtual machine in the set time in S102, and can limit the traffic of the migration process to avoid the ARM processor guaranteeing the service. At the same time, when encountering a lot of page compression and other situations, the bottleneck caused by the processor speed.
  • the flow control is implemented, and the migration process is implemented as shown in FIG. 5, including:
  • the specific length of time used for each migration in the embodiment of the present invention may be set according to actual conditions.
  • an optimal flow limit value in different network environments can be obtained through experiments, and a flow limit value is set.
  • S1023 Determine a maximum threshold value capable of transmitting the data amount in the corresponding time according to the time determined in S1021 and the flow rate limit value set in S1022.
  • S1024 Determine whether the current accumulated transmission data amount reaches the maximum threshold value determined in S1023. If the maximum threshold value has been reached, proceed to S1025a, otherwise proceed to S1025b.
  • S1025a Stops migrating the data to be migrated stored in the memory page marked as dirty page to the target virtual machine until the migration time reaches the time determined in S1021.
  • S1025b Continue to migrate the data to be migrated stored in the memory page marked as dirty page to the target virtual machine until the migration time reaches the time determined in S1021.
  • the ARM processor by restricting the traffic during each migration process, after the migrated data amount reaches the set threshold, the migration is stopped, and the ARM processor can be prevented from being met while ensuring the service.
  • a bottleneck caused by processor speed when a large number of pages are compressed.
  • the load balancing ensures the load balancing between the source virtual machine and the target virtual machine.
  • the traditional virtual machine migration process often fails to complete the migration, or a large amount of useless work leads to loss of migration performance, resulting in a large waste of network bandwidth.
  • the state parameters in each migration process for example, cumulatively The amount of data sent, the actual transmission bandwidth, and the expected remaining time, etc., and after each migration, determine the migration policy based on the recorded state parameters, adapt to changes in the network environment, and complete the migration of the virtual machine.
  • a virtual machine migration method in an adaptive network environment is provided.
  • some reference parameters such as maximum downtime, maximum waiting time, or maximum number of iterations, can be set, and then according to the recorded state parameters. And the set reference parameter is used to determine the migration policy.
  • the specific implementation process of the embodiments S103 to S105 of the present invention may be as shown in FIG. 6, including:
  • the accumulated transmission data amount may be acquired by using, for example, a counter cumulative count.
  • the amount of accumulated transmission data is separately determined for each migration process, that is, the accumulated transmission data amount is the amount of data that is migrated within the time set for each migration.
  • S1032 Determine the migration time used to migrate the accumulated transmission data amount determined in S1031 during the migration.
  • the migration time used for migrating the accumulated transmission data amount determined in S1031 may be obtained by, for example, a timer accumulating timing.
  • S1033 Determine the ratio between the accumulated transmission data amount determined in S1031 and the migration time determined in S1032 as the actual transmission bandwidth.
  • S1034 Determine and record the time required to migrate the data to be migrated stored in the memory page marked as dirty page in the source virtual machine, and determine the time as the expected remaining time of the migration.
  • the expected remaining time of the migration may be determined according to the actual transmission bandwidth determined in S1033 and the data flow corresponding to the data to be migrated stored in the memory page marked as dirty page in the source virtual machine.
  • S1041 Determine whether the expected remaining time determined in S1034 is less than a preset maximum downtime. If the expected remaining time is less than the maximum downtime, it may be determined that the migration strategy is to perform migration for shutdown, that is, execute S105. If the expected remaining time is not less than the maximum downtime, the migration policy may be determined according to the accumulated data volume and the actual transmission bandwidth, and S1042 is performed.
  • S1042 Determine whether the accumulated transmission data amount and the actual transmission bandwidth are both smaller than a set value.
  • the maximum waiting time is too small, and the amount of data to be transmitted is not required. If the accumulated transmission data volume and the actual transmission bandwidth are both smaller than the set value, then S1043 is performed; otherwise, the migration policy may be determined according to the currently executed migration times, and S1044 is performed.
  • S1043 Increasing the preset maximum waiting time, and determining that the migration policy is a process of returning a memory page that stores the data to be migrated in the source virtual machine memory as a dirty page, and after the time reaches an increased waiting time, The target virtual machine migration marks the data to be migrated stored in the memory page of the dirty page, and performs the process of S1031.
  • S1044 Determine whether the number of currently performed migrations exceeds a preset maximum number of migrations.
  • the migration policy may be determined to be down for migration, and S105 is performed; otherwise, the migration may be determined according to the expected remaining time recorded in the set migration times.
  • Strategy execute S1045.
  • S1045 Determine a curve slope value of a variance and an expected remaining time graph of the expected remaining time recorded in the set number of migrations.
  • the variance of the expected remaining time recorded in the set number of migrations may be calculated, for example, determining the expected remaining time recorded in the recent migration process before the execution of the migration, and determining the expected record in the set migration times.
  • the variance of the remaining time, the variance of the expected remaining time may reflect the convergence state of the expected remaining time.
  • the expected remaining time curve is a graph in which the iterative transmission time is the horizontal axis, the expected remaining time is the vertical axis, and the relationship between the expected remaining time and the migration time is plotted, and the slope of the expected remaining time curve reflects the expected remaining The convergence state of time.
  • S1046 Determine whether the expected remaining time converges according to the variance of the expected remaining time and the slope value of the curve determined in S1045. If convergence, it may be determined that the migration strategy is to stop the migration, and S105 is performed; otherwise, the migration policy is determined to be returned to execute the source virtual The process of storing memory pages in the machine's memory to be dirty pages.
  • the actual transmission bandwidth is calculated by using the cumulative transmission data amount and the migration time used to migrate the accumulated transmission data amount in each migration process, and the actual transmission bandwidth and the source virtual machine are marked as dirty pages according to the calculation.
  • the data to be migrated stored in the memory page and not migrated, the expected remaining time is calculated, and then it is judged whether the accumulated transmitted data amount is too low, whether the number of executed migrations is too high, and whether the expected remaining time has a convergence condition or the like.
  • the migration strategy can be adapted to the complex network environment and is suitable for virtual machine migration of the ARM platform.
  • the virtual machine migration method provided by the embodiment of the present invention can better adapt to a complex network environment and improve migration performance. As shown in FIG. 7 , the traditional virtual machine migration method is adopted when the migration bandwidth is 20 Mbps. An experimental comparison diagram of a virtual machine migration method provided by an embodiment of the invention.
  • the abscissa is the number of migration repetitions, and the ordinate is the expected migration time.
  • the migration process is carried out with a total of 575.25 s and the downtime has experienced 207.8 ms. A total of 5,748 iterations.
  • the migration method provided by the embodiment of the present invention the migration process needs to be 234.18s, the downtime is only 104.6ms, and the iteration is 2340 times.
  • the migration performance is improved by using the migration algorithm provided by the embodiment of the present invention, which is optimized and improved, because the network condition is not good and the iteration is repeated many times.
  • the embodiment of the present invention further provides a virtual machine migration apparatus 800.
  • the virtual machine migration apparatus includes a marking unit 801, a migration unit 802, and a determining unit 803. ,among them:
  • the marking unit 801 is configured to mark the memory page in the source virtual machine memory storing the data to be migrated as a dirty page.
  • the migration unit 802 is configured to migrate the data to be migrated stored in the memory page marked as a dirty page in the marking unit 801 to the target virtual machine within a set time.
  • the determining unit 803 is configured to determine a migration policy when the migration time that the migration unit 802 has performed reaches a set time.
  • the migration policy is used to migrate data to be migrated that is stored in a memory page marked as dirty in the source virtual machine and that is not migrated.
  • the migration unit 802 is further configured to migrate, according to the migration policy determined by the determining unit 803, the data to be migrated stored in the memory page of the dirty page marked by the marking unit 801 in the source virtual machine and not migrated to the target virtual machine.
  • the determining unit 803 is further configured to:
  • the cumulative amount of transmitted data is the amount of data migrated within the set time; the ratio between the accumulated transmitted data amount and the set time is determined as Actual transmission bandwidth; determines the expected remaining time, which is the time required to migrate the data to be migrated stored in the memory page marked as dirty in the source virtual machine and not migrated.
  • the device further includes a determining unit 804, as shown in FIG. 8B, wherein the determining unit 804 is configured to determine whether the expected remaining time determined by the determining unit 803 is less than a preset maximum down time.
  • the determining unit 803 is specifically configured to determine a migration policy as follows:
  • the migration strategy is to stop the migration.
  • the migration strategy is determined according to the accumulated transmitted data amount and the actual transmission bandwidth.
  • the determining unit 804 is further configured to: determine whether the accumulated transmission data amount determined by the determining unit 803 and the actual transmission bandwidth are both smaller than a set value.
  • the determining unit 803 is specifically configured to determine a migration policy according to the accumulated sending data volume and the actual transmission bandwidth as follows:
  • the determining unit 804 determines whether the result of the determination by the determining unit 804 is that the accumulated transmission data amount and the actual transmission bandwidth are both smaller than the set value. If the result of the determination by the determining unit 804 is that the accumulated transmission data amount and the actual transmission bandwidth are both smaller than the set value, the preset maximum waiting time is increased, and the migration policy is determined to be returned to perform the storage of the data to be migrated in the source virtual machine memory.
  • the migration policy is determined according to the currently executed number of migrations.
  • the determining unit 804 is further configured to:
  • the determining unit 803 is specifically configured to determine a migration policy according to the number of currently performed migrations as follows:
  • the determining unit 804 determines whether the migration policy is to perform migration for shutdown. If the judgment result of the determining unit 804 is that the number of currently performed migrations exceeds the preset maximum number of migrations, it is determined that the migration policy is to perform migration for shutdown.
  • the migration policy is determined according to the expected remaining time recorded in the set migration times.
  • the determining unit 803 is further configured to:
  • the expected residual time graph is a graph of the relationship between the expected remaining time and the migration time, with the migration time as the horizontal axis and the expected remaining time as the vertical axis.
  • the determining unit 804 is further configured to:
  • the determining unit 803 is specifically configured to set an expected remaining time recorded in the number of migrations as follows, and determine a migration policy:
  • the judgment result of the judgment unit 804 is that the expected remaining time converges, it is determined that the migration strategy is to perform migration for shutdown.
  • the migration policy is a process of returning execution of marking the memory page storing the data to be migrated in the source virtual machine memory as a dirty page.
  • the determining unit 803 is further configured to:
  • the migration unit 802 can transmit the maximum threshold value of the data amount within the set time.
  • the determining unit 804 is further configured to:
  • the migrating unit 802 is specifically configured to migrate the data to be migrated stored in the memory page marked as a dirty page to the target virtual machine in the set time as follows:
  • the migration of the data to be migrated stored in the memory page marked as a dirty page to the target virtual machine is stopped until the migration time reaches the set time.
  • the data to be migrated stored in the memory page marked as dirty page is continued to be migrated to the target virtual machine until the migration time reaches the set time.
  • the virtual machine migration apparatus provided in the embodiment of the present invention may be used to execute the foregoing embodiment of the present invention.
  • the description of the related method embodiment is not described in detail in the description of the virtual machine migration device in the embodiment of the present invention, and details are not described herein again.
  • the virtual machine migration device may be a controller with a management function installed on a physical host, for example, a virtual machine monitor.
  • the virtual machine migration device may also be a component in the virtual machine monitor, for example, may be a component integrated in the virtual machine monitor and installed with a software program that performs the corresponding function.
  • the embodiments of the present invention are not limited thereto, and may be other control devices having a management function and capable of performing corresponding functions.
  • the embodiment of the present invention further provides a virtual machine migration apparatus 900.
  • the virtual machine migration apparatus 900 includes a processor 901, a memory 902, and a bus 903.
  • the processor 901 and the memory 902 are both connected to the bus 903.
  • the processor 901 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more programs for controlling the program of the present invention. Integrated circuit.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • the memory 902 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM), or other information that can store information and instructions.
  • ROM read-only memory
  • RAM random access memory
  • Type of dynamic storage device or Electrostatic Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM) or other optical disc storage, optical disc Storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be Any other medium accessed by the computer, but is not limited to this.
  • EEPROM Electrostatic Erasable Programmable Read-Only Memory
  • CD-ROM Compact Disc Read-Only Memory
  • optical disc Storage including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.
  • Bus 903 can include a path for communication between processor 901 and memory 902.
  • the memory 902 is used to store the program code executed by the processor 901 in the embodiment of the present invention.
  • the processor 901 is configured to call the program code stored in the memory 902 to implement the following functions:
  • the migration policy is determined, and the migration policy is used to migrate the data to be migrated stored in the memory page marked as dirty page in the source virtual machine and not migrated;
  • the data to be migrated stored in the memory page marked as dirty pages in the source virtual machine is migrated to the target virtual machine.
  • the processor 901 is further configured to:
  • the cumulative transmitted data amount is the amount of data migrated within the set time; the ratio between the accumulated transmitted data amount and the set time is determined as the actual transmission bandwidth; determining the expected remaining time The expected time remaining is the time required to migrate the data to be migrated stored in the memory page marked as dirty in the source virtual machine and not migrated.
  • the processor 901 is specifically configured to determine a migration policy as follows:
  • the migration policy is determined based on the cumulative amount of transmitted data and the actual transmission bandwidth.
  • the processor 901 is specifically configured to determine a migration policy according to the cumulative sent data volume and the actual transmission bandwidth as follows:
  • the migration policy is determined based on the number of migrations performed.
  • the processor 901 is specifically configured to determine a migration policy according to the number of migrations performed according to the following manner:
  • the migration strategy is determined based on the expected remaining time recorded in the set number of migrations.
  • the processor 901 is specifically configured to determine a migration policy according to the expected remaining time recorded in the set migration times as follows:
  • the expected residual time graph is a graph showing the relationship between the expected remaining time and the migration time based on the migration time as the horizontal axis and the expected remaining time as the vertical axis;
  • the migration policy is a process of returning a memory page that stores the data to be migrated in the source virtual machine memory as dirty pages.
  • the processor 901 is specifically configured to migrate, to the target virtual machine, the data to be migrated stored in the memory page marked as a dirty page in the set time as follows:
  • the data to be migrated stored in the memory page marked as dirty page is migrated to the target virtual machine until the migration time reaches the set time;
  • the data to be migrated stored in the memory page marked as dirty page is continuously migrated to the target virtual machine until the migration time reaches the set time.
  • the virtual machine migration device marks the memory page storing the data to be migrated as a dirty page, and migrates the data to be migrated stored in the memory page marked as a dirty page to the target virtual machine within a set time. If the migration time reaches the set time, the migration policy for migrating the data to be migrated stored in the memory page marked as dirty page in the source virtual machine and not migrated is determined, that is, in the setting of the embodiment of the present invention
  • the migration of the data to be migrated in the time can limit the migration process, and after the set time is reached, determine the corresponding migration policy, and perform migration of the unmigrated data according to the determined migration policy, which can be completed at the end of each migration. After the adjustment of the migration strategy, it has the ability to automatically adapt to the network environment, so it is suitable for ARM platforms with relatively complex network environments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种虚拟机迁移方法及装置,本发明中将源虚拟机内存中存储待迁移数据的内存页,标记为脏页;在设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据;若迁移时间达到所述设定的时间,则确定迁移策略,所述迁移策略用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据;依据所述迁移策略,将源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据,迁移到目标虚拟机。本发明提供的虚拟机迁移方法能够自适应网络环境,适用于ARM平台。

Description

一种虚拟机迁移方法及装置 技术领域
本发明涉及通信技术领域,尤其涉及一种虚拟机迁移方法及装置。
背景技术
随着科技的不断发展,虚拟化技术作为应用于服务器中的一项关键技术,具有整合异构、便于实时维护与管理、节省功耗及安全性等优势,虚拟化技术的应用也越来越广泛,而虚拟机(Virtual Machine,VM)在线迁移(online migration)技术是虚拟化技术当中的热点。
虚拟机在线迁移技术是指在保证虚拟机上服务正常运行的同时,虚拟机在不同的物理主机之间进行迁移。为了保证虚拟机上服务的可用,迁移过程仅允许非常短暂的切换时间,虚拟机在不同物理主机之间进行迁移时,由于切换的时间非常短暂,虚拟机的服务由源主机迁移到目的主机后,能够平滑运行,使用户感觉不到服务的中断,因而迁移过程对用户是透明的。虚拟机的在线迁移适用于对服务可用性要求很高的场景。
随着ARM(Advanced RISC Machines,高级精简指令集机器)多核技术的日益成熟,及其具有的精简指令集和低功耗等特性,面向ARM平台的虚拟化技术具有较强的技术前瞻性和实用价值。ARM处理器广泛应用于移动终端及嵌入式***中,网络环境往往相对较复杂。然而,目前的虚拟机在线迁移技术,广泛应用于x86平台,x86平台相对ARM平台,网络环境相对简单,故基于x86平台的虚拟机迁移技术并不适用于ARM平台。
基于ARM平台的虚拟化研究尚处于一个相对空白的阶段,提供一种适用于ARM平台的虚拟机迁移方法,势在必行。
发明内容
本发明实施例提供一种虚拟机迁移方法及装置,以适用于基于ARM平台的虚拟机迁移。
第一方面,提供一种虚拟机迁移方法,应用于虚拟机迁移装置,该方法包括:
将源虚拟机内存中存储待迁移数据的内存页,标记为脏页;
在设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据;
若迁移时间达到所述设定的时间,则确定迁移策略,所述迁移策略用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据;
依据所述迁移策略,将源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据,迁移到目标虚拟机。
结合第一方面,在第一种实现方式中,确定迁移策略之前,所述方法还包括:
确定累计发送数据量,所述累计发送数据量为在所述设定时间内迁移的数据量;
将所述累计发送数据量与所述设定时间之间的比值,确定为实际传输带宽;
确定预期剩余时间,所述预期剩余时间为迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据所需的时间;
确定迁移策略,包括:
判断所述预期剩余时间是否小于预设的最大停机时间;
若是,则确定迁移策略为停机进行迁移;
若否,则根据所述累计发送数据量和所述实际传输带宽,确定迁移策略。
结合第一方面的第一种实现方式,在第二种实现方式中,根据所述累计发送数据量和所述实际传输带宽,确定迁移策略,包括:
判断所述累计发送数据量与所述实际传输带宽是否均小于设定值;
若是,则增大预设的最大等待时间,并确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程,并在时间达到所述增大的等待时间后,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据;
若否,则根据已执行的迁移次数确定迁移策略。
结合第一方面的第二种实现方式,在第三种实现方式中,所述根据已执行的迁移次数确定迁移策略,包括:
判断已执行的迁移次数是否超过预设的最大迁移次数;
若超过,则确定迁移策略为停机进行迁移;
若未超过,则根据设定迁移次数中记录的预期剩余时间,确定迁移策略。
结合第一方面的第三种实现方式,在第四种实现方式中,所述根据设定迁移次数中记录的预期剩余时间,确定迁移策略,包括:
确定根据设定迁移次数中记录的预期剩余时间的方差;
确定预期剩余时间曲线图的曲线斜率值,所述预期剩余时间曲线图是以迁移时间为横轴、预期剩余时间为纵轴,绘制的预期剩余时间与迁移时间之间的关系曲线图;
根据所述方差和所述曲线斜率值判断所述预期剩余时间是否收敛;
若收敛,则确定迁移策略为停机进行迁移;
若不收敛,则确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程。
结合第一方面的上述任一种实现方式,在第五种实现方式中,在设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,包括:
根据设定的流量限定值和所述设定的时间,确定在所述设定的时间内能够传送数据量的最大门限值;
判断当前累计发送数据量是否达到所述最大门限值;
若当前累计发送数据量达到所述最大门限值,则停止向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到所述设定的时间;
若当前累计发送数据量未达到所述最大门限值,则继续向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到所述设定的时间。
第二方面,提供一种虚拟机迁移装置,包括标记单元、迁移单元和确定单元,其中:
所述标记单元,用于将源虚拟机内存中存储待迁移数据的内存页,标记为脏页;
所述迁移单元,用于在设定的时间内,向目标虚拟机迁移所述标记单元中标记为脏页的内存页中存储的待迁移数据;
所述确定单元,用于在所述迁移单元已执行的迁移时间达到所述设定的时间时,确定迁移策略,所述迁移策略用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据;
所述迁移单元,还用于依据所述确定单元确定的迁移策略,将源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据,迁移到目标虚拟机。
结合第二方面,在第一种实现方式中,所述确定单元,还用于:
确定迁移策略之前,确定累计发送数据量,所述累计发送数据量为在所述设定时间内迁移的数据量;将所述累计发送数据量与所述设定时间之间的比值,确定为实际传输带宽;确定预期剩余时间,所述预期剩余时间为迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据所需的时间;
所述装置还包括判断单元,其中所述判断单元用于:
判断所述确定单元确定的所述预期剩余时间是否小于预设的最大停机时间;
所述确定单元,具体用于按如下方式确定迁移策略:
若所述判断单元判断的结果为所述预期剩余时间小于预设的最大停机时间,则确定迁移策略为停机进行迁移;
若所述判断单元判断的结果为所述预期剩余时间不小于预设的最大停机时间,则根据所述累计发送数据量和所述实际传输带宽,确定迁移策略。
结合第二方面的第一种实现方式,在第二种实现方式中,所述判断单元,还用于:
判断所述确定单元确定的所述累计发送数据量与所述实际传输带宽是否均小于设定值;
所述确定单元,具体用于按如下方式根据所述累计发送数据量和所述实际传输带宽,确定迁移策略:
若所述判断单元判断的结果为所述累计发送数据量与所述实际传输带宽均小于设定值,则增大预设的最大等待时间,并确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程,并在时间达到所述增大的等待时间后,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据;
若所述判断单元判断的结果为所述累计发送数据量与所述实际传输带宽不是均小于设定值,则根据已执行的迁移次数确定迁移策略。
结合第二方面的第二种实现方式,在第三种实现方式中,所述判断单元,还用于:
判断所述迁移单元已执行的迁移次数是否超过预设的最大迁移次数;
所述确定单元,具体用于按如下方式根据已执行的迁移次数确定迁移策略:
若所述判断单元的判断结果为已执行的迁移次数超过预设的最大迁移次数,则确定迁移策略为停机进行迁移;
若所述判断单元的判断结果为已执行的迁移次数未超过预设的最大迁移次数,则根据设定迁移次数中记录的预期剩余时间,确定迁移策略。
结合第二方面的第三种实现方式,在第四种实现方式中,所述确定单元,还用于:
确定设定迁移次数中记录的预期剩余时间的方差;
确定预期剩余时间曲线图的曲线斜率值,所述预期剩余时间曲线图是以迁移时间为横轴,预期剩余时间为纵轴,绘制的预期剩余时间与迁移时间之间的关系曲线图;
所述判断单元,还用于:
根据所述确定单元确定的所述方差和所述曲线斜率值,判断所述预期剩余时间是否收敛;
所述确定单元,具体用于按如下方式根据设定迁移次数中记录的预期剩余时间,确定迁移策略:
若所述判断单元的判断结果为所述预期剩余时间收敛,则确定迁移策略为停机进行迁移;
若所述判断单元的判断结果为所述预期剩余时间不收敛,则确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程。
结合第二方面的上述任一种实现方式,在第五种实现方式中,所述确定单元,还用于:
根据设定的流量限定值和所述设定的时间,确定所述迁移单元在所述设定的时间内能够传送数据量的最大门限值;
所述判断单元,还用于:
判断当前累计发送数据量是否达到所述确定单元确定的所述最大门限值;
所述迁移单元,具体用于按如下方式在设定的时间内,向目标虚拟机迁 移标记为脏页的内存页中存储的待迁移数据:
若所述判断单元的判断结果为当前累计发送数据量达到所述最大门限值,则停止向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到所述设定的时间;
若所述判断单元的判断结果为当前累计发送数据量未达到所述最大门限值,则继续向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到所述设定的时间。
本发明实施例提供的虚拟机迁移方法和装置,将存储待迁移数据的内存页标记为脏页,并设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,若迁移时间达到所述设定的时间,则确定用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据的迁移策略,即本发明实施例中通过在设定的时间内进行待迁移数据的迁移,能够对迁移过程进行限制,并能够在设定的时间达到后,确定相应的迁移策略,依据确定的迁移策略进行未迁移数据的迁移,能够在每次迁移结束后,进行迁移策略的调整,故具有自动适应网络环境的能力,故适用于网络环境相对较复杂的ARM平台。
附图说明
图1为本发明实施例提供的虚拟机迁移方法实现流程图;
图2为本发明实施例提供的ARM虚拟机内存页页表示意图;
图3为本发明实施例提供的脏页跟踪与同步实现过程示意图;
图4为本发明实施例提供的脏页位图标记示意图;
图5为本发明实施例提供的流量控制示意图;
图6为本发明实施例提供的迭代迁移控制过程示意图;
图7为本发明实施例提供的迁移性能对比图;
图8A-图8B为本发明实施例提供的虚拟机迁移装置构成示意图;
图9为本发明实施例提供的虚拟机迁移装置构成示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例, 并不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供的虚拟机迁移方法,具有自动适应网络环境的能力,适用于基于ARM平台的虚拟机迁移。本发明实施例中采用内存预拷贝方法(pre-copy)实现虚拟机的动态迁移,即通过迭代传输的方式把源虚拟机中存储待迁移数据的内存页一轮轮迁移到目标虚拟机上,将源虚拟机中存储待迁移数据的内存页,标记为脏页,并为每一轮迁移设定相应的时间进行待迁移数据的迁移,即在设定的时间内进行第一次迁移,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,在第一次迁移的时间达到设定的时间后,确定相应的迁移策略,并按照确定的迁移策略进行第二次迁移,第二次迁移的待迁移数据包括第一次迁移中余下的未迁移的原始数据,以及在第一次迁移过程中被修改的内存页中存储的待迁移数据,故第二次迁移中被标记为脏页的内存页中存储的且未迁移的待迁移数据包括第一次迁移中余下的未迁移的原始数据,以及在第一次迁移过程中被修改的内存页中存储的待迁移数据。
图1所示为本发明实施例提供的虚拟机迁移方法实现过程流程图,该方法的执行主体为虚拟机迁移装置,该虚拟机迁移装置可以是一个安装在物理主机上的具有管控功能的控制器,例如可以是虚拟机监控器。当然该虚拟机迁移装置也可以是虚拟机监控器中的部件,例如可以是集成在虚拟机监控器中并安装有执行相应功能的软件程序的部件。当然本发明实施例并不引以为限,还可以是其它具有管控功能,并能够执行相应功能的控制器件。如图1所示,该方法包括:
S101:将源虚拟机内存中存储待迁移数据的内存页,标记为脏页。
在实现虚拟机动态迁移的过程中,源虚拟机仍处于工作状态,故源虚拟机内存页可能还会被访问,即源虚拟机的内存页可能被修改,如果被修改的内存页已经发送到目标虚拟机,则造成源虚拟机与目标虚拟机的内存页中存储的数据不一致。故本发明实施例中若进行的虚拟机迁移是首次迁移,则待迁移数据是源虚拟机内存中存储的需要迁移到目标虚拟机上的初始待迁移数据。本发明实施例中若进行的虚拟机迁移为非首次迁移,则待 迁移数据包括上一次迁移中未迁移的初始待迁移数据以及在上一次迁移过程中被修改的内存页中存储的待迁移数据。
本发明实施例中将源虚拟机内存中存储待迁移数据的内存页,全部标记为脏页,通过将该标记的脏页传输给目标虚拟机,保证迁移的一致性。
S102:在设定的时间内,向目标虚拟机迁移S101中标记为脏页的内存页中存储的待迁移数据。
优选的,本发明实施例中可将完成虚拟机迁移的迁移时间划分为若干个时间片,该时间片即为每次迁移所用的时间,每次迁移所有的时间片的具体时间长度可根据实际情况进行设定,确定了每次迁移所有的设定时间后,则在该设定的时间内迁移S101中标记为脏页的内存页中存储的待迁移数据。
S103:若迁移时间达到设定的时间,则确定迁移策略。
本发明实施例中迁移时间达到设定的时间,表明本次迁移结束,在本次迁移结束后,确定用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据的迁移策略。
S104:依据S103中确定的迁移策略将源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据,迁移到目标虚拟机。
本发明实施例提供的虚拟机迁移方法,将存储待迁移数据的内存页标记为脏页,并设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,若迁移时间达到所述设定的时间,则确定用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据的迁移策略,即本发明实施例中通过在设定的时间内进行待迁移数据的迁移,能够对迁移过程进行限制,并能够在设定的时间达到后,确定相应的迁移策略,依据确定的迁移策略进行未迁移数据的迁移,能够在每次迁移结束后,进行迁移策略的调整,故具有自动适应网络环境的能力,故适用于网络环境相对较复杂的ARM平台。
本发明实施例S101中将源虚拟机内存中存储待迁移数据的内存页,标记为脏页的过程,可采用脏页位图跟踪与同步机制实现。基于ARM平台的虚拟机内存页的页表结构如图2所示,本发明实施例中可通过ap【2:1】位的置位来标记脏页,采用脏页位图跟踪与同步机制,实现将源虚拟机内 存中存储待迁移数据的内存页,标记为脏页的具体实现过程如图3所示,包括:
S1011:标记源虚拟机中存储待迁移初始数据的所有内存页为“脏页跟踪”状态。
本发明实施例中可通过标记源虚拟机中虚拟机监控器的mem_slot,实现将源虚拟机中存储待迁移初始数据的所有内存页标记为“脏页跟踪”状态。
本发明实施例中待迁移初始数据即未进行虚拟机迁移之前,源虚拟机中原本需要迁移到目标虚拟机中的数据。
S1012:限制源虚拟机中所有内存页的写权限,使得源虚拟机中的内存页不能被访问。
本发明实施例中可访问源虚拟机的页目录,依次遍历源虚拟机中的所有内存页,将所有内存页表项的ap【2:1】位置位11。
S1013:为源虚拟机的内核层和用户层分别存储一个脏页的位图。
本发明实施例中可采用例如alloc函数,为源虚拟机的内核层和用户层分别存储一个脏页的位图,位图的大小和源虚拟机内存页的数量相同,每一位代表相应内存页为脏页(被修改过的内存页)或者净页(未被修改过的内存页),如图4所示。
S1014:将源虚拟机用户层的位图所有位置脏进行第一次迁移,并将源虚拟机内核层的位图所有位置净。
S1015:第一次迁移结束后,将内核层的位图与用户层的位图合并,并利用合并后的位图替换用户层的位图,将内核层的位图置净。
S1016:跟踪源虚拟机中被修改过的内存页,并将用户层位图相应位置位,标记为脏页。
本发明实施例中,在源虚拟机的内存页被访问时,表明内存页被修改,则将该内存页表项的ap【2:1】位置位01,标记用户层相应位图为脏。
S1017:将用户层中标记为脏页的内存页中存储的待迁移数据依次向目标虚拟机迁移,迁移成功后将相应的用户层的页表项置位净,返回执行S1015,直至迁移条件达到停机进行迁移的条件。
在实现动态迁移的过程中,源虚拟机中的内存页被访问时,造成源虚拟机和目标虚拟机的内存页不一致,本发明上述通过脏页跟踪与脏页同步对该不一致的内存页进行记录与传输,保证迁移的一致性。
本发明实施例实现S102中在设定的时间内向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据的过程,可以对迁移过程的流量进行限定,以避免ARM处理器在保证服务的同时,又遇到大量页面压缩等情况时,处理器速度造成的瓶颈问题。
本发明实施例中通过流量控制,实现迁移过程实现如图5所示,包括:
S1021:确定每次迁移所用时间。
本发明实施例中每次迁移所用的具体时间长度可根据实际情况进行设定。
S1022:设定流量限定值。
本发明实施例中还可通过实验得到不同网络环境下的最佳流量限定值,设定流量限定值。
S1023:根据S1021中确定的时间和S1022中设定的流量限定值,确定相应的时间内能够传送数据量的最大门限值。
S1024:判断当前累计发送数据量是否到达S1023中确定的最大门限值,若已达到最大门限值,则进行S1025a,否则进行S1025b。
S1025a:停止向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到S1021中确定的时间。
S1025b:继续向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到S1021中确定的时间。
本发明实施例上述通过对每次迁移过程中的流量进行限制,在已迁移的数据量达到设定的门限值后,则停止迁移,能够避免ARM处理器在保证服务的同时,又遇到大量页面压缩等情况时,处理器速度造成的瓶颈问题。通过流量控制保证源虚拟机与目标虚拟机的负载均衡。
在网络环境相对较复杂的场景下,传统的虚拟机迁移过程中,往往无法完成迁移,或做大量的无用功导致迁移性能损失,造成较大的网络带宽浪费。本发明实施例中通过记录每次迁移过程中的状态参数,例如累计发 送数据量、实际传输带宽以及预期剩余时间等,并在每次迁移结束后,根据记录的状态参数确定迁移策略,适应网络环境变化,并完成虚拟机的迁移。
本发明实施例中提供一种自适应网络环境的虚拟机迁移方法,本发明中可设置一些参考参数,例如能够容忍的最大停机时间、最大等待时间或最大迭代次数等,然后根据记录的状态参数以及设置的参考参数,确定迁移策略,本发明实施例S103至S105的具体实现过程可如图6所示,包括:
S1031:确定累计发送数据量。
本发明实施例中可以采用例如计数器累计记数的方式,获取累计发送数据量。
本发明实施例中针对每次迁移过程中分别进行累计发送数据量的确定,即累计发送数据量为在为每次迁移设定的时间内迁移的数据量。
S1032:确定本次迁移过程中迁移S1031中确定的累计发送数据量所用的迁移时间。
本发明实施例中可以采用例如计时器累计计时的方式,得到迁移S1031中确定的累计发送数据量所用的迁移时间。
S1033:将S1031中确定的累计发送数据量与S1032中确定的迁移时间之间的比值,确定为实际传输带宽。
S1034:确定并记录迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据所需的时间,将确定的该时间作为迁移的预期剩余时间。
本发明实施例中可根据S1033中确定的实际传输带宽,以及源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据对应的数据流,确定迁移的预期剩余时间。
S1040:确定本次迁移结束。
S1041:判断S1034中确定的预期剩余时间是否小于预设的最大停机时间,若预期剩余时间小于最大停机时间,则可确定迁移策略为停机进行迁移,即执行S105。若预期剩余时间不小于最大停机时间,则可根据累计发送数据量和实际传输带宽,确定迁移策略,执行S1042。
S1042:判断累计发送数据量与实际传输带宽是否均小于设定值。
本发明实施例中若累计发送数据量与实际传输带宽均小于设定值,则说明在迁移过程中最大等待时间设置的过小,传送的数据量达不到要求,故本发明实施例中若累计发送数据量与实际传输带宽均小于设定值,则执行S1043,否则可根据当前已执行的迁移次数确定迁移策略,执行S1044。
S1043:增大预设的最大等待时间,并确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程,并在时间达到增大的等待时间后,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,并执行S1031的过程。
S1044:判断当前已执行的迁移次数是否超过预设的最大迁移次数。
本发明实施例中若确定当前已执行的迁移次数超过预设的最大迁移次数,则可确定迁移策略为停机进行迁移,执行S105,否则可根据设定迁移次数中记录的预期剩余时间,确定迁移策略,执行S1045。
S1045:确定设定迁移次数中记录的预期剩余时间的方差和预期剩余时间曲线图的曲线斜率值。
本发明实施例中可计算设定迁移次数内记录的预期剩余时间的方差,例如确定本次迁移执行前的就近几次迁移过程中记录的预期剩余时间,并确定设定迁移次数中记录的预期剩余时间的方差,预期剩余时间的方差可反映预期剩余时间的收敛状态。
本发明实施例中预期剩余时间曲线图是以迭代传输时间为横轴,预期剩余时间为纵轴,绘制的预期剩余时间与迁移时间之间关系曲线图,预期剩余时间曲线的斜率可反映预期剩余时间的收敛状态。
S1046:根据S1045中确定的预期剩余时间的方差和曲线斜率值,判断预期剩余时间是否收敛,若收敛,则可确定迁移策略为停机进行迁移,执行S105,否则确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程。
本发明实施例在每次迁移过程中,利用累计发送数据量和迁移该累计发送数据量所用的迁移时间来计算实际传输带宽,并根据计算得到的实际传输带宽和源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据,计算预期剩余时间,随后判断累计发送数据量是否过低,已执行的迁移次数是否过高,以及预期剩余时间是否存在收敛状况等情况,进行相应 迁移策略的调整,能够自适应复杂的网络环境,适用于ARM平台的虚拟机迁移。
采用本发明实施例提供的虚拟机迁移方法,能够较好的适应复杂的网络环境,提高迁移性能,如图7所示为在迁移带宽为20Mbps的情况下,采用传统虚拟机迁移方法,和本发明实施例提供的虚拟机迁移方法的实验对比图。
图7中横坐标为迁移重复次数,纵坐标为预期迁移时间,由图7可知,在迁移带宽为20Mbps的情况下,采用传统迁移方法,迁移过程共进行了575.25s,停机时间经历了207.8ms,共迭代了5748次。采用本发明实施例提供的迁移方法,迁移过程进行了需要234.18s,停机时间也只有104.6ms,迭代了2340次。采用传统迁移方法,由于网络状况不佳,迭代很多次而无法完成迁移,而采用优化改进后的本发明发明实施例提供的迁移算法,迁移性能得到了提高。
基于本发明上述实施例提供的虚拟机迁移方法,本发明实施例还提供一种虚拟机迁移装置800,如图8A所示,该虚拟机迁移装置包括标记单元801、迁移单元802和确定单元803,其中:
标记单元801,用于将源虚拟机内存中存储待迁移数据的内存页,标记为脏页。
迁移单元802,用于在设定的时间内,向目标虚拟机迁移标记单元801中标记为脏页的内存页中存储的待迁移数据。
确定单元803,用于在迁移单元802已执行的迁移时间达到设定的时间时,确定迁移策略。迁移策略用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据。
迁移单元802,还用于依据确定单元803确定的迁移策略,将源虚拟机中标记单元801标记为脏页的内存页中存储的且未迁移的待迁移数据,迁移到目标虚拟机。
在第一种实现方式中,确定单元803,还用于:
确定迁移策略之前,确定累计发送数据量,累计发送数据量为在设定时间内迁移的数据量;将累计发送数据量与设定时间之间的比值,确定为 实际传输带宽;确定预期剩余时间,预期剩余时间为迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据所需的时间。
该装置还包括判断单元804,如图8B所示,其中,判断单元804,用于判断确定单元803确定的预期剩余时间是否小于预设的最大停机时间。
确定单元803,具体用于按如下方式确定迁移策略:
若判断单元804判断的结果为预期剩余时间小于预设的最大停机时间,则确定迁移策略为停机进行迁移。
若判断单元804判断的结果为预期剩余时间不小于预设的最大停机时间,则根据累计发送数据量和实际传输带宽,确定迁移策略。
结合第一种实现方式,在第二种实现方式中,
判断单元804,还用于:判断确定单元803确定的累计发送数据量与实际传输带宽是否均小于设定值。
确定单元803,具体用于按如下方式根据累计发送数据量和实际传输带宽,确定迁移策略:
若判断单元804判断的结果为累计发送数据量与实际传输带宽均小于设定值,则增大预设的最大等待时间,并确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程,并在时间达到增大的等待时间后,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据。
若判断单元804判断的结果为累计发送数据量与实际传输带宽不是均小于设定值,则根据当前已执行的迁移次数确定迁移策略。
结合第二种实现方式,在第三种实现方式中,判断单元804,还用于:
判断迁移单元802已执行的迁移次数是否超过预设的最大迁移次数。
确定单元803,具体用于按如下方式根据当前已执行的迁移次数确定迁移策略:
若判断单元804的判断结果为当前已执行的迁移次数超过预设的最大迁移次数,则确定迁移策略为停机进行迁移。
若判断单元804的判断结果为当前已执行的迁移次数未超过预设的最大迁移次数,则根据设定迁移次数中记录的预期剩余时间,确定迁移策略。
结合第三种实现方式,在第四种实现方式中,确定单元803,还用于:
确定设定迁移次数中记录的预期剩余时间的方差。
确定预期剩余时间曲线图的曲线斜率值,预期剩余时间曲线图是以迁移时间为横轴,预期剩余时间为纵轴,绘制的预期剩余时间与迁移时间之间关系曲线图。
判断单元804,还用于:
根据确定单元803确定的方差和曲线斜率值,判断预期剩余时间是否收敛。
确定单元803,具体用于按如下方式设定迁移次数中记录的预期剩余时间,确定迁移策略:
若判断单元804的判断结果为预期剩余时间收敛,则确定迁移策略为停机进行迁移。
若判断单元804的判断结果为预期剩余时间不收敛,则确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程。
在第五种实现方式中,确定单元803,还用于:
根据设定的流量限定值和设定的时间,确定迁移单元802在设定的时间内能够传送数据量的最大门限值。
判断单元804,还用于:
判断当前累计发送数据量是否达到确定单元803确定的最大门限值。
迁移单元802,具体用于按如下方式在设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据:
若判断单元804的判断结果为当前累计发送数据量达到最大门限值,则停止向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到设定的时间。
若判断单元804的判断结果为当前累计发送数据量未达到最大门限值,则继续向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到设定的时间。
本发明实施例提供的虚拟机迁移装置,可用于执行本发明实施例上述 虚拟机迁移方法,故对本发明实施例中对于虚拟机迁移装置描述不够详尽的地方,可参阅相关方法实施例的描述,在此不再赘述。
本发明实施例上述虚拟机迁移装置可以是一个安装在物理主机上的具有管控功能的控制器,例如可以是虚拟机监控器。当然该虚拟机迁移装置也可以是虚拟机监控器中的部件,例如可以是集成在虚拟机监控器中并安装有执行相应功能的软件程序的部件。当然本发明实施例并不引以为限,还可以是其它具有管控功能,并能够执行相应功能的控制器件。
基于上述实施例提供的虚拟机迁移方法和装置,本发明实施例还提供一种虚拟机迁移装置900,如图9所示,该虚拟机迁移装置900包括处理器901、存储器902和总线903,其中处理器901和存储器902均与总线903连接。
本发明实施例中处理器901可以是一个通用中央处理器(CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本发明方案程序执行的集成电路。
存储器902,可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。这些存储器通过总线与处理器相连接。
总线903可包括一通路,用于处理器901和存储器902之间通信。
本发明实施例中存储器902,用于存储处理器901执行的程序代码。
处理器901,用于调用存储器902存储的程序代码,实现如下功能:
将源虚拟机内存中存储待迁移数据的内存页,标记为脏页;
在设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待 迁移数据;
若迁移时间达到设定的时间,则确定迁移策略,迁移策略用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据;
依据迁移策略,将源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据,迁移到目标虚拟机。
处理器901,还用于:
确定迁移策略之前,确定累计发送数据量,累计发送数据量为在设定时间内迁移的数据量;将累计发送数据量与设定时间之间的比值,确定为实际传输带宽;确定预期剩余时间,预期剩余时间为迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据所需的时间。
处理器901,具体用于按如下方式确定迁移策略,包括:
判断预期剩余时间是否小于预设的最大停机时间;
若是,则确定迁移策略为停机进行迁移;
若否,则根据累计发送数据量和实际传输带宽,确定迁移策略。
处理器901,具体用于按如下方式根据累计发送数据量和实际传输带宽,确定迁移策略:
判断累计发送数据量与实际传输带宽是否均小于设定值;
若是,则增大预设的最大等待时间,并确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程,并在时间达到增大的等待时间后,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据;
若否,则根据已执行的迁移次数确定迁移策略。
处理器901,具体用于按如下方式根据根据已执行的迁移次数确定迁移策略:
判断已执行的迁移次数是否超过预设的最大迁移次数;
若超过,则确定迁移策略为停机进行迁移;
若未超过,则根据设定迁移次数中记录的预期剩余时间,确定迁移策略。
处理器901,具体用于按如下方式根据设定迁移次数中记录的预期剩余时间,确定迁移策略:
确定根据设定迁移次数中记录的预期剩余时间的方差;
确定预期剩余时间曲线图的曲线斜率值,预期剩余时间曲线图是以迁移时间为横轴、预期剩余时间为纵轴,绘制的预期剩余时间与迁移时间之间的关系曲线图;
根据方差和曲线斜率值判断预期剩余时间是否收敛;
若收敛,则确定迁移策略为停机进行迁移;
若不收敛,则确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程。
处理器901,具体用于按如下方式在设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据:
根据设定的流量限定值和设定的时间,确定在设定的时间内能够传送数据量的最大门限值;
判断当前累计发送数据量是否达到最大门限值;
若当前累计发送数据量达到最大门限值,则停止向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到设定的时间;
若当前累计发送数据量未达到最大门限值,则继续向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到设定的时间。
本发明实施例提供的虚拟机迁移装置,将存储待迁移数据的内存页标记为脏页,并设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,若迁移时间达到设定的时间,则确定用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据的迁移策略,即本发明实施例中通过在设定的时间内进行待迁移数据的迁移,能够对迁移过程进行限制,并能够在设定的时间达到后,确定相应的迁移策略,依据确定的迁移策略进行未迁移数据的迁移,能够在每次迁移结束后,进行迁移策略的调整,故具有自动适应网络环境的能力,故适用于网络环境相对较复杂的ARM平台。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离 本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (12)

  1. 一种虚拟机迁移方法,应用于虚拟机迁移装置,其特征在于,包括:
    将源虚拟机内存中存储待迁移数据的内存页,标记为脏页;
    在设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据;
    若迁移时间达到所述设定的时间,则确定迁移策略,所述迁移策略用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据;
    依据所述迁移策略,将源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据,迁移到目标虚拟机。
  2. 如权利要求1所述的方法,其特征在于,确定迁移策略之前,所述方法还包括:
    确定累计发送数据量,所述累计发送数据量为在所述设定时间内迁移的数据量;
    将所述累计发送数据量与迁移所述累计发送数据量所用的迁移时间之间的比值,确定为实际传输带宽;
    确定预期剩余时间,所述预期剩余时间为迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据所需的时间;
    确定迁移策略,包括:
    判断所述预期剩余时间是否小于预设的最大停机时间;
    若是,则确定迁移策略为停机进行迁移;
    若否,则根据所述累计发送数据量和所述实际传输带宽,确定迁移策略。
  3. 如权利要求2所述的方法,其特征在于,根据所述累计发送数据量和所述实际传输带宽,确定迁移策略,包括:
    判断所述累计发送数据量与所述实际传输带宽是否均小于设定值;
    若是,则增大预设的最大等待时间,并确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程,并在时间达到所述增大的等待时间后,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据;
    若否,则根据已执行的迁移次数确定迁移策略。
  4. 如权利要求3所述的方法,其特征在于,所述根据已执行的迁移次数确定迁移策略,包括:
    判断已执行的迁移次数是否超过预设的最大迁移次数;
    若超过,则确定迁移策略为停机进行迁移;
    若未超过,则根据设定迁移次数中记录的预期剩余时间,确定迁移策略。
  5. 如权利要求4所述的方法,其特征在于,所述根据设定迁移次数中记录的预期剩余时间,确定迁移策略,包括:
    确定设定迁移次数中记录的预期剩余时间的方差;
    确定预期剩余时间曲线图的曲线斜率值,所述预期剩余时间曲线图是以迁移时间为横轴、预期剩余时间为纵轴,绘制的预期剩余时间与迁移时间之间的关系曲线图;
    根据所述方差和所述曲线斜率值判断所述预期剩余时间是否收敛;
    若收敛,则确定迁移策略为停机进行迁移;
    若不收敛,则确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程。
  6. 如权利要求1至5任一项所述的方法,其特征在于,在设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,包括:
    根据设定的流量限定值和所述设定的时间,确定在所述设定的时间内能够传送数据量的最大门限值;
    判断当前累计发送数据量是否达到所述最大门限值;
    若当前累计发送数据量达到所述最大门限值,则停止向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到所述设定的时间;
    若当前累计发送数据量未达到所述最大门限值,则继续向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到所述设定的时间。
  7. 一种虚拟机迁移装置,其特征在于,包括标记单元、迁移单元和确定单元,其中:
    所述标记单元,用于将源虚拟机内存中存储待迁移数据的内存页,标 记为脏页;
    所述迁移单元,用于在设定的时间内,向目标虚拟机迁移所述标记单元中标记为脏页的内存页中存储的待迁移数据;
    所述确定单元,用于在所述迁移单元已执行的迁移时间达到所述设定的时间时,确定迁移策略,所述迁移策略用于迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据;
    所述迁移单元,还用于依据所述确定单元确定的迁移策略,将源虚拟机中标记单元标记为脏页的内存页中存储的且未迁移的待迁移数据,迁移到目标虚拟机。
  8. 如权利要求7所述的装置,其特征在于,所述确定单元,还用于:
    确定迁移策略之前,确定累计发送数据量,所述累计发送数据量为在所述设定时间内迁移的数据量;将所述累计发送数据量与所述设定时间之间的比值,确定为实际传输带宽;确定预期剩余时间,所述预期剩余时间为迁移源虚拟机中标记为脏页的内存页中存储的且未迁移的待迁移数据所需的时间;
    所述装置还包括判断单元,其中所述判断单元用于:
    判断所述确定单元确定的所述预期剩余时间是否小于预设的最大停机时间;
    所述确定单元,具体用于按如下方式确定迁移策略:
    若所述判断单元判断的结果为所述预期剩余时间小于预设的最大停机时间,则确定迁移策略为停机进行迁移;
    若所述判断单元判断的结果为所述预期剩余时间不小于预设的最大停机时间,则根据所述累计发送数据量和所述实际传输带宽,确定迁移策略。
  9. 如权利要求8所述的装置,其特征在于,所述判断单元,还用于:
    判断所述确定单元确定的所述累计发送数据量与所述实际传输带宽是否均小于设定值;
    所述确定单元,具体用于按如下方式根据所述累计发送数据量和所述实际传输带宽,确定迁移策略:
    若所述判断单元判断的结果为所述累计发送数据量与所述实际传输带宽均小于设定值,则增大预设的最大等待时间,并确定迁移策略为返回 执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程,并在时间达到所述增大的等待时间后,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据;
    若所述判断单元判断的结果为所述累计发送数据量与所述实际传输带宽不是均小于设定值,则根据已执行的迁移次数确定迁移策略。
  10. 如权利要求9所述的装置,其特征在于,所述判断单元,还用于:
    判断所述迁移单元已执行的迁移次数是否超过预设的最大迁移次数;
    所述确定单元,具体用于按如下方式根据已执行的迁移次数确定迁移策略:
    若所述判断单元的判断结果为已执行的迁移次数超过预设的最大迁移次数,则确定迁移策略为停机进行迁移;
    若所述判断单元的判断结果为已执行的迁移次数未超过预设的最大迁移次数,则根据设定迁移次数中记录的预期剩余时间,确定迁移策略。
  11. 如权利要求10所述的装置,其特征在于,所述确定单元,还用于:
    确定设定迁移次数中记录的预期剩余时间的方差;
    确定预期剩余时间曲线图的曲线斜率值,所述预期剩余时间曲线图是以迁移时间为横轴,预期剩余时间为纵轴,绘制的预期剩余时间与迁移时间之间的关系曲线图;
    所述判断单元,还用于:
    根据所述确定单元确定的所述方差和所述曲线斜率值,判断所述预期剩余时间是否收敛;
    所述确定单元,具体用于按如下方式根据设定迁移次数中记录的预期剩余时间,确定迁移策略:
    若所述判断单元的判断结果为所述预期剩余时间收敛,则确定迁移策略为停机进行迁移;
    若所述判断单元的判断结果为所述预期剩余时间不收敛,则确定迁移策略为返回执行将源虚拟机内存中存储待迁移数据的内存页标记为脏页的过程。
  12. 如权利要求7至11任一项所述的装置,其特征在于,所述确定单元,还用于:
    根据设定的流量限定值和所述设定的时间,确定所述迁移单元在所述设定的时间内能够传送数据量的最大门限值;
    所述判断单元,还用于:
    判断当前累计发送数据量是否达到所述确定单元确定的所述最大门限值;
    所述迁移单元,具体用于按如下方式在设定的时间内,向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据:
    若所述判断单元的判断结果为当前累计发送数据量达到所述最大门限值,则停止向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到所述设定的时间;
    若所述判断单元的判断结果为当前累计发送数据量未达到所述最大门限值,则继续向目标虚拟机迁移标记为脏页的内存页中存储的待迁移数据,直至迁移时间达到所述设定的时间。
PCT/CN2015/075701 2014-07-15 2015-04-01 一种虚拟机迁移方法及装置 WO2016008316A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410337060.2A CN105446790B (zh) 2014-07-15 2014-07-15 一种虚拟机迁移方法及装置
CN201410337060.2 2014-07-15

Publications (1)

Publication Number Publication Date
WO2016008316A1 true WO2016008316A1 (zh) 2016-01-21

Family

ID=55077885

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/075701 WO2016008316A1 (zh) 2014-07-15 2015-04-01 一种虚拟机迁移方法及装置

Country Status (2)

Country Link
CN (1) CN105446790B (zh)
WO (1) WO2016008316A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909442A (zh) * 2017-02-28 2017-06-30 郑州云海信息技术有限公司 一种Linux虚拟机迁移方法及***
CN110543860A (zh) * 2019-09-05 2019-12-06 燕山大学 基于tjm迁移学习的机械故障诊断方法及***
CN112559116A (zh) * 2019-09-25 2021-03-26 阿里巴巴集团控股有限公司 内存迁移方法、装置及计算设备
CN112764879A (zh) * 2021-01-14 2021-05-07 深圳市科思科技股份有限公司 负载均衡方法、电子设备及计算机可读存储介质

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874070A (zh) * 2017-02-24 2017-06-20 郑州云海信息技术有限公司 一种虚拟机的迁移方法及装置
CN107085534B (zh) * 2017-03-30 2020-06-23 联想(北京)有限公司 一种信息处理方法及电子设备
CN107133093A (zh) * 2017-06-02 2017-09-05 郑州云海信息技术有限公司 一种虚拟机的在线迁移方法及装置
CN107704311A (zh) * 2017-09-27 2018-02-16 郑州云海信息技术有限公司 一种虚拟机内存迁移方法及其装置
CN110392025B (zh) * 2018-04-20 2022-03-25 伊姆西Ip控股有限责任公司 管理分布式***的方法、设备和计算机可读介质
CN109343793B (zh) * 2018-09-11 2021-09-07 创新先进技术有限公司 数据迁移方法及装置
CN109325344A (zh) * 2018-09-13 2019-02-12 郑州云海信息技术有限公司 一种云环境中防御侧信道攻击的虚拟机迁移方法及***
CN111078248A (zh) * 2019-10-30 2020-04-28 烽火通信科技股份有限公司 一种云平台的升级方法、装置及存储介质
CN111611055B (zh) * 2020-05-27 2020-12-18 上海有孚智数云创数字科技有限公司 一种虚拟设备最优空闲时间迁移法、装置及可读存储介质
CN112162855B (zh) * 2020-09-21 2022-07-29 南开大学 基于页锁定内存的gpu页缺失处理方法、***及介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521038A (zh) * 2011-12-06 2012-06-27 北京航空航天大学 基于分布式文件***的虚拟机迁移方法和装置
CN102611622A (zh) * 2012-02-28 2012-07-25 清华大学 一种弹性云计算平台下工作负载的调度方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060069761A1 (en) * 2004-09-14 2006-03-30 Dell Products L.P. System and method for load balancing virtual machines in a computer network
US20080127182A1 (en) * 2006-11-29 2008-05-29 Newport William T Managing Memory Pages During Virtual Machine Migration
CN101593133B (zh) * 2009-06-29 2012-07-04 北京航空航天大学 虚拟机资源负载均衡方法及装置
CN102932418B (zh) * 2012-09-27 2015-04-15 东软集团股份有限公司 一种云应用部署方法和装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521038A (zh) * 2011-12-06 2012-06-27 北京航空航天大学 基于分布式文件***的虚拟机迁移方法和装置
CN102611622A (zh) * 2012-02-28 2012-07-25 清华大学 一种弹性云计算平台下工作负载的调度方法

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909442A (zh) * 2017-02-28 2017-06-30 郑州云海信息技术有限公司 一种Linux虚拟机迁移方法及***
CN110543860A (zh) * 2019-09-05 2019-12-06 燕山大学 基于tjm迁移学习的机械故障诊断方法及***
CN112559116A (zh) * 2019-09-25 2021-03-26 阿里巴巴集团控股有限公司 内存迁移方法、装置及计算设备
CN112559116B (zh) * 2019-09-25 2024-05-07 阿里巴巴集团控股有限公司 内存迁移方法、装置及计算设备
CN112764879A (zh) * 2021-01-14 2021-05-07 深圳市科思科技股份有限公司 负载均衡方法、电子设备及计算机可读存储介质

Also Published As

Publication number Publication date
CN105446790B (zh) 2019-10-18
CN105446790A (zh) 2016-03-30

Similar Documents

Publication Publication Date Title
WO2016008316A1 (zh) 一种虚拟机迁移方法及装置
KR102362045B1 (ko) 멀티-티어 올-플래시 데이터센터의 자동 데이터 배치 관리자
US20190265995A1 (en) System and method for binary throttling for live migration of virtual machines
KR101764085B1 (ko) 개별 데이터 볼륨들에 대한 내구성 특성들을 동적으로 수정하기
US9122503B1 (en) Systems and methods for adaptive throttling of input/output requests in a virtual environment
CA2894936C (en) Controller, flash memory apparatus, and method for writing data into flash memory apparatus
US11609884B2 (en) Intelligent file system with transparent storage tiering
US10768823B2 (en) Flow control for unaligned writes in network storage device
US8498966B1 (en) Systems and methods for adaptively performing backup operations
US10552200B2 (en) System and method for dynamic throttling for live migration of virtual machines
KR102318477B1 (ko) Ssd 어레이 관리를 위한 스트림 식별자 기반 스토리지 시스템
US20130006948A1 (en) Compression-aware data storage tiering
US11003359B2 (en) Method and device for managing disk pool
US10824362B2 (en) File migration to persistent memory
WO2012063334A1 (ja) 仮想マシンのライブマイグレーションを支援するためのメモリ制御装置及びi/oスイッチ
EP2927779B1 (en) Disk writing method for disk arrays and disk writing device for disk arrays
US11204702B2 (en) Storage domain growth management
US8447894B2 (en) Upgrading an elastic computing cloud system
WO2021104383A1 (zh) 数据备份的方法和装置、设备和存储介质
US10552209B2 (en) System and method for throttling for live migration of virtual machines
US20170010992A1 (en) Power saving feature for storage subsystems
US11003379B2 (en) Migration control apparatus and migration control method
US11500577B2 (en) Method, electronic device, and computer program product for data processing
US10895997B2 (en) Durable client-side caching for distributed storage
CN103593227A (zh) 在客户端运行桌面虚拟***的方法及客户端

Legal Events

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

Ref document number: 15822330

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15822330

Country of ref document: EP

Kind code of ref document: A1