Virtual machine live migration method and system

By dynamically adjusting the read and write rate and capacity expansion rate of virtual machine disks, the problem of capacity expansion caused by IO pressure during virtual machine migration is solved, and the stable performance and business continuity during the migration process is achieved, and the system efficiency is improved. and reliability.

CN118939373APending Publication Date: 2024-11-12CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411010453.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

During the virtual machine migration process, the high internal IO pressure of the virtual machine causes disk expansion to fail to keep up with the demand, triggering IO write errors, causing the virtualization layer to be suspended, affecting the migration effect, and may lead to business interruption.

Method used

By determining the initial read and write rate and capacity expansion rate of the virtual machine disk, dynamically adjust the path status of the storage pool logical volume group, calculate the target read and write rate, and migrate the virtual machine disk from the first host to the second host during the migration process. , restore the initial read and write rate after the migration is completed to optimize disk performance and resource usage.

Benefits of technology

Ensure that the virtual machine disk performance meets expectations during the migration process, avoids performance degradation, reduces service interruption time, provides more stable and predictable disk performance, avoids business interruptions, and improves overall system efficiency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939373A_ABST
    Figure CN118939373A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual machine live migration method and system, and belongs to the technical field of migration. The method comprises the steps that the initial read-write rate of a virtual machine disk is determined; according to the path condition of disk equipment corresponding to a storage pool logical volume group where the virtual machine disk is located, the initial read-write rate is adjusted to obtain a first read-write rate, and the capacity expansion rate of the virtual machine disk is determined; obtaining a target read-write rate according to the first read-write rate and the capacity expansion rate; and migrating the virtual machine disk from the first host to the second host based on the target read-write rate, and setting the read-write rate of the virtual machine disk as the initial read-write rate after the migration is finished. According to the method, more stable and predictable disk performance can be provided in the migration process of the virtual machine, meanwhile, resource use is optimized, the overall efficiency and reliability of a system are improved, and service interruption of the virtual machine is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of migration, and in particular relates to a virtual machine hot migration method and system. Background Art

[0002] In the related art, when a virtual machine uses a logical volume whose disk type is a thin volume mode, and there are a large number of IOs inside the virtual machine, the disk used by the virtual machine will be continuously expanded to meet its internal IO write requirements; however, if the internal IO pressure is large, the internal space demand is much greater than the external expansion action, resulting in the expansion not being able to keep up with the internal demand of the virtual machine, thereby triggering an IO write error and causing the virtualization layer to suspend the virtual machine. During the migration process, if the virtual machine is suspended, it will actually cause business interruption inside the virtual machine, thereby affecting the effect of the migration. Therefore, how to better implement hot migration of virtual machines has become an urgent problem to be solved. Summary of the invention

[0003] In view of the above-mentioned deficiencies in the prior art, the purpose of the invention is to provide a virtual machine hot migration method and system, which can provide more stable and predictable disk performance during the virtual machine migration process, while optimizing resource utilization, improving the overall efficiency and reliability of the system, and avoiding business interruption of the virtual machine.

[0004] The first aspect of the present invention proposes a method for hot migration of a virtual machine, comprising: S1, determining the initial read and write rate of the virtual machine disk; S2, adjusting the initial read and write rate according to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, obtaining a first read and write rate, and determining the expansion rate of the virtual machine disk; S3, obtaining a target read and write rate according to the first read and write rate and the expansion rate; S4, migrating the virtual machine disk from the first host to the second host based on the target read and write rate, and after the migration is completed, setting the read and write rate of the virtual machine disk to the initial read and write rate.

[0005] Furthermore, according to the path status of the disk device corresponding to the logical volume group of the storage pool where the virtual machine disk is located, the initial read and write rate is adjusted to obtain the first read and write rate, including: determining the saturation of the storage path of the storage pool where the virtual machine disk is located; according to the saturation of the storage path, adjusting the initial read and write rate in a step manner to obtain the first read and write rate.

[0006] Furthermore, according to the saturation of the storage path, the initial read / write rate is adjusted in steps to obtain the first read / write rate, including: when the saturation of the storage path is within a first range, using the initial read / write rate as the first read / write rate; when the saturation of the storage path is less than the minimum value of the first range, increasing the initial read / write rate with a first step to obtain the first read / write rate; when the saturation of the storage path is greater than the maximum value of the first range, reducing the initial read / write rate with the first step to obtain the first read / write rate.

