Virtual machine migration method and device and electronic equipment

By dynamically adjusting the migration strategy based on the bandwidth and bandwidth utilization of the virtual machine migration link, the failure problem caused by policy mismatch during the virtual machine migration process is solved, and the migration success rate is improved.

CN119225906AActive Publication Date: 2024-12-31NEW H3C TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411329607.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-31
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

Existing virtual machine hot migration technology cannot dynamically adapt the migration policy based on network bandwidth and bandwidth utilization, resulting in unadaptation of the migration policy and causing virtual machine migration to fail.

Method used

Before the virtual machine migration, the migration strategy is determined based on the bandwidth allocated by the link and bandwidth utilization. If the bandwidth is less than the lower limit, pre-memory copy is used and the CPU is turned on; if the bandwidth utilization is within a specific range, the corresponding frequency is adapted. Policy: If the conditions are not met, it is prohibited to migrate or turn off the memory and copy the CPU and actively downgrade the frequency.

Benefits of technology

Through dynamic adaptation of migration strategies, we can effectively avoid risks in the virtual machine migration process and improve the migration success rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119225906A_ABST
    Figure CN119225906A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a virtual machine migration method and device and electronic equipment. In the embodiment, before the virtual machine is migrated from the current first host to the second host, whether the virtual machine is migrated or not is determined according to the bandwidth allocated to the link through which the virtual machine is migrated from the first host to the second host and the bandwidth occupancy rate of the link, and the matched migration strategy is dynamically adapted when the migration is determined. According to the virtual machine migration method, migration is not carried out by default in a specified mode in the traditional technology, whether migration is carried out or not is determined according to the bandwidth allocated to the link for migrating the virtual machine and the bandwidth utilization rate, and the matched migration strategy is dynamically adapted when migration is determined, so that migration of the virtual machine can be carried out in the most appropriate mode, and the migration efficiency is improved. Therefore, risks possibly existing in the virtual live migration process are effectively avoided, and the success rate of virtual machine migration is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual machine technology, and in particular to a virtual machine migration method, device and electronic device. Background Art

[0002] Since virtual machine hot migration has the characteristics of virtual machines can still maintain normal operation and business is not interrupted during the migration process, virtual machine hot migration has become a research hotspot. There are two main methods of virtual machine hot migration: memory pre-copy method and memory post-copy method.

[0003] Currently, when performing hot migration of virtual machines, the default method of migration is pointed out, such as the default method of migration using memory pre-copy. However, this default method of migration is fixed and cannot cope with migration situations in which network status changes. For example, it cannot dynamically adapt the migration strategy based on network bandwidth and bandwidth utilization, which may cause virtual machine migration failure due to incompatibility of the migration strategy. Summary of the invention

[0004] In view of this, embodiments of the present application provide a virtual machine migration method, device and electronic device to dynamically adapt the migration strategy based on network bandwidth and bandwidth utilization, thereby avoiding virtual machine migration failure caused by incompatible migration strategy.

[0005] The embodiment of the present application provides a virtual machine migration method, which is applied to a network device, and the network device is used to manage multiple hosts in a local area network; the method includes:

[0006] Before the virtual machine is migrated from the current first host to the second host, if the bandwidth allocated to the link for migrating the virtual machine from the first host to the second host is less than the set bandwidth lower limit, a first migration strategy matching the bandwidth is output to migrate the virtual machine according to the first migration strategy; the first migration strategy is used to indicate a strategy of closing the memory post-copy and opening the CPU active frequency reduction;

[0007] If the bandwidth is greater than or equal to the bandwidth lower limit, then:

[0008] When the current bandwidth utilization of the link is greater than or equal to a set bandwidth utilization upper limit, an indication is output, where the indication is used to indicate that the virtual machine is prohibited from migrating from the first host to the second host;

[0009] When the bandwidth utilization is between the bandwidth utilization upper limit and the set bandwidth utilization lower limit, if the bandwidth utilization meets one of the set CPU active frequency reduction requirements, the first migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the first migration strategy; if the bandwidth utilization does not meet the set CPU active frequency reduction, the second migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the second migration strategy; the second migration strategy is used to indicate a strategy for closing memory post-copying and closing CPU active frequency reduction.

[0010] The embodiment of the present application also provides a virtual machine migration device, which is applied to a network device, and the network device is used to manage multiple hosts in a local area network; the device includes:

[0011] The inspection module and the first execution module are used for outputting a first migration strategy matching the bandwidth before the virtual machine is migrated from the current first host to the second host, if the bandwidth allocated to the link for migrating the virtual machine from the first host to the second host is less than the set bandwidth lower limit, so as to migrate the virtual machine according to the first migration strategy; the first migration strategy is used to indicate a strategy of closing the memory post-copy and opening the CPU active frequency reduction;

