CN116069450A - Migration mode decision method, device, equipment and medium for virtual machine thermomigration - Google Patents

Migration mode decision method, device, equipment and medium for virtual machine thermomigration Download PDF

Info

Publication number
CN116069450A
CN116069450A CN202310200937.2A CN202310200937A CN116069450A CN 116069450 A CN116069450 A CN 116069450A CN 202310200937 A CN202310200937 A CN 202310200937A CN 116069450 A CN116069450 A CN 116069450A
Authority
CN
China
Prior art keywords
memory
migrated
migration
virtual machine
increment rate
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.)
Pending
Application number
CN202310200937.2A
Other languages
Chinese (zh)
Inventor
刘海伟
颜秉珩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202310200937.2A priority Critical patent/CN116069450A/en
Publication of CN116069450A publication Critical patent/CN116069450A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a migration mode decision method, device, equipment and medium for virtual machine thermomigration, which relate to the technical field of virtual machines and comprise the following steps: determining the increment rate of the memory to be migrated in the virtual machine to be migrated; judging whether the memory increment rate is larger than a preset memory increment rate threshold value or not, and judging whether the migration network is stable or not based on a preset network judgment mode; if the memory increment rate is greater than a preset memory increment rate threshold and the migration network is stable, migrating the memory to be migrated from the source host to the destination host in a post-copy mode; if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrating the memory to be migrated from the source host to the destination host in a pre-copy mode. According to the method and the device, the migration mode of the virtual machine is flexibly set according to the memory increment rate and the migration network, so that the total time of thermal migration and the migration downtime are shortened, and the migration efficiency and the migration success rate are improved.

Description