[0007] Furthermore, the expansion rate of the virtual machine disk is determined, including: determining a first space size corresponding to writing inside the virtual machine and a second actual space size of the virtual machine disk; when it is determined that the difference between the second actual space size and the first space size is less than a preset threshold space value, automatically expanding the capacity based on the second actual space size based on a preset expansion value, and determining the time required for automatic expansion; determining the expansion rate of the virtual machine disk according to the preset expansion value and the time required for automatic expansion; wherein, obtaining the target read and write rate according to the first read and write rate and the expansion rate includes: taking the minimum value of the first read and write rate and the expansion rate as the target read and write rate.

[0008] Furthermore, the method further includes: during the migration process, refreshing the capacity of the virtual machine disk on the second host to the capacity after automatic expansion.

[0009] Furthermore, after the migration is completed, the read and write rate of the virtual machine disk is set to the initial read and write rate, including: obtaining metadata of the virtual machine disk; determining whether the virtual machine disk has the initial read and write rate based on the metadata; and if it is determined that the initial read and write rate exists, setting the read and write rate of the virtual machine disk to the initial read and write rate.

[0010] Furthermore, the method further includes: when it is determined that the initial read / write rate does not exist, clearing the limit on the read / write rate of the virtual machine disk.

[0011] The second aspect of the present invention proposes a virtual machine hot migration system, including: a determination module for determining the initial read and write rate of the virtual machine disk; a first obtaining module for adjusting the initial read and write rate according to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, to obtain a first read and write rate, and to determine the expansion rate of the virtual machine disk; a second obtaining module for obtaining a target read and write rate according to the first read and write rate and the expansion rate; a migration module for migrating the virtual machine disk from the first host to the second host based on the target read and write rate, and after the migration is completed, setting the read and write rate of the virtual machine disk to the initial read and write rate.

[0012] According to a third aspect of the present invention, an electronic device is proposed, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the methods described in the first aspect of the present invention.

[0013] According to a fourth aspect of the present invention, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to the first aspect of the present invention.

[0014] The beneficial effects of the present invention are as follows:

[0015] The virtual machine hot migration method and system of the present invention determine the initial read and write rate of the virtual machine disk; adjust the initial read and write rate according to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, obtain the first read and write rate, and determine the expansion rate of the virtual machine disk; obtain the target read and write rate according to the first read and write rate and the expansion rate; migrate the virtual machine disk from the first host to the second host based on the target read and write rate, and set the read and write rate of the virtual machine disk to the initial read and write rate after the migration is completed. The method can dynamically adjust the read and write rate of the virtual machine disk by monitoring the path status of the disk device corresponding to the storage pool logical volume group. This adjustment can optimize the disk performance and ensure that good I / O performance can be obtained under various workloads; by determining the expansion rate, the data consistency and integrity are maintained during the migration process, and the service interruption time caused by the expansion is reduced; by combining the first read and write rate and the expansion rate to calculate the target read and write rate, it can be ensured that the performance of the virtual machine disk meets expectations during the migration process, and the performance degradation caused by the migration is avoided; by resetting the read and write rate of the virtual machine disk to the initial read and write rate after the migration is completed, it is helpful to restore the performance level before the migration and ensure the continuity and stability of the service. This method can provide more stable and predictable disk performance during virtual machine migration, while optimizing resource usage, improving the overall efficiency and reliability of the system, and avoiding business interruption of the virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.

[0017] Figure 1 is a flow chart of a method for hot migration of a virtual machine according to an embodiment of the present invention;

[0018] Figure 2 is a flow chart of a virtual machine hot migration method according to a specific embodiment of the present invention;

[0019] Figure 3 is a structural block diagram of a virtual machine hot migration system according to an embodiment of the present invention;

[0020] Figure 4 It is a structural block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.

[0022] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.

[0023] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0024] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.

[0025] With the popularity and application of cloud computing, users have higher and higher demands for scalability, high availability and flexibility, and cloud host migration technology has been developed to meet these demands. The core goal of this technology is to achieve seamless migration of virtual machine instances running in a cloud environment to provide high availability, resource management and fault recovery capabilities.