[0012] The second execution module is configured to: if the bandwidth is greater than or equal to the bandwidth lower limit, then:

[0013] When the current bandwidth utilization of the link is greater than or equal to a set bandwidth utilization upper limit, an indication is output, where the indication is used to indicate that the virtual machine is prohibited from migrating from the first host to the second host;

[0014] When the bandwidth utilization is between the bandwidth utilization upper limit and the set bandwidth utilization lower limit, if the bandwidth utilization meets one of the set CPU active frequency reduction requirements, the first migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the first migration strategy; if the bandwidth utilization does not meet the set CPU active frequency reduction, the second migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the second migration strategy; the second migration strategy is used to indicate a strategy for closing memory post-copying and closing CPU active frequency reduction.

[0015] An embodiment of the present application also provides an electronic device, including: a processor and a memory for storing computer program instructions, and when the computer program instructions are executed by the processor, the processor executes the steps of the above method.

[0016] An embodiment of the present application also provides a machine-readable storage medium, which stores computer program instructions. When the computer program instructions are executed, the steps of the above method can be implemented.

[0017] It can be seen from the above technical solutions that in this embodiment, when performing virtual machine migration, the specified method is no longer used by default for migration. Instead, whether to migrate is determined based on the bandwidth and bandwidth utilization allocated to the link for migrating the virtual machine, and the migration strategy is dynamically adapted when determining the migration. This method of dynamically adapting the migration strategy based on the link status can migrate the virtual machine in the most appropriate way, which effectively avoids the risks that may exist in the virtual hot migration process and improves the success rate of virtual machine migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of a virtual machine migration scenario provided in an embodiment of the present application;

[0019] Figure 2 A schematic diagram of a process for a method provided in an embodiment of the present application;

[0020] Figure 3 A schematic diagram of another method provided in an embodiment of the present application;

[0021] Figure 4 A schematic diagram of the structure of the device provided in the embodiment of the present application;

[0022] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.

[0024] To facilitate understanding of this solution, before describing this solution, the technical problems existing in the prior art are described in detail:

[0025] Virtual machine migration is divided into cold migration (also known as static migration) and hot migration (also known as online migration). Among them, cold migration requires shutting down the virtual machine on the source host first, then migrating the virtual machine's memory data and other configuration files to the destination host, and finally restarting the virtual machine on the destination host.

[0026] Hot migration is the process of migrating a virtual machine from one host (source host) to another host (destination host) while the virtual machine is running normally. Since the virtual machine is still running during the migration process, the memory data of the virtual machine needs to be properly handled to ensure that the virtual machine runs normally and the business is not interrupted. There are two main ways to hot migrate a virtual machine: memory pre-copy (precopy) and memory post-copy (postcopy).

[0027] The memory precopy method refers to copying memory data and other configuration information together, and then cyclically copying dirty pages. During the migration, the virtual machine is still running on the source host. Here, dirty pages refer to the memory data that is modified during each round of copying because the virtual machine is running on the remote host.

[0028] The postcopy method refers to copying other configuration information first, copying the necessary information to the destination host, and then running the virtual machine. When the virtual machine is running in the destination host, when the destination virtual machine calls memory data that has not been transmitted from the source host, it will trigger a page fault exception (the page corresponding to the page fault is the dirty page). Then, the source host copies the required memory page to the target host.

[0029] Currently, when performing hot migration of virtual machines, the default method of migration is pointed out, such as the default method of migration using memory pre-copy, or the default method of migration using post-storage pre-copy. However, this default method of migration is fixed and cannot cope with migration situations in which network status changes. For example, it cannot dynamically adapt the migration strategy based on network bandwidth and bandwidth utilization, which may cause virtual machine migration failure due to incompatible migration strategies.

[0030] Based on this, in order to solve the above problems, the embodiments of the present application provide a virtual machine migration method, device and electronic device.

[0031] To facilitate understanding of the present method, before describing the present method, the virtual machine migration scenario provided in the embodiment of the present application is described first:

[0032] See also Figure 1 , Figure 1 A schematic diagram of a virtual machine migration scenario provided for this application. Figure 1As shown, the migration scenario generally involves a first host, a second host, and a network device. Optionally, the network device may be a main control platform. The network device is used to manage multiple hosts in a local area network, that is, the network device manages multiple hosts including the first host and the second host. When the user interacts with the network device and determines that the virtual machine needs to be migrated from the first host to the second host, the network device executes the method provided in the following embodiment, cooperates with the first host and the second host to execute an appropriate migration strategy to achieve the migration of the virtual machine from the first host to the second host.