Migration mode decision method, device, equipment and medium for virtual machine thermomigration
Technical Field
The present invention relates to the field of virtual machine technologies, and in particular, to a migration mode decision method, apparatus, device, and medium for virtual machine thermomigration.
Background
The virtual machine hot migration is a key technology in the field of virtualization, and is generally to migrate an operating virtual machine from a source physical machine to a target physical machine under the condition of not affecting user service or not perceived by a user, so that dynamic balance of resources can be realized or maintenance can be performed on a host machine under the condition of not interrupting service. The total time of the thermal migration and the downtime of the virtual machine (at a certain moment, the virtual machine is suspended and does not process the service request of the virtual machine, which is also called downtime, usually about tens or hundreds of milliseconds) are two important indexes in the thermal migration process, and how to reduce the total time of the thermal migration and the downtime of the virtual machine is an important problem in the thermal migration of the virtual machine.
To solve the above-mentioned problems, many methods and means have been proposed in the field of virtualization. For example: the method is suitable for scenes with small memory increment change, can shorten total migration time by a compression algorithm, but is not suitable for virtual machine services with large memory pressure. When the memory variation of the virtual machine is large, the iterative migration of each page of memory may not always be converged, resulting in long total migration time and long migration downtime. For example: training an intelligent model in advance, inputting various parameters into the intelligent model according to different scenes, and determining a thermal migration method with the shortest time consumption, wherein the method requires two preconditions: 1. classifying the target virtual machines, such as computationally intensive, IO intensive and the like; 2. and carrying out reasoning training on the model in advance to obtain an intelligent model. Based on this, this approach is often inflexible in practical applications. Because some virtual machine traffic may be computationally intensive at 9-12 am; the period from 12 pm to 4 pm is IO intensive, which type of the virtual machine is difficult to define in advance, and the intelligent model cannot be determined in advance.
Therefore, how to shorten the total time and the migration downtime of the thermal migration and to improve the migration efficiency and the migration success rate is a problem to be solved in the art.
Disclosure of Invention
In view of the above, the present invention aims to provide a migration mode decision method, device, equipment and medium for virtual machine thermomigration, which can shorten total thermomigration time and migration downtime, and improve migration efficiency and migration success rate, and the specific scheme is as follows:
in a first aspect, the present application discloses a migration mode decision method for virtual machine thermomigration, including:
determining the increment rate of the memory to be migrated in the virtual machine to be migrated;
judging whether the memory increment rate is larger than a preset memory increment rate threshold value or not, and judging whether a migration network is stable or not based on a preset network judgment mode;
if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrating the memory to be migrated from a source host to a destination host in a post-copy mode;
and if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrating the memory to be migrated from the source host to the destination host in a pre-copy mode.
Optionally, before determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated, the method further includes:
judging whether a virtual disk to be migrated in the virtual machine to be migrated is stored locally or not; the virtual machine to be migrated comprises the virtual disk to be migrated and the memory to be migrated;
if the virtual disk to be migrated is stored locally, migrating the virtual disk to be migrated to a shared storage between a source host and a destination host, and then executing the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated;
and if the virtual disk to be migrated is not stored locally, directly executing the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated.
Optionally, the determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated includes:
recording a time stamp of writing the memory and a memory offset queue in the process of writing the memory of the virtual machine to be migrated;
and determining the memory increment rate of the memory to be migrated in a preset time according to the time stamp and the memory offset queue.
Optionally, the migrating the memory to be migrated from the source host to the destination host in a pre-copy manner includes:
calculating compression time consumption and compression saving transmission time when the memory to be migrated is compressed;
and judging whether to directly migrate the memory to be migrated from the source host to the destination host in the pre-copy mode based on the time consumption of compression and the transmission time saving of compression.
Optionally, the determining whether to directly migrate the memory to be migrated from the source host to the destination host in the pre-copy manner based on the time consuming compression and the time saving transmission time saving compression includes:
and if the compression time consumption is not less than the compression time consumption, the memory to be migrated is directly migrated from the source host to the destination host in the pre-copy mode.
Optionally, the determining whether to directly migrate the memory to be migrated from the source host to the destination host in the pre-copy manner based on the time consuming compression and the time saving transmission time saving compression includes:
if the compression time is less than the compression transmission time, compressing the memory to be migrated;
and migrating the compressed memory to be migrated from the source host to the destination host in the pre-copy mode.
Optionally, the calculating compression time consuming and compression saving transmission time when compressing the memory to be migrated includes:
obtaining the maximum bandwidth of a migration network;
determining the original length of the memory to be migrated, and recording the compression time consumption when the memory to be migrated is compressed to the target length;
and determining the compression saving transmission time according to the maximum bandwidth, the original length and the target length.
In a second aspect, the present application discloses a migration mode decision device for virtual machine hot migration, including:
the memory increment rate determining module is used for determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated;
the increment rate and network judging module is used for judging whether the memory increment rate is larger than a preset memory increment rate threshold value or not and judging whether the migration network is stable or not based on a preset network judging mode;
the post-copy module is used for migrating the memory to be migrated from a source host to a destination host in a post-copy mode if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable;
and the pre-copy module is used for migrating the memory to be migrated from the source host to the destination host in a pre-copy mode if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable.
In a third aspect, the present application discloses an electronic device comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the migration mode decision method of the virtual machine hot migration.
In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; the migration mode decision method for the virtual machine thermomigration is realized when the computer program is executed by a processor.
As can be seen, the present application proposes a migration mode decision method for virtual machine thermomigration, including: determining the increment rate of the memory to be migrated in the virtual machine to be migrated; judging whether the memory increment rate is larger than a preset memory increment rate threshold value or not, and judging whether a migration network is stable or not based on a preset network judgment mode; if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrating the memory to be migrated from a source host to a destination host in a post-copy mode; and if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrating the memory to be migrated from the source host to the destination host in a pre-copy mode. In summary, according to the relationship between the memory increment rate and the preset memory increment rate threshold and according to the stability of the migration network, the migration mode of the virtual machine to be migrated is flexibly set, so that the total time and the migration downtime of the thermal migration are shortened while the completion of the thermal migration is ensured, and the migration efficiency and the migration success rate are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a migration mode decision method for virtual machine hot migration disclosed in the present application;
FIG. 2 is a schematic diagram of a migration mode decision system for virtual machine hot migration disclosed in the present application;
FIG. 3 is a flowchart of a migration mode decision method for performing virtual machine hot migration according to one embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a migration mode decision device for virtual machine hot migration disclosed in the present application;
fig. 5 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to reduce the total time of thermal migration and the shutdown time of the virtual machine, one of the prior arts compresses a first memory page block of the virtual machine to be sent, and the method is suitable for a scene with little change of memory increment, and can reduce the total time consumption of migration through a compression algorithm, but is not suitable for virtual machine service with large memory pressure. In the second prior art, by training an intelligent model in advance and then inputting various parameters into the intelligent model according to different scenes, a thermal migration method with the shortest time consumption is determined, and the method is difficult to define which type of the virtual machine is in advance, and cannot determine the intelligent model in advance.
Therefore, the embodiment of the application provides a migration mode decision scheme of the virtual machine thermomigration, which can ensure that the thermomigration is completed, shorten the total thermomigration time and migration downtime, and improve the migration efficiency and the migration success rate.
The embodiment of the application discloses a migration mode decision method for virtual machine thermomigration, which is shown in fig. 1 and comprises the following steps:
step S11: and determining the increment rate of the memory to be migrated in the virtual machine to be migrated.
In this embodiment, first, whether a virtual disk to be migrated in the virtual machine to be migrated is locally stored is determined; the virtual machine to be migrated comprises the virtual disk to be migrated and the memory to be migrated; if the virtual disk to be migrated is stored locally, migrating the virtual disk to be migrated to a shared storage between a source host and a destination host, and then executing the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated; and if the virtual disk to be migrated is not stored locally, directly executing the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated. It can be understood that if the virtual disk is stored locally, it is not possible for the destination host to access, so that it is necessary to thermally migrate the virtual disk and the memory to the destination host.
In this embodiment, determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated specifically includes: recording a time stamp of writing the memory and a memory offset queue in the process of writing the memory of the virtual machine to be migrated; and determining the memory increment rate of the memory to be migrated in a preset time according to the time stamp and the memory offset queue.
Step S12: judging whether the memory increment rate is larger than a preset memory increment rate threshold value or not, and judging whether the migration network is stable or not based on a preset network judgment mode.
In this embodiment, whether the migration network is stable may be specifically determined by determining whether the network traffic in the unit time is stable within a preset range.
Step S13: and if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrating the memory to be migrated from the source host to the destination host in a post-copy mode.
It should be noted that the post-copy mode refers to: the virtual machine is firstly switched to the target host, and then the memory to be migrated is iteratively copied from the source host to the target host. During migration of data, if network instability occurs, there is a risk of downtime, and therefore, post-copying needs to be performed while the network is stable. Moreover, if the memory increment rate is greater than the preset memory increment rate threshold, the iterative migration of each page of memory may not always converge, and thus is not suitable for the pre-copy mode. In summary, if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, the memory to be migrated is migrated from the source host to the destination host in a post-copy manner.
Step S14: and if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrating the memory to be migrated from the source host to the destination host in a pre-copy mode.
In this embodiment, if the memory increment rate is not greater than the preset memory increment rate threshold, or the migration network is unstable, the memory to be migrated is migrated from the source host to the destination host in a pre-copy manner.
In this embodiment, in the process of migrating the memory to be migrated from the source host to the destination host in a pre-copy manner, the memory to be migrated may be compressed first, and the memory to be migrated after compression may be migrated to the destination host, so that the total time of thermal migration and the migration downtime may be shortened, and the memory pressure brought to the virtual machine due to long migration time may be avoided, thereby avoiding performance degradation of the virtual machine. However, when compression time consumption for compressing the memory to be migrated is not less than compression transmission time saving, directly migrating the memory to be migrated from the source host to the destination host in the pre-copy mode; and when the compression time is less than the compression time and the transmission time is saved, compressing the memory to be migrated, and migrating the compressed memory to be migrated from the source host to the destination host in the pre-copy mode.
It should be noted that when determining that compression saves transmission time, firstly, obtaining the maximum bandwidth of the migration network; then determining the original length of the memory to be migrated, and recording the compression time consumption when the memory to be migrated is compressed to the target length; further, determining the compression save transmission time according to the maximum bandwidth, the original length and the target length.
Fig. 2 is a schematic diagram of a migration mode decision system for virtual machine thermal migration disclosed in the present application, where the system is divided into four modules and three devices, and the three modules are:
(1) And (3) a storage monitoring module: judging whether the storage where the virtual machine to be migrated is located is local storage or shared storage; providing the hot migration intelligent decision module to decide whether to perform storage migration firstly;
(2) And a network monitoring module: monitoring and calculating migration network rate from a source host to a destination host, and providing the migration network rate to a thermomigration intelligent decision module for judging the selection of a migration mode;
(3) And the memory monitoring module: calculating the rate of memory increment (which can be configured to be 1 minute, 10 seconds and 1 second) (writing) in unit time, wherein the rate represents the increment of the memory data of the virtual machine in unit time, and the rate value is provided for a thermal migration intelligent decision module for judging whether the virtual machine memory thermal migration is performed in a Pre-copy mode or a Post-copy mode;
the method for calculating the rate of the memory increment of the memory monitoring module of the source host comprises the following steps of firstly, implanting a hook function into a memory writing module; secondly, requesting a network monitoring module to acquire the maximum bandwidth W of the migration network; thirdly, counting the accessed time stamp when the virtual machine writes the memory every time, and recording a timestamp and an offset queue in a Key-Value format; then, when the thermomigration intelligent decision module sends a request to the module, inputting a unit time T, and counting the total memory access number M of the latest unit time from the recorded Key-Value queue inc The memory increment rate is M inc T; finally, the memory increment rate threshold may be set according to practical situations, typically the total memory M of the virtual machine Total The maximum bandwidth of the migration network is W multiplied by a coefficient (adjustment coefficient);
(4) Compression budget module: the transmission time and the compression time are saved by calculating the compression, and the two times are provided for the thermomigration intelligent decision module to judge whether to adopt a memory compression mode;
specifically, the compression budget module of the source host calculates the compression save transmission time and the compression time-consuming time in the following calculation modes:
firstly, a compression budget module requests a network monitoring module to acquire the maximum bandwidth W of a migration network;
secondly, an original memory with the length of M is taken out from the memory of the virtual machine to be migrated, compression of a Zlib algorithm is carried out on the memory data, compressed data with the length of N is obtained, and time consumption is T;
the compression time is T, and the compression transmission time is (M-N)/W;
(5) And the thermomigration intelligent decision module: the method of adopting the thermal migration is determined by information collected from the storage monitoring module, the memory monitoring module and the compression budget module. When the virtual disk of the virtual machine collected by the storage monitoring module is not positioned in the shared storage, firstly, carrying out storage migration; when the rate of updating the memory in unit time collected by the memory monitoring module exceeds a preset memory increment rate threshold, and the network monitored by the network monitoring module is relatively stable, the memory migration is performed in a Post-copy mode, otherwise, a Pre-copy mode is set; and when the compression transmission time saved by the compression budget module is longer than the compression time consumption, performing memory thermal migration by adopting a compression mode.
The three devices are: source host: the host machine where the virtual machine to be migrated is located before migration; the destination host: a target host to which the virtual machine to be migrated is to be migrated; shared storage and migration network: storage areas and networks that can be used by both the source host and the destination host.
Fig. 3 is a flowchart of a migration mode decision method for virtual machine hot migration disclosed in the present application, specifically,
1. the intelligent thermomigration decision-making module collects whether the virtual disk of the virtual machine is positioned on the shared storage or not through the storage monitoring module, and if the virtual disk is positioned on the shared storage, the step 3 is entered;
2. the method comprises the steps that a thermomigration intelligent decision module sends a storage migration instruction to a source host, and virtual disks of a virtual machine to be migrated are migrated to a shared storage first;
3. the thermomigration intelligent decision module sends a request to a memory monitoring module of a source host, acquires the rate of memory increment and a memory increment rate threshold value in the latest unit time, and enters a step 6 when the monitored memory increment rate is smaller than the memory increment rate threshold value, otherwise, enters the step 4;
4. the intelligent thermomigration decision module acquires whether a migration network is stable or not (whether the network flow in unit time is stable in a set range or not) through the network monitoring module, if so, the step 5 is entered, and if not (the network is unstable), the step 6 is entered;
5. the intelligent thermo-migration decision module gives a message early warning that the message cannot be rolled back if the migration fails, and then performs memory thermo-migration in Post-copy mode until the migration is finished (or fails);
6. marking the virtual machine to be migrated as a Pro-copy mode, then sending a request to a compression budget module, and acquiring compression transmission time saving and compression time consuming time;
7. if the compression transmission time is longer than the compression time, performing the migration of the compression mode, otherwise performing the migration of the direct transmission mode;
8. migration end (or fail);
in summary, according to the method, the device and the system, the memory monitoring module, the storage monitoring module, the network monitoring module and the compression budget module are utilized, according to the priority policy, for different scenes, the appropriate thermal migration mode of the current virtual machine can be determined according to the real-time environment information and the virtual machine service load, the scene that the thermal migration of the virtual machine cannot be completed can be avoided, and the total time of the thermal migration of the virtual machine and the service downtime of the virtual machine can be reduced. In this way, the high availability of the virtual machine hot migration is enhanced, so that the hot migration process has less influence on the virtual machine service.
As can be seen, the present application proposes a migration mode decision method for virtual machine thermomigration, including: determining the increment rate of the memory to be migrated in the virtual machine to be migrated; judging whether the memory increment rate is larger than a preset memory increment rate threshold value or not, and judging whether a migration network is stable or not based on a preset network judgment mode; if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrating the memory to be migrated from a source host to a destination host in a post-copy mode; and if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrating the memory to be migrated from the source host to the destination host in a pre-copy mode. In summary, according to the relationship between the memory increment rate and the preset memory increment rate threshold and according to the stability of the migration network, the migration mode of the virtual machine to be migrated is flexibly set, so that the total time and the migration downtime of the thermal migration are shortened while the completion of the thermal migration is ensured, and the migration efficiency and the migration success rate are improved.
Correspondingly, the embodiment of the application also discloses a migration mode decision device for virtual machine thermomigration, as shown in fig. 4, the device comprises:
the memory increment rate determining module 11 is configured to determine a memory increment rate of a memory to be migrated in the virtual machine to be migrated;
the increment rate and network judging module 12 is configured to judge whether the memory increment rate is greater than a preset memory increment rate threshold, and judge whether the migration network is stable based on a preset network judging mode;
the post-copy module 13 is configured to migrate the memory to be migrated from the source host to the destination host in a post-copy manner if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable;
and the pre-copy module 14 is configured to migrate the memory to be migrated from the source host to the destination host in a pre-copy manner if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable.
The more specific working process of each module may refer to the corresponding content disclosed in the foregoing embodiment, and will not be described herein.
As can be seen, the present application proposes a migration mode decision method for virtual machine thermomigration, including: determining the increment rate of the memory to be migrated in the virtual machine to be migrated; judging whether the memory increment rate is larger than a preset memory increment rate threshold value or not, and judging whether a migration network is stable or not based on a preset network judgment mode; if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrating the memory to be migrated from a source host to a destination host in a post-copy mode; and if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrating the memory to be migrated from the source host to the destination host in a pre-copy mode. In summary, according to the relationship between the memory increment rate and the preset memory increment rate threshold and according to the stability of the migration network, the migration mode of the virtual machine to be migrated is flexibly set, so that the total time and the migration downtime of the thermal migration are shortened while the completion of the thermal migration is ensured, and the migration efficiency and the migration success rate are improved.
Further, the embodiment of the application also provides electronic equipment. Fig. 5 is a block diagram of an electronic device 20, according to an exemplary embodiment, and the contents of the diagram should not be construed as limiting the scope of use of the present application in any way.
Fig. 5 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a display screen 23, an input output interface 24, a communication interface 25, a power supply 26, and a communication bus 27. Wherein the memory 22 is used for storing a computer program, which is loaded and executed by the processor 21 for realizing the following steps:
determining the increment rate of the memory to be migrated in the virtual machine to be migrated;
judging whether the memory increment rate is larger than a preset memory increment rate threshold value or not, and judging whether a migration network is stable or not based on a preset network judgment mode;
if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrating the memory to be migrated from a source host to a destination host in a post-copy mode;
and if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrating the memory to be migrated from the source host to the destination host in a pre-copy mode.
In some embodiments, the processor may further implement the following steps by executing the computer program stored in the memory:
judging whether a virtual disk to be migrated in the virtual machine to be migrated is stored locally or not; the virtual machine to be migrated comprises the virtual disk to be migrated and the memory to be migrated;
if the virtual disk to be migrated is stored locally, migrating the virtual disk to be migrated to a shared storage between a source host and a destination host, and then executing the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated;
and if the virtual disk to be migrated is not stored locally, directly executing the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated.
In some embodiments, the processor may specifically implement the following steps by executing the computer program stored in the memory:
recording a time stamp of writing the memory and a memory offset queue in the process of writing the memory of the virtual machine to be migrated;
and determining the memory increment rate of the memory to be migrated in a preset time according to the time stamp and the memory offset queue.
In some embodiments, the processor may specifically implement the following steps by executing the computer program stored in the memory:
calculating compression time consumption and compression saving transmission time when the memory to be migrated is compressed;
and judging whether to directly migrate the memory to be migrated from the source host to the destination host in the pre-copy mode based on the time consumption of compression and the transmission time saving of compression.
In some embodiments, the processor may specifically implement the following steps by executing the computer program stored in the memory:
and if the compression time consumption is not less than the compression time consumption, the memory to be migrated is directly migrated from the source host to the destination host in the pre-copy mode.
In some embodiments, the processor may specifically implement the following steps by executing the computer program stored in the memory:
if the compression time is less than the compression transmission time, compressing the memory to be migrated;
and migrating the compressed memory to be migrated from the source host to the destination host in the pre-copy mode.
In some embodiments, the processor may specifically implement the following steps by executing the computer program stored in the memory:
obtaining the maximum bandwidth of a migration network;
determining the original length of the memory to be migrated, and recording the compression time consumption when the memory to be migrated is compressed to the target length;
and determining the compression saving transmission time according to the maximum bandwidth, the original length and the target length.
In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 26 is used to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 24 is used for obtaining external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application needs, which is not limited herein.
The memory 22 may be a read-only memory, a random access memory, a magnetic disk, an optical disk, or the like, and the resources stored thereon may include the computer program 221, which may be stored in a temporary or permanent manner. Wherein the computer program 221 may further comprise a computer program capable of being used to perform other specific tasks in addition to a computer program capable of being used to perform the migration mode decision method of virtual machine live migration performed by the electronic device 20 as disclosed in any of the previous embodiments.
Further, the embodiment of the application also discloses a computer readable storage medium for storing a computer program; the migration mode decision method for the virtual machine thermomigration is realized when the computer program is executed by a processor.
For specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and no further description is given here.
In this application, each embodiment is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts between the embodiments refer to the devices disclosed in the embodiments, so that the description is relatively simple because it corresponds to the method disclosed in the embodiments, and the relevant parts refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing describes in detail a migration mode decision-making method, apparatus, device and storage medium for virtual machine hot migration provided in the present application, and specific examples are applied herein to illustrate the principles and embodiments of the present application, where the foregoing examples are only used to help understand the method and core idea of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. The migration mode decision method for the virtual machine thermomigration is characterized by comprising the following steps of:
determining the increment rate of the memory to be migrated in the virtual machine to be migrated;
judging whether the memory increment rate is larger than a preset memory increment rate threshold value or not, and judging whether a migration network is stable or not based on a preset network judgment mode;
if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable, migrating the memory to be migrated from a source host to a destination host in a post-copy mode;
and if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable, migrating the memory to be migrated from the source host to the destination host in a pre-copy mode.
2. The method for determining a migration mode of a virtual machine according to claim 1, further comprising, before determining a memory increment rate of a memory to be migrated in the virtual machine to be migrated:
judging whether a virtual disk to be migrated in the virtual machine to be migrated is stored locally or not; the virtual machine to be migrated comprises the virtual disk to be migrated and the memory to be migrated;
if the virtual disk to be migrated is stored locally, migrating the virtual disk to be migrated to a shared storage between a source host and a destination host, and then executing the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated;
and if the virtual disk to be migrated is not stored locally, directly executing the step of determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated.
3. The method for determining a migration mode decision of a virtual machine hot migration according to claim 1, wherein determining a memory increment rate of a memory to be migrated in the virtual machine to be migrated comprises:
recording a time stamp of writing the memory and a memory offset queue in the process of writing the memory of the virtual machine to be migrated;
and determining the memory increment rate of the memory to be migrated in a preset time according to the time stamp and the memory offset queue.
4. A migration mode decision method for virtual machine hot migration according to any one of claims 1 to 3, wherein said migrating, by means of pre-copy, the memory to be migrated from the source host to the destination host includes:
calculating compression time consumption and compression saving transmission time when the memory to be migrated is compressed;
and judging whether to directly migrate the memory to be migrated from the source host to the destination host in the pre-copy mode based on the time consumption of compression and the transmission time saving of compression.
5. The method for determining a migration mode of virtual machine live migration according to claim 4, wherein determining whether to migrate the memory to be migrated directly from the source host to the destination host in the pre-copy manner based on the compression time consumption and the compression save transmission time comprises:
and if the compression time consumption is not less than the compression time consumption, the memory to be migrated is directly migrated from the source host to the destination host in the pre-copy mode.
6. The method for determining a migration mode of virtual machine live migration according to claim 4, wherein determining whether to migrate the memory to be migrated directly from the source host to the destination host in the pre-copy manner based on the compression time consumption and the compression save transmission time comprises:
if the compression time is less than the compression transmission time, compressing the memory to be migrated;
and migrating the compressed memory to be migrated from the source host to the destination host in the pre-copy mode.
7. The migration mode decision method of virtual machine live migration according to claim 4, wherein the calculating compression time and compression saving transmission time when compressing the memory to be migrated comprises:
obtaining the maximum bandwidth of a migration network;
determining the original length of the memory to be migrated, and recording the compression time consumption when the memory to be migrated is compressed to the target length;
and determining the compression saving transmission time according to the maximum bandwidth, the original length and the target length.
8. A migration mode decision-making device for virtual machine hot migration, comprising:
the memory increment rate determining module is used for determining the memory increment rate of the memory to be migrated in the virtual machine to be migrated;
the increment rate and network judging module is used for judging whether the memory increment rate is larger than a preset memory increment rate threshold value or not and judging whether the migration network is stable or not based on a preset network judging mode;
the post-copy module is used for migrating the memory to be migrated from a source host to a destination host in a post-copy mode if the memory increment rate is greater than the preset memory increment rate threshold and the migration network is stable;
and the pre-copy module is used for migrating the memory to be migrated from the source host to the destination host in a pre-copy mode if the memory increment rate is not greater than the preset memory increment rate threshold or the migration network is unstable.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the migration mode decision method of virtual machine live migration according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements a migration mode decision method of virtual machine hot migration according to any one of claims 1 to 7.
CN202310200937.2A 2023-02-28 2023-02-28 Migration mode decision method, device, equipment and medium for virtual machine thermomigration Pending CN116069450A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310200937.2A CN116069450A (en) 2023-02-28 2023-02-28 Migration mode decision method, device, equipment and medium for virtual machine thermomigration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310200937.2A CN116069450A (en) 2023-02-28 2023-02-28 Migration mode decision method, device, equipment and medium for virtual machine thermomigration