[0026] The background of cloud host migration technology can be traced back to the early virtualization technology. The emergence of virtualization technology makes it possible to run multiple virtual machines on a physical server. However, when the physical server needs to be maintained, capacity adjusted, or fails, the traditional virtual machine migration technology cannot meet the requirements of real-time migration and business continuity. In order to solve this problem, cloud host migration technology came into being.

[0027] The core idea of ​​cloud host migration technology is to synchronize the changed data between the source host and the target host in real time, and only transfer the incremental data to reduce the data transmission volume and migration time. Through incremental backup and incremental recovery and other technical means, only the changed data is incrementally transferred to the target host, while ensuring business continuity and data consistency. This technology has a wide range of application scenarios, especially for cloud computing platforms that need to achieve high availability and fault recovery.

[0028] The development of cloud host migration technology is inseparable from the research and innovation in related fields. At the hardware level, support for virtualization and cloud computing technologies is constantly improving, such as CPU virtualization extension, I / O virtualization, and hardware-assisted acceleration. At the network level, the development of network virtualization and software-defined networking (SDN) provides better network support and resource management capabilities for cloud host migration. At the storage level, the advancement of snapshot technology, incremental backup, and data replication technologies provide more efficient means for data migration and protection.

[0029] Cloud host migration technology still faces some challenges and limitations, especially when the virtual machine uses thin-provisioned logical volumes. During the migration process, it is necessary to consider the IO write rate inside the virtual machine exceeding the LV expansion rate to prevent the virtual machine from being suspended and affecting the virtual machine's business.

[0030] Cloud host migration technology is one of the key technologies in cloud computing environments, and plays an important role in providing high availability, resource management, and fault recovery capabilities. With the continuous development of virtualization, network, and storage technologies, cloud host migration technology will continue to improve and innovate to meet users' growing needs for scalability, high availability, and flexibility.

[0031] In the prior art, if a virtual machine uses a logical volume with a disk type of thin volume mode, and there is a large amount of IO inside the virtual machine, the disk used by the virtual machine will be continuously expanded to meet its internal IO write requirements; however, if the internal IO pressure is large, the internal space demand is much greater than the external expansion action, resulting in the expansion not being able to keep up with the internal demand of the virtual machine, thereby triggering an IO write error and causing the virtualization layer to suspend the virtual machine. During the migration process, if the virtual machine is suspended, it will actually cause business interruption inside the virtual machine, thus affecting the effect of the migration.

[0032] To this end, the present invention proposes a virtual machine hot migration method, system and related equipment. Specifically, the virtual machine hot migration method, system and related equipment of the embodiments of the present invention are described below with reference to the accompanying drawings.

[0033] Figure 1 1 is a flow chart of a virtual machine hot migration method according to an embodiment of the present invention. It should be noted that the virtual machine hot migration method according to the embodiment of the present invention can be applied to the virtual machine hot migration system according to the embodiment of the present invention. The virtual machine hot migration system can be configured on an electronic device or in a server. The present application embodiment does not limit this.

[0034] like Figure 1 As shown, the virtual machine hot migration method includes:

[0035] S110, determining an initial read and write rate of the virtual machine disk.

[0036] In an embodiment of the present invention, the initial read and write rate of the virtual machine disk may be determined based on the metadata of the virtual machine disk.

[0037] In one embodiment of the present invention, when the initial read / write rate of the virtual machine disk is not defined in the metadata of the virtual machine disk, the initial read / write rate of the virtual machine disk can be preset, and the preset value is used as the initial read / write rate of the virtual machine disk.

[0038] S120, adjusting the initial read / write rate according to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, obtaining a first read / write rate, and determining the capacity expansion rate of the virtual machine disk.

[0039] In an embodiment of the present invention, the saturation of the storage path of the storage pool where the virtual machine disk is located is determined; according to the saturation of the storage path, the initial read and write rate is adjusted in a step-size manner to obtain a first read and write rate, and the capacity expansion rate of the virtual machine disk is determined. The specific implementation method can refer to the subsequent embodiments.

[0040] S130, obtaining a target read / write rate according to the first read / write rate and the expansion rate.