[0033] Combine the following Figure 1 The virtual machine migration scenario shown is used to describe the method provided in the embodiment of the present application:

[0034] See also Figure 2 , Figure 2 This is a flow chart of the method provided in the embodiment of the present application. Figure 2 As shown, the process may include the following steps:

[0035] S201, before the virtual machine migrates from the current first host to the second host, if the bandwidth allocated to the link for migrating the virtual machine from the first host to the second host is less than the set bandwidth lower limit, a first migration strategy matching the bandwidth is output to migrate the virtual machine according to the first migration strategy, and the first migration strategy is used to indicate a strategy of closing the memory post-copying and opening the CPU active frequency reduction.

[0036] In this embodiment, there are many ways to obtain the above-mentioned link in specific implementation. For example, as an embodiment, a dedicated network link for virtual machine migration is searched in at least one network link configured between the first host and the second host. If found, the dedicated network link is determined as the above-mentioned link. If not found, the management network link between the first host and the second host is determined as the above-mentioned link. Here, the management network link is the network link between the first host and the second host when the network device manages the first host and the second host.

[0037] It should be noted that the minimum requirement for the link of the virtual machine migration from the first host to the second host is that the link is available, which means that the current remaining bandwidth cannot be 0. The link determined by the above method does not have a current available bandwidth of 0, and can meet this requirement.

[0038] In this embodiment, the bandwidth lower limit is set according to the specific scenario, for example, it may be 10 GB / s, and the embodiment of the present application does not specifically limit it.

[0039] In this implementation, the first migration strategy refers to the strategy of using pre-memory copy and active CPU frequency reduction when the virtual machine migrates from the first host to the second host. Compared with pre-memory copy, post-memory copy frequently calls userfault and has higher requirements for link transmission. Therefore, when the bandwidth allocated to the link is less than the set bandwidth lower limit, post-memory copy needs to be turned off, that is, the pre-memory copy method is used.

[0040] It is known that the purpose of active CPU frequency reduction is to reduce the efficiency of the CPU of the virtual machine to adapt the frequency of dirty pages or pagefaults to the current link situation. Here, it has been determined to use the memory front copy, so the purpose of enabling active CPU frequency reduction is to reduce the scheduling frequency of the virtual machine CPU in the first host during the memory front copy process to reduce the generation of dirty pages and increase the migration speed.

[0041] S202: If the bandwidth is greater than or equal to the lower bandwidth limit, then execute the following steps S203 to S204.

[0042] S203: When the current bandwidth utilization of the link is greater than or equal to the set bandwidth utilization upper limit, output an indication, where the indication is used to indicate prohibiting the virtual machine from migrating from the first host to the second host.

[0043] S204, when the bandwidth utilization is between the upper limit of the bandwidth utilization and the set lower limit of the bandwidth utilization, if the bandwidth utilization meets one of the requirements of the set CPU active frequency reduction, a first migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the first migration strategy; if the bandwidth utilization does not meet the set CPU active frequency reduction, a second migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the second migration strategy; the second migration strategy is used to indicate a strategy for closing memory post-copying and closing CPU active frequency reduction.

[0044] In this embodiment, the second migration strategy refers to a strategy of using a memory front copy and not using active CPU frequency reduction.

[0045] In this embodiment, there are many ways to obtain bandwidth utilization in specific implementation. For example, as an embodiment, the above bandwidth utilization is obtained by the following method: obtaining the average output flow and average input flow of the interface of the local connection link of the first host within a specified inspection time period; the average output flow is sent to the second host according to the IP address of the second host; the average input flow is received from the second host according to the IP address of the second host. The bandwidth utilization is determined based on the average output flow, the average input flow and the bandwidth allocated to the link.

[0046] Specifically, in one implementation, the nload tool set on the first host executes the instruction: nload ethx<IP address of the second host>-a 15-m to check the flow parameters of the interface of the local connection link of the first host. The flow parameters include the current flow, average flow, minimum flow, maximum flow, and total flow of the input and output of the interface. In this way, the average output flow and average input flow of the interface in the specified inspection time period can be obtained by counting these parameters.

[0047] In one implementation, the bandwidth utilization is calculated by the following formula:

[0048] Bandwidth utilization = (average output traffic + average input traffic) / bandwidth allocated to the link.

[0049] Thus, after determining the link, the higher the average output flow and the average input flow, the higher the bandwidth utilization, and vice versa.