Publications (1)

Publication Number Publication Date
CN116069450A true CN116069450A (en) 2023-05-05

Family

ID=86175431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310200937.2A Pending CN116069450A (en) 2023-02-28 2023-02-28 Migration mode decision method, device, equipment and medium for virtual machine thermomigration

Country Status (1)

Country Link
CN (1) CN116069450A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117170882A (en) * 2023-11-01 2023-12-05 新华三信息技术有限公司 Resource allocation method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117170882A (en) * 2023-11-01 2023-12-05 新华三信息技术有限公司 Resource allocation method and device, electronic equipment and storage medium
CN117170882B (en) * 2023-11-01 2024-02-23 新华三信息技术有限公司 Resource allocation method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN102622303B (en) A kind of method of internal memory premature beats and device
US7240104B2 (en) Method and apparatus for managing resources stored on a communication device
CN110929880A (en) Method and device for federated learning and computer readable storage medium
WO2022161430A1 (en) Edge cloud system, edge management and control method, management and control node, and storage medium
WO2022007552A1 (en) Processing node management method, configuration method and related apparatus
CN108762924A (en) A kind of method, apparatus and computer readable storage medium of load balancing
CN116069450A (en) Migration mode decision method, device, equipment and medium for virtual machine thermomigration
CN111338760B (en) Service instance cross-node telescoping method and device for edge computing
CN109471989A (en) A kind of page request processing method and relevant apparatus
CN111177160B (en) Service updating method, device, server and medium
CN110011850B (en) Management method and device for services in cloud computing system
CN109831323B (en) Server information management method, management system and server
CN110971647B (en) Node migration method of big data system
CN113553194B (en) Hardware resource management method, device and storage medium
CN114900449B (en) Resource information management method, system and device
CN104468674B (en) Data migration method and device
CN110019372A (en) Data monitoring method, device, server and storage medium
CN114969058A (en) Data updating method, device, equipment and storage medium
WO2021259064A1 (en) Capacity reduction/expansion method and system for cluster, capacity reduction/expansion control terminal and medium
CN114817134A (en) Snapshot task monitoring method, device, equipment and medium
CN110096518A (en) Knowledge base metadata sending method and device, readable storage medium storing program for executing
CN111611480A (en) Recommendation strategy generation method and device, computer equipment and storage medium
JP2008129794A (en) Backup system and backup apparatus
CN111597144B (en) File migration method, device and equipment
CN108847965B (en) Cluster member state oscillation prevention method and device

Legal Events

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