[0041] In an embodiment of the present invention, when the first read / write rate and the expansion rate are obtained, the minimum value of the first read / write rate and the expansion rate can be used as the target read / write rate. That is, the minimum value of the two can be used as the target read / write rate.

[0042] S140, based on the target read / write rate, migrate the virtual machine disk from the first host to the second host, and after the migration is completed, set the read / write rate of the virtual machine disk to the initial read / write rate.

[0043] In an embodiment of the present invention, when the target read / write rate is obtained, the virtual machine disk can be migrated from the first host to the second host based on the target read / write rate. After the migration is completed, the read / write rate of the virtual machine disk is set to the initial read / write rate to maintain the original performance configuration.

[0044] According to the virtual machine hot migration method of the embodiment of the present invention, the initial read and write rate of the virtual machine disk is determined; the initial read and write rate is adjusted according to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, the first read and write rate is obtained, and the expansion rate of the virtual machine disk is determined; the target read and write rate is obtained according to the first read and write rate and the expansion rate; based on the target read and write rate, the virtual machine disk is migrated from the first host to the second host, and after the migration is completed, the read and write rate of the virtual machine disk is set to the initial read and write rate. The method can dynamically adjust the read and write rate of the virtual machine disk by monitoring the path status of the disk device corresponding to the storage pool logical volume group. This adjustment can optimize the disk performance and ensure that good I / O performance can be obtained under various workloads; by determining the expansion rate, data consistency and integrity are maintained during the migration process, and the service interruption time caused by expansion is reduced; by combining the first read and write rate and the expansion rate to calculate the target read and write rate, it can be ensured that the performance of the virtual machine disk meets expectations during the migration process, and the performance degradation caused by the migration is avoided; by resetting the read and write rate of the virtual machine disk to the initial read and write rate after the migration is completed, it is helpful to restore the performance level before the migration and ensure the continuity and stability of the service. This method can provide more stable and predictable disk performance during virtual machine migration, while optimizing resource usage, improving the overall efficiency and reliability of the system, and avoiding business interruption of the virtual machine.

[0045] In order to make it easier for those skilled in the art to understand the present invention, Figure 2 A virtual machine hot migration method according to a specific embodiment of the present invention is as follows. Figure 2 As shown, the virtual machine hot migration method includes:

[0046] S210, determining an initial read and write rate of a virtual machine disk.

[0047] In the embodiment of the present invention, the implementation of step S210 may refer to the implementation of step S110 described above, and the present invention will not elaborate on this any more.

[0048] S220, adjusting the initial read / write rate according to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, to obtain a first read / write rate.

[0049] In an embodiment of the present invention, the saturation of a storage path of a storage pool where a virtual machine disk is located is determined; and according to the saturation of the storage path, the initial read / write rate is adjusted in a step-by-step manner to obtain a first read / write rate.

[0050] Among them, when the saturation of the storage path is within the first range, the initial read and write rate is used as the first read and write rate; when the saturation of the storage path is less than the minimum value of the first range, the initial read and write rate is increased with the first step length to obtain the first read and write rate; when the saturation of the storage path is greater than the maximum value of the first range, the initial read and write rate is reduced with the first step length to obtain the first read and write rate.

[0051] For example, when the saturation of the storage path is between 50% and 80%, the initial read / write rate of 50MB / s is used as the first read / write rate. When the saturation of the storage path is less than 50%, the initial read / write rate is increased by a step size of 10MB / s to obtain the first read / write rate. When the saturation of the storage path is greater than 80%, the initial read / write rate is reduced by a step size of 10MB / s to obtain the first read / write rate.

[0052] In an embodiment of the present invention, the saturation of the storage path can be determined based on the storage space utilization rate, the storage I / O operation frequency, the response time of the storage path, etc. Among them, the storage space utilization rate is the most direct indicator to measure the saturation of the storage path, which is obtained by calculating the ratio of the used storage space to the total storage space. For example, if the total capacity of a storage path is 100GB and the used storage space is 80GB, then its saturation is 80%; if the I / O operation of the storage path is very frequent, it means that the saturation of the storage path is high. This is because high-frequency I / O operations may cause the performance of the storage path to degrade, thereby affecting its ability to process other requests; if the response time of the storage path is long, it means that the saturation of the storage path is high. Because when the storage path is heavily loaded, its speed of processing requests may slow down, resulting in an increase in response time.