[0050] In this embodiment, the bandwidth utilization upper limit and the bandwidth utilization lower limit can be set according to the specific scenario, for example, the bandwidth utilization upper limit is 70%, the bandwidth utilization lower limit is 30%, etc., which is not specifically limited in the embodiment of the present application.

[0051] In this embodiment, it is known that the purpose of active CPU frequency reduction is to reduce the efficiency of the CPU of the virtual machine to reduce the frequency of dirty pages or pagefaults to adapt to the current link situation. Therefore, active CPU frequency reduction is closely related to bandwidth utilization. As an embodiment, the requirement of active CPU frequency reduction is reflected by a set bandwidth utilization range. For example, the requirement of setting active CPU frequency reduction means that the bandwidth utilization range is greater than or equal to 50% and less than 70%. The bandwidth utilization meets one of the requirements of the set active CPU frequency reduction, which means that the bandwidth utilization is between [50%, 70%).

[0052] Furthermore, if the upper limit of bandwidth utilization is 70% and the lower limit of bandwidth utilization is 30%, the requirement for active CPU frequency reduction is set to a bandwidth utilization range of [50%, 70%). When the current bandwidth utilization is [50%, 70%), it is necessary to turn off memory post-copy and turn on CPU active frequency reduction. When the current bandwidth utilization is [30%, 50%), it is necessary to turn off memory post-copy and turn off CPU active frequency reduction.

[0053] The specific implementation of the above steps S201 to S204 will be described in more detail in the following text in the form of specific embodiments, which will not be described here in detail.

[0054] So far, completed Figure 1 The process shown.

[0055] pass Figure 1 It can be seen from the process shown that in this embodiment, when migrating a virtual machine, the specified method is no longer used by default for migration. Instead, whether to migrate is determined based on the bandwidth allocated to the link for migrating the virtual machine and the bandwidth utilization rate, and the migration strategy is dynamically adapted when determining the migration. This method of dynamically adapting the migration strategy based on the link status can migrate the virtual machine in the most appropriate way, which effectively avoids the risks that may exist in the virtual hot migration process and improves the success rate of virtual machine migration.

[0056] Further, as an embodiment, the method provided in the embodiment of the present application also includes: when the bandwidth utilization is less than the lower limit of the bandwidth utilization, obtaining the network delay information and packet loss information between the first host and the second host. Determining whether to migrate the virtual machine based on the network delay information and packet loss information. When determining to migrate the virtual machine, outputting a third migration strategy that matches the network delay information and packet loss information, and migrating the virtual machine according to the third migration strategy.

[0057] In this embodiment, there are many ways to obtain network delay information and packet loss information in specific implementations. For example, as an embodiment, the above network delay information and packet loss information are obtained in the following way: control the first host to send multiple test data packets to the second host through the link at set time intervals. Determine the network delay information and packet loss information based on the response of the second host to each test data packet.

[0058] Specifically, in one implementation, the packet loss rate and multiple delay indicators of the link of the migrated virtual machine are checked by executing the command: ping -c <number of times> -s <test data packet size> <IP address of the second host> through the ping tool set on the first host. Here, the multiple delay indicators at least include the minimum delay, the average delay, the maximum delay, and the delay standard deviation.

[0059] In this embodiment, the above-mentioned determination of whether to migrate the virtual machine based on the packet loss rate and multiple delay indicators and the determination of the third migration strategy matching the packet loss rate and multiple delay indicators are implemented in the following manner:

[0060] As an embodiment, when the packet loss rate is greater than or equal to the set packet loss rate upper limit, the virtual machine is not migrated. In this embodiment, when the packet loss rate is greater than or equal to the set packet loss rate upper limit, the packet loss rate of the registration link is too high. At this time, a prompt "The packet loss rate of the migration link is too high, please do not migrate the virtual machine to the second host" should be issued.

[0061] As an embodiment, when the packet loss rate is between the set packet loss rate upper limit and the set packet loss rate lower limit, the third migration strategy is the above-mentioned first migration strategy. That is, in this embodiment, when the packet loss rate is between the set packet loss rate upper limit and the set packet loss rate lower limit, it indicates that the link network state is insufficient to support the requirements of the memory post-copy on the link, and therefore, the virtual machine is migrated by using the memory pre-copy and CPU active frequency reduction method.

[0062] As an embodiment, when the packet loss rate is less than the set packet loss rate lower limit, it is divided into the following three cases:

[0063] The first case: when each of the multiple delay indicators is less than the set delay indicator lower limit value corresponding to the delay indicator, the third migration strategy is used to indicate the strategy of turning on the memory post-copy and turning off the active CPU frequency reduction.

[0064] At this time, the third migration strategy refers to a strategy of using the last save and the first copy and not using the active CPU frequency reduction.