[0053] S230: Determine the capacity expansion rate of the virtual machine disk.

[0054] In an embodiment of the present invention, a first space size corresponding to writing inside the virtual machine and a second actual space size of the virtual machine disk are determined; when it is determined that the difference between the second actual space size and the first space size is less than a preset threshold space value, automatic expansion is performed based on the second actual space size based on a preset expansion value, and the time required for automatic expansion is determined; based on the preset expansion value and the time required for automatic expansion, the expansion rate of the virtual machine disk is determined.

[0055] The ratio of the preset expansion value to the time required for automatic expansion is used as the expansion rate of the virtual machine disk.

[0056] For example, the second actual space size of the virtual machine disk is 1G, that is, the initial size physical actual occupied space is 1G, the preset threshold space value is 1G, and the virtual space is 100G, that is, the available space seen inside the virtual machine is 100G; wherein, when 0.1G is written inside the virtual machine, the available space can be judged, that is, the difference between the second actual space size 1G and the first space size 0.1G is 0.9G. When the difference 0.9G is less than the preset threshold space value of 1G, automatic expansion is performed based on the preset expansion value 2G on the basis of the second actual space size 1G, that is, the actual space size after expansion is 3G (the sum of 1G and 2G), and the time required for automatic expansion is determined, and then the ratio of the preset expansion value to the time required for automatic expansion is determined, and the ratio is used as the expansion rate of the virtual machine disk.

[0057] S240: Obtain a target read / write rate according to the first read / write rate and the expansion rate.

[0058] In an embodiment of the present invention, when the first read / write rate and the expansion rate are obtained, the minimum value of the first read / write rate and the expansion rate is used as the target read / write rate, that is, the first read / write rate and the expansion rate are compared, and the minimum value of the two is used as the target read / write rate.

[0059] S250: Migrate the virtual machine disk from the first host to the second host based on the target read and write rate.

[0060] In an embodiment of the present invention, when the target read / write rate is obtained, the virtual machine disk may be migrated from the first host to the second host based on the target read / write rate.

[0061] In one embodiment of the present invention, during the migration process, the capacity of the virtual machine disk on the second host is refreshed to the capacity after automatic expansion.

[0062] S260, after the migration is completed, the read and write rate of the virtual machine disk is set to the initial read and write rate.

[0063] In an embodiment of the present invention, metadata of a virtual machine disk is obtained; based on the metadata, it is determined whether the virtual machine disk has an initial read / write rate; if it is determined that an initial read / write rate exists, the read / write rate of the virtual machine disk is set to the initial read / write rate.

[0064] In one embodiment of the present invention, when it is determined that there is no initial read / write rate, the limit on the read / write rate of the virtual machine disk is cleared.

[0065] According to the method for hot migration of virtual machines in an embodiment of the present invention, by determining the initial read / write rate of the virtual machine disk and adjusting the read / write rate according to the status of the storage path, a first read / write rate can be obtained. This helps to improve the read / write performance of the virtual machine disk, thereby improving the performance of the entire virtualization environment; according to the corresponding space size when writing inside the virtual machine and the actual space size of the virtual machine disk, the expansion rate of the virtual machine disk can be determined. This enables the virtual machine disk to be automatically expanded according to actual needs, improving resource utilization and flexibility; when the target read / write rate is obtained, the virtual machine disk can be migrated from the first host to the second host. During the migration process, the capacity of the virtual machine disk on the second host is refreshed to the capacity after automatic expansion. This helps to reduce performance loss during the migration process and improve migration efficiency; after the migration is completed, the read / write rate of the virtual machine disk is set to the initial read / write rate. This helps to ensure that the virtual machine disk still maintains its original performance after migration; the method can dynamically adjust the read / write rate and expansion rate of the virtual machine disk according to factors such as the storage path status and storage space usage rate in different scenarios, that is, by automatically managing the read / write rate, expansion rate, etc. of the virtual machine disk, manual intervention can be reduced, the complexity of storage management can be reduced, and business interruption of the virtual machine can be avoided.