[0065] The second situation: when each delay indicator among multiple delay indicators is greater than or equal to the set delay indicator lower limit value corresponding to the delay indicator, and less than the set delay indicator upper limit value corresponding to the delay indicator, the third migration strategy is used to indicate the strategy of turning on memory post-copying and turning on active CPU frequency reduction.

[0066] The third situation: among the multiple delay indicators, there is a delay indicator that is greater than or equal to the set delay indicator upper limit value corresponding to the delay indicator, and the third migration strategy is the above second migration strategy.

[0067] At this time, the second migration strategy refers to a strategy of using the memory front copy and not using the CPU active frequency reduction.

[0068] In this embodiment, the packet loss rate upper limit value, the packet loss rate lower limit value, and the delay indicator upper limit value and the delay indicator lower limit value corresponding to each delay indicator can be set according to specific circumstances, and the embodiment of the present application is not specifically limited.

[0069] In order to explain the method provided by the present application in more detail, Figure 3 The solution provided in this application is described in more detail by way of specific embodiments.

[0070] In this embodiment, the bandwidth lower limit is 10 GB / s, the bandwidth utilization upper limit is 70%, the bandwidth utilization lower limit is 30%, and the requirement for active CPU frequency reduction is set to a bandwidth utilization range of [50%, 70%).

[0071] The upper limit of packet loss rate is 5%, and the lower limit of packet loss rate is 1%.

[0072] The upper limit of the minimum delay is 0.15ms, and the lower limit of the minimum delay is 0.12ms.

[0073] The upper limit of the average delay value is 0.2ms, and the lower limit of the average delay value is 0.15ms.

[0074] The maximum delay upper limit is 0.35ms, and the maximum delay lower limit is 0.3ms.

[0075] The upper limit of the delay standard deviation is 0.1ms, and the lower limit of the delay standard deviation is 0.05ms.

[0076] The method comprises the following steps:

[0077] 1. The main control platform obtains the IP address of the second host as the migration destination through the user's selection, determines the link for migrating the virtual machine based on the IP address of the second host, and sends the IP address of the second host to the first host.

[0078] 2. After the first host obtains the second IP address, it executes the nload ethx <IP address of the second host> -a 15 -m command, waits for the command execution result, obtains the average output flow and average input flow of the interface of the local connection link of a host within the specified inspection time period, and calculates the current bandwidth utilization by the following formula.

[0079] Bandwidth utilization = (average output traffic + average input traffic) / bandwidth allocated to the link.

[0080] In this step, for the instruction nload ethx <IP address of the second host> -a 15 -m, the duration of the inspection time period is specified to be 15 seconds.

[0081] 3. The ping tool on the first host executes the command: ping -c <number of times> -s <test data packet size><IP address of the second host>, which controls the first host to send multiple test data packets to the second host through the link at set time intervals, and depends on the response of the second host to each test data packet to check the packet loss rate, minimum delay, average delay, maximum delay, and delay standard deviation of the link of the migrated virtual machine.

[0082] In this step, for the instruction ping -c <number of times> -s <test data packet size> <IP address of the second host>, the default number of -c parameters is 50, and the default size of -s parameters is 64 bytes, that is, the first host sends 50 test data packets of 64 bytes within 1 second.

[0083] 4. The main control platform determines whether to migrate and the migration strategy when determining the migration based on the bandwidth, bandwidth utilization, packet loss rate, minimum delay, average delay, maximum delay, and delay standard deviation of the link.

[0084] Specifically, if Figure 3 As shown, the specific situations include the following:

[0085] (1) If the bandwidth allocated to the link for migrating the virtual machine from the first host to the second host is less than 10 GB / s, the policy of disabling "memory post-copy" and enabling "CPU active frequency reduction" is output.

[0086] (2) If the bandwidth is greater than or equal to 10 GB / s and the current bandwidth utilization of the link is greater than or equal to 70%, an instruction of "prohibiting the migration of the virtual machine from the first host to the second host" is output.

[0087] (3) If the bandwidth is greater than or equal to 10 GB / s and the current bandwidth utilization of the link is greater than or equal to 50% and less than 70%, the policy of disabling "memory post-copy" and enabling "active CPU frequency reduction" is output.

[0088] (4) If the bandwidth is greater than or equal to 10 GB / s and the current bandwidth utilization of the link is greater than or equal to 30% and less than 50%, the output is to disable the "memory post-copy" policy and the "active CPU frequency reduction" policy.

[0089] (5) If the bandwidth is greater than or equal to 10 GB / s and the bandwidth utilization is less than 30%, the following conditions apply:

[0090] 1) If the packet loss rate is greater than or equal to 5%, an instruction of "prohibiting the migration of the virtual machine from the first host to the second host" is output.

[0091] 2) If the packet loss rate is greater than or equal to 1% and less than 5% (exclusive), the policy of turning off "memory post-copy" and turning on "active CPU frequency reduction" is output.

[0092] 3) If the packet loss rate is less than 1% and all the following conditions are met: the minimum delay is less than or equal to 0.12ms, the average delay is less than or equal to 0.15ms, the maximum delay is less than or equal to 0.30ms, and the delay standard deviation is less than or equal to 0.05ms, then the output turns on the "memory post-copy" policy and turns off the "active CPU frequency reduction" policy.

[0093] 4) If the packet loss rate is less than 1% and all of the following conditions are met: the minimum delay is between (0.12ms-0.15ms], the average delay is between (0.15ms-0.2ms], the maximum delay is between (0.30ms-0.35ms], and the standard deviation of the delay is between (0.15ms-0.1ms], then the output turns on the strategy of "copy after memory" and "active CPU frequency reduction".

[0094] 5) If the packet loss rate is less than 1% and at least one of the following conditions is met: the minimum delay is greater than or equal to 0.15ms, the average delay is greater than or equal to 0.2ms, the maximum delay is greater than or equal to 0.35ms, and the delay standard deviation is greater than or equal to 0.1ms, then the policy of turning off "memory post-copy" and "active CPU frequency reduction" is output.

[0095] In this embodiment, when the main control platform issues a "prohibit virtual machine migration from the first host to the second host", the virtual machine migration is not performed. After the main control platform outputs the corresponding migration strategy, the first host and the second host migrate the virtual machine according to the migration strategy, thereby achieving the migration of the virtual machine from the first host to the second host.

[0096] The method provided in the embodiment of the present application is described above. The device provided in the embodiment of the present application is described below:

[0097] See also Figure 4 , Figure 4 This is a diagram of the device structure provided in the embodiment of the present application. Figure 4 As shown, the device is applied to a network device, and the network device is used to manage multiple hosts in a local area network; the device includes: a first execution module 401 and a second execution module 402.

[0098] The first execution module 401 is used for outputting a first migration strategy matching the bandwidth before the virtual machine is migrated from the current first host to the second host, if the bandwidth allocated to the link for migrating the virtual machine from the first host to the second host is less than the set bandwidth lower limit, so as to migrate the virtual machine according to the first migration strategy; the first migration strategy is used to indicate a strategy of closing the memory post-copy and opening the CPU active frequency reduction;

[0099] The second execution module 402 is configured to: if the bandwidth is greater than or equal to the bandwidth lower limit,

[0100] When the current bandwidth utilization of the link is greater than or equal to the set bandwidth utilization upper limit, an indication is output, where the indication is used to indicate prohibiting the migration of the virtual machine from the first host to the second host;

[0101] When the bandwidth utilization is between the upper limit of the bandwidth utilization and the set lower limit of the bandwidth utilization, if the bandwidth utilization meets one of the requirements of the set CPU active frequency reduction, a first migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the first migration strategy; if the bandwidth utilization does not meet the set CPU active frequency reduction, a second migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the second migration strategy; the second migration strategy is used to indicate a strategy for closing memory post-copying and closing CPU active frequency reduction.

[0102] As an embodiment, the bandwidth utilization is obtained by the following steps:

[0103] Obtaining the average output flow and average input flow of the interface of the local connection link of the first host within a specified inspection time period; the average output flow is sent to the second host according to the IP address of the second host; the average input flow is received from the second host according to the IP address of the second host;

[0104] The bandwidth utilization is determined based on the average output traffic, the average input traffic, and the bandwidth allocated to the link.

[0105] As an embodiment, the device further includes: a third execution module, configured to obtain network delay information and packet loss information between the first host and the second host when the bandwidth utilization is less than the bandwidth utilization lower limit;

[0106] Determine whether to migrate the virtual machine based on network delay information and packet loss information;

[0107] When determining to migrate the virtual machine, a third migration strategy matching the network delay information and the packet loss information is output, and the virtual machine is migrated according to the third migration strategy.

[0108] As an embodiment, obtaining network delay information and packet loss information between the first host and the second host includes:

[0109] Control the first host to send multiple test data packets to the second host through the link at set time intervals;

[0110] The network delay information and packet loss information are determined based on the response of the second host to each test data packet.

[0111] As an embodiment, the packet loss information is reflected by the packet loss rate; wherein, when the packet loss rate is greater than or equal to a set packet loss rate upper limit, the virtual machine is not migrated.

[0112] As an embodiment, the packet loss information is reflected by the packet loss rate; wherein, when the packet loss rate is between a set packet loss rate upper limit value and a set packet loss rate lower limit value, the third migration strategy is the first migration strategy.

[0113] As an embodiment, the packet loss information is reflected by the packet loss rate; the network delay parameter is reflected by multiple delay indicators; the multiple delay indicators at least include a minimum delay value, an average delay value, a maximum delay value, and a delay standard deviation;

[0114] When the packet loss rate is less than the set packet loss rate lower limit, then:

[0115] When each of the multiple delay indicators is less than the set delay indicator lower limit value corresponding to the delay indicator, the third migration strategy is used to indicate a strategy of enabling memory post-copying and disabling active CPU frequency reduction;

[0116] When each of the multiple delay indicators is greater than or equal to the set delay indicator lower limit value corresponding to the delay indicator, and less than the set delay indicator upper limit value corresponding to the delay indicator, the third migration strategy is used to indicate the strategy of enabling memory post-copying and enabling active CPU frequency reduction;

[0117] If there is a delay indicator among the multiple delay indicators that is greater than or equal to a set delay indicator upper limit value corresponding to the delay indicator, the third migration strategy is the second migration strategy.

[0118] So far, completed Figure 4 Structural description of the device shown.

[0119] See also Figure 5 , Figure 5 This is a structural diagram of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.

[0120] Based on the same application concept as the above method, an embodiment of the present application also provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.

[0121] Exemplarily, the above-mentioned machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage medium, or a combination thereof.

[0122] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A virtual machine migration method, characterized in that: The method is applied to a network device, which is used to manage multiple hosts in a local area network; the method comprises: Before the virtual machine is migrated from the current first host to the second host, if the bandwidth allocated to the link for migrating the virtual machine from the first host to the second host is less than the set bandwidth lower limit, a first migration strategy matching the bandwidth is output to migrate the virtual machine according to the first migration strategy; the first migration strategy is used to indicate a strategy of closing the memory post-copy and opening the CPU active frequency reduction; If the bandwidth is greater than or equal to the bandwidth lower limit, then: When the current bandwidth utilization of the link is greater than or equal to a set bandwidth utilization upper limit, an indication is output, where the indication is used to indicate that the virtual machine is prohibited from migrating from the first host to the second host; When the bandwidth utilization is between the bandwidth utilization upper limit and the set bandwidth utilization lower limit, if the bandwidth utilization meets one of the set CPU active frequency reduction requirements, the first migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the first migration strategy; if the bandwidth utilization does not meet the set CPU active frequency reduction, the second migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the second migration strategy; the second migration strategy is used to indicate a strategy for closing memory post-copying and closing CPU active frequency reduction.

2. The method according to claim 1, characterized in that The bandwidth utilization is obtained by following the steps: Obtaining an average output flow and an average input flow of an interface locally connected to the link of the first host within a specified inspection time period; The average output traffic is sent to the second host according to the IP address of the second host; The average input traffic is received from the second host according to the IP address of the second host; The bandwidth utilization is determined according to the average output flow, the average input flow, and the bandwidth allocated to the link.

3. The method according to claim 1, characterized in that The method further comprises: When the bandwidth utilization is less than the bandwidth utilization lower limit, obtaining network delay information and packet loss information between the first host and the second host; Determining whether to migrate the virtual machine according to the network delay information and the packet loss information; When determining to migrate the virtual machine, a third migration strategy matching the network delay information and the packet loss information is output, and the virtual machine is migrated according to the third migration strategy.

4. The method according to claim 1, characterized in that The network delay information and the packet loss information are obtained by the following steps: Control the first host to send a plurality of test data packets to the second host through the link at set time intervals; The network delay information and the packet loss information are determined depending on the response of the second host to each test data packet.

5. The method according to claim 3, characterized in that: The packet loss information is reflected by a packet loss rate; wherein, when the packet loss rate is greater than or equal to a set packet loss rate upper limit, the virtual machine is not migrated.

6. The method according to claim 3, characterized in that The packet loss information is reflected by a packet loss rate; wherein, when the packet loss rate is between a set packet loss rate upper limit value and a set packet loss rate lower limit value, the third migration strategy is the first migration strategy.