[0066] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0067] According to one aspect of an embodiment of the present invention, a virtual machine hot migration system is also proposed. Figure 3 is a structural block diagram of a virtual machine hot migration system according to an embodiment of the present invention; Figure 3 As shown, including:

[0068] The determination module 310 is used to determine the initial read and write rate of the virtual machine disk;

[0069] A first obtaining module 320 is used to adjust the initial read / write rate according to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, obtain the first read / write rate, and determine the expansion rate of the virtual machine disk;

[0070] A second obtaining module 330, configured to obtain a target reading and writing rate according to the first reading and writing rate and the expansion rate;

[0071] The migration module 340 is configured to migrate the virtual machine disk from the first host to the second host based on the target read / write rate, and after the migration is completed, set the read / write rate of the virtual machine disk to the initial read / write rate.

[0072] According to the virtual machine hot migration system of the embodiment of the present invention, the initial read and write rate of the virtual machine disk is determined; the initial read and write rate is adjusted according to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, the first read and write rate is obtained, and the expansion rate of the virtual machine disk is determined; the target read and write rate is obtained according to the first read and write rate and the expansion rate; based on the target read and write rate, the virtual machine disk is migrated from the first host to the second host, and after the migration is completed, the read and write rate of the virtual machine disk is set to the initial read and write rate. Therefore, by monitoring the path status of the disk device corresponding to the storage pool logical volume group, the read and write rate of the virtual machine disk can be dynamically adjusted. This adjustment can optimize the disk performance and ensure that good I / O performance can be obtained under various workloads; by determining the expansion rate, data consistency and integrity are maintained during the migration process, and the service interruption time caused by expansion is reduced; by combining the first read and write rate and the expansion rate to calculate the target read and write rate, it can be ensured that the performance of the virtual machine disk during the migration process meets expectations and avoids performance degradation caused by migration; by resetting the read and write rate of the virtual machine disk to the initial read and write rate after the migration is completed, it is helpful to restore the performance level before the migration and ensure the continuity and stability of the service. This can provide more stable and predictable disk performance during virtual machine migration, while optimizing resource usage, improving the overall efficiency and reliability of the system, and avoiding business interruptions to virtual machines.

[0073] Optionally, the first obtaining module 320 is specifically used to determine the saturation of the storage path of the storage pool where the virtual machine disk is located; according to the saturation of the storage path, the initial read and write rate is adjusted in a step manner to obtain the first read and write rate.

[0074] Optionally, the first obtaining module 320 is specifically used to use the initial read / write rate as the first read / write rate when the saturation of the storage path is within the first range; to increase the initial read / write rate with the first step length to obtain the first read / write rate when the saturation of the storage path is less than the minimum value of the first range; and to reduce the initial read / write rate with the first step length to obtain the first read / write rate when the saturation of the storage path is greater than the maximum value of the first range.

[0075] Optionally, the first obtaining module 320 is specifically used to determine a first space size corresponding to writing inside the virtual machine and a second actual space size of the virtual machine disk; when it is determined that the difference between the second actual space size and the first space size is less than a preset threshold space value, automatic expansion is performed based on the second actual space size based on a preset expansion value, and the time required for automatic expansion is determined; based on the preset expansion value and the time required for automatic expansion, the expansion rate of the virtual machine disk is determined; wherein, the second obtaining module 330 is specifically used to use the minimum value of the first read and write rate and the expansion rate as the target read and write rate.

[0076] Optionally, the system further includes: a refresh module, and the refresh module is used to refresh the capacity of the virtual machine disk on the second host to the capacity after automatic expansion during the migration process.

[0077] Optionally, the migration module 340 is specifically used to obtain metadata of the virtual machine disk; determine whether the virtual machine disk has the initial read and write rate based on the metadata; and if it is determined that the initial read and write rate exists, set the read and write rate of the virtual machine disk to the initial read and write rate.

[0078] Optionally, the migration module 340 is specifically configured to clear the limit on the read / write rate of the virtual machine disk when it is determined that the initial read / write rate does not exist.

[0079] According to one aspect of an embodiment of the present invention, an electronic device is provided.