7. The method according to claim 3, characterized in that The packet loss information is reflected by the packet loss rate; the network delay parameter is reflected by multiple delay indicators; the multiple delay indicators at least include a minimum delay value, an average delay value, a maximum delay value, and a delay standard deviation; When the packet loss rate is less than the set packet loss rate lower limit, then: When each of the multiple delay indicators is less than the set delay indicator lower limit value corresponding to the delay indicator, the third migration strategy is used to indicate a strategy of turning on memory post-copy and turning off active CPU frequency reduction; When each of the multiple delay indicators is greater than or equal to the set delay indicator lower limit value corresponding to the delay indicator, and less than the set delay indicator upper limit value corresponding to the delay indicator, the third migration strategy is used to indicate a strategy of enabling post-memory copying and enabling active CPU frequency reduction; Among the multiple delay indicators, there is a delay indicator that is greater than or equal to a set delay indicator upper limit value corresponding to the delay indicator, and the third migration strategy is the second migration strategy.

8. A virtual machine migration device, characterized in that: The device is applied to a network device, and the network device is used to manage multiple hosts in a local area network; the device comprises: A first execution module is used for outputting a first migration strategy matching the bandwidth before the virtual machine is migrated from the current first host to the second host, if the bandwidth allocated to the link for migrating the virtual machine from the first host to the second host is less than a set bandwidth lower limit, so as to migrate the virtual machine according to the first migration strategy; the first migration strategy is used to indicate a strategy of closing the memory post-copy and opening the CPU active frequency reduction; The second execution module is configured to: if the bandwidth is greater than or equal to the bandwidth lower limit, then: When the current bandwidth utilization of the link is greater than or equal to a set bandwidth utilization upper limit, an indication is output, where the indication is used to indicate that the virtual machine is prohibited from migrating from the first host to the second host; When the bandwidth utilization is between the bandwidth utilization upper limit and the set bandwidth utilization lower limit, if the bandwidth utilization meets one of the set CPU active frequency reduction requirements, the first migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the first migration strategy; if the bandwidth utilization does not meet the set CPU active frequency reduction, the second migration strategy matching the bandwidth utilization is output to migrate the virtual machine according to the second migration strategy; the second migration strategy is used to indicate a strategy for closing memory post-copying and closing CPU active frequency reduction.

9. The device according to claim 8, characterized in that The bandwidth utilization is obtained by following the steps: Obtaining an average output flow and an average input flow of an interface locally connected to the link of the first host within a specified inspection time period; The average output traffic is sent to the second host according to the IP address of the second host; The average input traffic is received from the second host according to the IP address of the second host; Determine the bandwidth utilization rate according to the average output flow, the average input flow and the bandwidth allocated to the link; and / or, The device further includes: a third execution module, configured to obtain network delay information and packet loss information between the first host and the second host when the bandwidth utilization is less than the bandwidth utilization lower limit; Determining whether to migrate the virtual machine according to the network delay information and the packet loss information; When determining to migrate the virtual machine, outputting a third migration strategy that matches the network delay information and the packet loss information, and migrating the virtual machine according to the third migration strategy; and / or, The obtaining of network delay information and packet loss information between the first host and the second host comprises: Control the first host to send a plurality of test data packets to the second host through the link at set time intervals; Determining the network delay information and the packet loss information depending on the response of the second host to each test data packet; and / or, The packet loss information is reflected by the packet loss rate; wherein, when the packet loss rate is greater than or equal to the set packet loss rate upper limit, the virtual machine is not migrated; or, The packet loss information is reflected by a packet loss rate; wherein, when the packet loss rate is between a set packet loss rate upper limit and a set packet loss rate lower limit, the third migration strategy is the first migration strategy; or, The packet loss information is reflected by the packet loss rate; the network delay parameter is reflected by multiple delay indicators; the multiple delay indicators at least include a minimum delay value, an average delay value, a maximum delay value, and a delay standard deviation; When the packet loss rate is less than the set packet loss rate lower limit, then: When each of the multiple delay indicators is less than the set delay indicator lower limit value corresponding to the delay indicator, the third migration strategy is used to indicate a strategy of turning on memory post-copy and turning off active CPU frequency reduction; When each of the multiple delay indicators is greater than or equal to the set delay indicator lower limit value corresponding to the delay indicator, and less than the set delay indicator upper limit value corresponding to the delay indicator, the third migration strategy is used to indicate a strategy of enabling post-memory copying and enabling active CPU frequency reduction; Among the multiple delay indicators, there is a delay indicator that is greater than or equal to a set delay indicator upper limit value corresponding to the delay indicator, and the third migration strategy is the second migration strategy.

10. An electronic device, characterized in that: include: processor; as well as A memory, in which computer program instructions are stored, and when the computer program instructions are executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Virtual machine live migration method and device and storage medium

    CN114443211A

  • Thermal migration method, device and equipment and readable storage medium

    CN116820673A

  • Resource optimization for virtualization environments

    US20200065126A1