[0080] Figure 4 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Figure 4 As shown, the electronic device may include one or more ( Figure 4 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a microprocessor (Microprocessor Unit, referred to as MPU) or a programmable logic device (Programmable logic device, referred to as PLD)) and a memory 104 for storing data. In an exemplary embodiment, the electronic device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only and does not limit the structure of the above terminal device. Figure 4 More or fewer components as shown, or with Figure 4 Equivalent functions or comparisons shown Figure 4 A different configuration with more features is shown.

[0081] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the virtual machine hot migration method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0082] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the switching device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0083] The present invention provides a non-transient computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute a virtual machine hot migration method.

[0084] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.

[0085] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0086] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.

Claims

1. A virtual machine hot migration method, characterized in that: include: S1, determine the initial read and write rate of the virtual machine disk; S2, adjusting the initial read / write rate according to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, obtaining a first read / write rate, and determining the expansion rate of the virtual machine disk; S3, obtaining a target read / write rate according to the first read / write rate and the expansion rate; S4, based on the target read / write rate, migrating the virtual machine disk from the first host to the second host, and after the migration is completed, setting the read / write rate of the virtual machine disk to the initial read / write rate.

2. The method for hot migration of a virtual machine according to claim 1, characterized in that: According to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, adjusting the initial read / write rate to obtain the first read / write rate includes: Determine the saturation of the storage path of the storage pool where the virtual machine disk is located; The initial read / write rate is adjusted in a step-by-step manner according to the saturation of the storage path to obtain the first read / write rate.

3. The method for hot migration of a virtual machine according to claim 2, characterized in that: According to the saturation of the storage path, the initial read / write rate is adjusted in a step-by-step manner to obtain the first read / write rate, including: When the saturation of the storage path is within a first range, using the initial read / write rate as the first read / write rate; When the saturation of the storage path is less than the minimum value of the first range, increasing the initial read / write rate by a first step length to obtain the first read / write rate; When the saturation of the storage path is greater than the maximum value of the first range, the initial read / write rate is reduced by the first step length to obtain the first read / write rate.

4. The method for hot migration of a virtual machine according to claim 1, characterized in that: Determining the capacity expansion rate of the virtual machine disk includes: Determine a first space size corresponding to writing inside the virtual machine and a second actual space size of the virtual machine disk; When it is determined that the difference between the second actual space size and the first space size is less than a preset threshold space value, automatically expand the capacity based on the second actual space size based on the preset expansion value, and determine the time required for the automatic expansion; Determine the capacity expansion rate of the virtual machine disk according to the preset capacity expansion value and the time required for the automatic capacity expansion; wherein, Obtaining the target read / write rate according to the first read / write rate and the expansion rate includes: The minimum value of the first read / write rate and the capacity expansion rate is used as the target read / write rate.

5. The method for hot migration of a virtual machine according to claim 1, characterized in that: The method further comprises: During the migration process, the capacity of the virtual machine disk on the second host is refreshed to the capacity after automatic expansion.

6. The method for hot migration of a virtual machine according to claim 1, characterized in that: After the migration is completed, setting the read / write rate of the virtual machine disk to the initial read / write rate includes: Obtaining metadata of the virtual machine disk; Determining whether the virtual machine disk has the initial read / write rate based on the metadata; When it is determined that the initial read / write rate exists, the read / write rate of the virtual machine disk is set to the initial read / write rate.

7. The method for hot migration of a virtual machine according to claim 6, characterized in that: The method further comprises: When it is determined that the initial read / write rate does not exist, the limit on the read / write rate of the virtual machine disk is cleared.

8. A virtual machine hot migration system, characterized in that: include: A determination module, used to determine the initial read and write rate of the virtual machine disk; A first obtaining module is used to adjust the initial read / write rate according to the path status of the disk device corresponding to the storage pool logical volume group where the virtual machine disk is located, obtain the first read / write rate, and determine the expansion rate of the virtual machine disk; A second obtaining module, configured to obtain a target reading and writing rate according to the first reading and writing rate and the expansion rate; The migration module is used to migrate the virtual machine disk from the first host to the second host based on the target read / write rate, and after the migration is completed, set the read / write rate of the virtual machine disk to the initial read / write rate.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Data migration method and device, computer equipment and readable storage medium

    CN119201011A

  • Initialization method of disk array and storage cluster

    CN120353508A

  • Disk array initialization method and storage cluster

    CN120353508B