Virtual machine data migration method, device, system, and server
By detecting virtual machine data operating parameters and backing up data blocks to storage devices, the problem of virtual machine data migration occupying a large amount of network bandwidth is solved, and the effect of flexibly controlling data migration and reducing the impact on the virtual machine's network bandwidth is achieved.
Patent Information
- Application Number
- CN202410949991.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-07-16
AI Technical Summary
During the migration of virtual machine data, a large amount of network bandwidth is occupied, resulting in tasks being extended and affecting the business performance of other virtual machines.
By detecting the data running parameters of the virtual machine, the target data blocks are backed up to the storage device and migrated based on the network bandwidth of the host system to avoid continuously occupying the network bandwidth of the virtual machine.
It effectively reduces the occupation of network bandwidth by virtual machine data migration, avoids the impact on the operation of virtual machines, and improves migration efficiency.
Smart Images

Figure CN118484269B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the computer field, and specifically, to a method and device, system, and server for migrating virtual machine data. Background Art
[0002] The virtual machine migration function is a common function in the current virtualization platform. When the resource utilization rate in the resource pool corresponding to the virtualization platform where the virtual machine is located is high, in order to avoid resource competition between virtual machines, the virtual machine migration function needs to intervene, so that the virtual machine can be migrated to other resource pools of the virtualization platform without internal perception, so as to ensure that the internal business performance will not be reduced; or when the user wants to re-plan and integrate the resource pool of the virtualization platform, it can also ensure that the business inside the virtual machine is not affected during the integration process. Therefore, virtual machine migration technology has always maintained a very important position in the development of virtualization.
[0003] In virtualization migration scenarios, migration between storage pools is more common. However, for some business virtual machines with large I / O services and limited migration network bandwidth, the data migration process will be very long. Not only will the task not be completed in a short time, but it will also continue to occupy network bandwidth, causing greater impact on other virtual machines' services that rely on network bandwidth. Summary of the invention
[0004] The embodiments of the present application provide a method and device, system, and server for migrating virtual machine data, so as to at least solve the problem in the related art that the migration of virtual machine data occupies a large amount of network bandwidth.
[0005] According to an embodiment of the present application, a method for migrating virtual machine data is provided, comprising: detecting data operation parameters of a first virtual machine, wherein the data operation parameters include input / output I / O request data received by the first virtual machine and a network bandwidth for data transmission by the first virtual machine in response to the I / O request data, and the first virtual machine is a virtual machine among multiple virtual machines included in a first host system; backing up target data blocks in a first virtual machine disk to a first storage device according to the data operation parameters, wherein the first virtual machine disk is a disk to be migrated and deployed in a first storage pool of the first virtual machine, and the target data blocks include full data blocks and incremental data blocks, and the first storage device is a device deployed in the first host system and connected to the first virtual machine disk; migrating the target data blocks backed up to the first storage device to a second virtual machine disk based on the network bandwidth of the first host system, wherein the second virtual machine disk is a disk deployed in a second storage pool of the second virtual machine, and the second virtual machine is a virtual machine among multiple virtual machines included in the second host system.
[0006] In an exemplary embodiment, detecting data operation parameters of a first virtual machine includes: detecting a frequency of the first virtual machine responding to the I / O request data in each of one or more time periods, a data processing volume in response to the I / O request data, and data delay information in response to the I / O request data; when the first virtual machine responds to the I / O request data in each of the time periods, detecting a data transmission rate and a bandwidth utilization rate of the first virtual machine to obtain a network bandwidth for data transmission by the first virtual machine in response to the I / O request data; and determining the data operation parameters based on the frequency of responding to the I / O request data, the data processing volume in response to the I / O request data, the data delay information in response to the I / O request data, the data transmission rate and, and the network bandwidth for data transmission by the first virtual machine in response to the I / O request data.
[0007] In an exemplary embodiment, before backing up the target data blocks in the first virtual machine disk to the first storage device according to the above-mentioned data operation parameters, the above-mentioned method also includes: determining the first storage space of the above-mentioned first virtual machine disk, wherein the above-mentioned first storage space is the storage capacity allocated when the above-mentioned first virtual disk is initialized in the above-mentioned first host system; determining the above-mentioned first storage device according to the above-mentioned first storage space, wherein the storage space of the above-mentioned first storage device is greater than or equal to the above-mentioned first storage space; and establishing a connection between the above-mentioned first storage device and the above-mentioned first virtual machine disk.
[0008] In an exemplary embodiment, the target data blocks in the first virtual machine disk are backed up to the first storage device according to the above-mentioned data operation parameters, including: determining that the above-mentioned first virtual disk is a disk to be subjected to data migration; judging whether the network bandwidth of the above-mentioned first virtual machine satisfies the above-mentioned I / O request data; and in the case that the network bandwidth of the above-mentioned first virtual machine cannot satisfy the above-mentioned I / O request data, triggering a backup operation to back up the target data blocks in the above-mentioned first virtual machine disk to the first storage device.
[0009] In an exemplary embodiment, determining that the first virtual disk is a disk to be migrated for data includes one of the following: detecting the remaining storage space of the first virtual machine disk, and determining that the first virtual disk is a disk to be migrated for data when the remaining storage space is less than the preset storage space; receiving a backup instruction sent by the first host system to indicate that the first virtual disk is a disk to be migrated for data; detecting the operation of the first virtual machine disk, and determining that the first virtual disk is a disk to be migrated for data when an abnormality occurs in the operation of the first virtual machine disk; detecting the performance of the first virtual machine disk in responding to the I / O request data, and determining that the first virtual disk is a disk to be migrated for data when the performance is less than the preset performance; and determining that the first virtual disk is a disk to be migrated for data when a version upgrade instruction is obtained.
[0010] In an exemplary embodiment, determining whether the network bandwidth of the first virtual machine meets the I / O request data includes: obtaining first response data of the first virtual machine in response to an I / O read request, wherein the first response data includes: a first response time, and a data volume of the I / O read request; obtaining second response data of the first virtual machine in response to an I / O write request, wherein the second response data includes: a second response time, and a data volume of the I / O write request; and determining whether the network bandwidth of the first virtual machine meets the I / O request data using the first response data and the second response data.
[0011] In an exemplary embodiment, when the network bandwidth of the first virtual machine cannot meet the I / O request data, a backup operation is triggered to back up the target data block in the first virtual machine disk to the first storage device, including: when the network bandwidth of the first virtual machine cannot meet the I / O request data, determining the full data block in the first virtual machine disk, wherein the full data block includes all data stored in the first virtual machine disk before a first time point, and the first time point is the time point when the backup operation is triggered; determining the first incremental data block and the second incremental data block in the first virtual machine disk to obtain the incremental data block; and backing up the full data block and the incremental data block to the first storage device respectively.
[0012] In an exemplary embodiment, determining the first incremental data block and the second incremental data block in the above-mentioned first virtual machine disk to obtain the above-mentioned incremental data block includes: after the above-mentioned first time point and in the process of backing up the above-mentioned full data block to the above-mentioned first storage device, obtaining the data generated by the above-mentioned first virtual machine in response to the above-mentioned I / O request data to obtain the above-mentioned first incremental data block, wherein the above-mentioned first incremental data block includes one or more, and the above-mentioned first incremental data block is smaller than the preset bytes; in the process of triggering the operation of migrating the above-mentioned full data block and the above-mentioned first incremental data to the above-mentioned second virtual machine disk, obtaining the data generated by the above-mentioned first virtual machine in response to the above-mentioned I / O request data to obtain the above-mentioned second incremental data block, wherein the above-mentioned second incremental data block includes one or more, and the above-mentioned second incremental data block is smaller than the above-mentioned preset bytes.
[0013] In an exemplary embodiment, the full data blocks and the incremental data blocks are backed up to the first storage device respectively, including: determining a target backup tool, wherein the target backup tool is a tool with change block tracking, and the target backup tool is arranged in the first host system; backing up the full data blocks to the first storage device by the target backup tool; storing the incremental data blocks in the first storage device by the target backup tool when the incremental data blocks are included in the first virtual machine disk, wherein the incremental data blocks and the full data blocks are respectively stored in different storage spaces in the first storage device.
[0014] In an exemplary embodiment, the target data block backed up in the first storage device is migrated to the second virtual machine disk based on the network bandwidth of the first host system, including: after determining that the full data block is backed up to the first storage device, detecting the pressure state of the network bandwidth of the first host system; migrating the full data block to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system; and migrating the incremental data block to the second virtual machine disk when it is determined that the full data block has been migrated to the second virtual machine disk.
[0015] In an exemplary embodiment, after determining that the full data block is backed up to the first storage device, detecting the pressure state of the network bandwidth of the first host system includes: detecting the bandwidth utilization rate, network traffic and network delay of the first host system through a network performance detection tool, wherein the network performance detection tool is arranged in the first host system; determining the pressure state of the network bandwidth of the first host system based on the bandwidth utilization rate, network traffic and network delay of the first host system, wherein the pressure state includes an idle state and a load state.
[0016] In an exemplary embodiment, the full data block is migrated to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system, including: when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point, the full data block is statically migrated to the second virtual machine disk according to a first preset migration rate; wherein the static migration is used to indicate that the full data block is a non-real-time data block, and the first preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system.
[0017] In an exemplary embodiment, when it is determined that the full data block has been migrated to the second virtual machine disk, the incremental data block is migrated to the second virtual machine disk, including: when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point, the first incremental data block in the incremental data blocks is statically migrated to the second virtual machine disk according to a second preset migration rate, wherein the static migration is used to indicate that the first incremental data block is a non-real-time data block, and the second preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system; when it is determined that the first incremental data block has been migrated to the second virtual machine disk, the second incremental data block in the incremental data block is dynamically migrated to the second virtual machine disk according to the disk bitmap information of the first virtual machine, wherein the dynamic migration is used to indicate that the second incremental data block is a data block generated in real time by the first virtual machine, and in the process of dynamically migrating the second incremental data block, the first virtual machine is in a stopped state, and the disk bitmap information is used to record the data state of the data block in the first virtual machine, and when the data block changes, the change of the data block is marked with a preset value.
[0018] In an exemplary embodiment, when it is determined that the above-mentioned first incremental data block has been migrated to the above-mentioned second virtual machine disk, the second incremental data block in the above-mentioned incremental data block is dynamically migrated to the above-mentioned second virtual machine disk according to the disk bitmap information of the above-mentioned first virtual machine, including: when it is determined that the above-mentioned first incremental data block has been migrated to the above-mentioned second virtual machine disk, the above-mentioned disk bitmap information is obtained from the virtual machine memory of the above-mentioned first virtual machine; the bitmap information of the above-mentioned first incremental data block is compared with the above-mentioned disk bitmap information to determine the above-mentioned second incremental data block, wherein the above-mentioned second incremental data block is a data block generated in real time by the above-mentioned first virtual machine in the process of migrating the above-mentioned first incremental data block; and the above-mentioned second incremental data block is dynamically migrated to the above-mentioned second virtual machine disk.
[0019] In an exemplary embodiment, before detecting the data operation parameters of the first virtual machine, the method further includes: when the first virtual machine is turned on, loading the disk bitmap information of the first virtual machine into the virtual machine memory of the first virtual machine; wherein the disk bitmap information is used to record the data status of the data block in the first virtual machine, and when the data block changes, marking the change of the data block with a preset value.
[0020] In an exemplary embodiment, after migrating the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, the method further includes: sending an operation instruction to the second virtual machine to trigger the second virtual machine to perform an I / O operation on the target data block in the second virtual machine disk.
[0021] According to another embodiment of the present application, a migration device for virtual machine data is provided, comprising: a first detection module, for detecting data operation parameters of a first virtual machine, wherein the data operation parameters include input / output I / O request data received by the first virtual machine and a network bandwidth for data transmission by the first virtual machine in response to the I / O request data, and the first virtual machine is a virtual machine among multiple virtual machines included in a first host system; a first backup module, for backing up target data blocks in a first virtual machine disk to a first storage device according to the data operation parameters, wherein the first virtual machine disk is a disk to be migrated and deployed in a first storage pool of the first virtual machine, the target data blocks include full data blocks and incremental data blocks, and the first storage device is a device deployed in the first host system and connected to the first virtual machine disk; a first migration module, for migrating the target data blocks backed up in the first storage device to a second virtual machine disk based on the network bandwidth of the first host system, wherein the second virtual machine disk is a disk deployed in a second storage pool of the second virtual machine, and the second virtual machine is a virtual machine among multiple virtual machines included in the second host system.
[0022] According to another embodiment of the present application, a virtual machine data migration system is provided, including a processor, and the processor is used to implement the steps of the above method in any one of the above items.
[0023] According to another embodiment of the present application, a server is provided, including a first host system, a first virtual machine, a second host system, a second virtual machine, a first storage device, and a migration system for virtual machine data as described above.
[0024] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0025] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0026] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0027] Through the present application, the target data blocks in the first virtual machine disk are first backed up to the first storage device according to the data operation parameters of the first virtual machine, and then the target data blocks backed up to the first storage device are migrated to the second virtual machine disk based on the network bandwidth of the first host system. That is, the target data blocks are first backed up to the first storage device, and the migration of the target data blocks in the first storage device will not always occupy the network bandwidth of the first virtual machine, nor will it affect the operation of the first virtual machine. Therefore, the problem of virtual machine data migration occupying a large amount of network bandwidth in the related technology can be solved, and the effect of flexibly controlling data migration and minimizing the impact of data migration on the network bandwidth of the virtual machine can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for migrating virtual machine data according to an embodiment of the present application;
[0029] Figure 2 is a flow chart of a method for migrating virtual machine data according to an embodiment of the present application;
[0030] Figure 3 is a schematic diagram of data migration according to a specific embodiment of the present application;
[0031] Figure 4 is a structural block diagram of a device for migrating virtual machine data according to an embodiment of the present application;
[0032] Figure 5 is a structural block diagram of a virtual machine data migration system according to an embodiment of the present application;
[0033] Figure 6 It is a structural block diagram of a server according to an embodiment of the present application. DETAILED DESCRIPTION
[0034] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0036] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a method for migrating virtual machine data according to an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal 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 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0037] 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 method for migrating virtual machine data in the embodiment of the present application. 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 mobile terminal 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.
[0038] 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 mobile terminal. 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.
[0039] In this embodiment, a method for migrating virtual machine data is provided. Figure 2 is a flow chart of a method for migrating virtual machine data according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:
[0040] Step S202, detecting data operation parameters of the first virtual machine, wherein the data operation parameters include input / output I / O request data received by the first virtual machine and a network bandwidth for data transmission by the first virtual machine in response to the I / O request data, and the first virtual machine is a virtual machine among multiple virtual machines included in the first host system;
[0041] Step S204, backing up the target data blocks in the first virtual machine disk to the first storage device according to the data operation parameters, wherein the first virtual machine disk is a disk to be migrated and deployed in the first storage pool of the first virtual machine, the target data blocks include full data blocks and incremental data blocks, and the first storage device is a device deployed in the first host system and connected to the first virtual machine disk;
[0042] Step S206: Migrate the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, wherein the second virtual machine disk is a disk deployed in the second storage pool of the second virtual machine, and the second virtual machine is a virtual machine among the multiple virtual machines included in the second host system.
[0043] In this embodiment, the execution subject of the above steps can be a terminal, a server, a specific processor set in the terminal or server, or a processor or processing device set relatively independently from the terminal or server, but is not limited thereto.
[0044] Through the above steps, the target data blocks in the first virtual machine disk are first backed up to the first storage device according to the data operation parameters of the first virtual machine, and then the target data blocks backed up to the first storage device are migrated to the second virtual machine disk based on the network bandwidth of the first host system. That is, the target data blocks are first backed up to the first storage device, and the migration of the target data blocks in the first storage device will not always occupy the network bandwidth of the first virtual machine, nor will it affect the operation of the first virtual machine. Therefore, the problem of virtual machine data migration occupying a large amount of network bandwidth in the related technology can be solved, and the effect of flexibly controlling data migration and minimizing the network bandwidth impact of data migration on virtual machines can be achieved.
[0045] Optionally, the first host system and the second host system in this embodiment may be virtual hosts, which are physical servers running on the Internet divided into multiple "virtual" servers.
[0046] Optionally, the purpose of detecting the data operation parameters of the first virtual machine is to determine the size of the internal business I / O pressure of the first virtual machine and the network bandwidth. The internal business IO pressure of the first virtual machine refers to the pressure generated by the business application running inside the first virtual machine on the input and output operations of the virtual machine. This includes read and write operations on storage devices, network data transmission, and other business processing related to I / O. The size of the internal business I / O pressure of the first virtual machine depends on the nature and requirements of the business application, as well as the configuration and resource allocation of the virtual machine. If the business application needs to frequently perform a large number of data read and write operations, or needs to perform a large amount of data transmission with an external system, then the I / O pressure inside the virtual machine will be relatively large. There is a certain correlation between the size of the I / O pressure and the network bandwidth. The size of the internal business I / O pressure of the first virtual machine depends on the application running and the amount of data processed, while the network bandwidth determines the amount of data that can be transmitted when the first virtual machine migrates. If the internal business I / O pressure of the first virtual machine is large, that is, it requires a large number of I / O operations to process data, then a larger bandwidth is required to transmit these data during migration, otherwise it may cause delays and performance degradation during the migration process. On the contrary, if the internal business I / O pressure of the virtual machine is small, the migration bandwidth requirement will also be reduced accordingly. Therefore, when performing virtual machine migration, it is necessary to reasonably allocate network bandwidth according to the size of the virtual machine's internal business I / O pressure to ensure that the migration process can proceed smoothly and maintain good performance. At the same time, it is also necessary to adjust the network bandwidth according to actual conditions to meet the needs of different virtual machine migrations. It should be noted that in this embodiment, the target data block is first backed up to the first storage device, and can be migrated from the first storage device to the second virtual machine disk when the network bandwidth of the first virtual machine is idle. The requirement for network bandwidth is not high.
[0047] In order to reduce the I / O pressure of the internal business of the first virtual machine, some optimization measures can be taken, such as optimizing the I / O operation of the business application, increasing the storage and network resources of the virtual machine, and adopting efficient I / O processing technology, etc. This can improve the I / O performance of the internal business of the virtual machine and improve the operating efficiency of the business application.
[0048] Optionally, the first storage device is a local storage device or storage space for storing backup data of the first virtual machine. The first storage device may be a hard disk, a solid-state drive, a network storage device, etc., for storing backup files of the virtual machine so as to perform a recovery operation when necessary. By using the first storage device, virtual machine backup and recovery operations can be performed to ensure the security and reliability of virtual machine data.
[0049] Optionally, the first virtual machine disk and the second virtual machine disk refer to virtual disks used to store virtual machine operating systems, applications, and data. It is usually an important component of virtualization technology. Virtual disks are created on physical hardware through virtualization software to provide storage space for virtual machines. It can be divided into two types: system disks and data disks. System disks are used to store the operating system and applications of virtual machines, while data disks are used to store user data of virtual machines. Virtual machine disks can use different storage technologies, including hard disk storage, flash storage, and cloud storage. Depending on the virtualization technology, the management and configuration of virtual machine disks will also be different. The performance and capacity of virtual machine disks have a great impact on the operation and performance of virtual machines, so it is necessary to reasonably plan and configure virtual machine disks when deploying virtual machines.
[0050] In an exemplary embodiment, detecting data operation parameters of a first virtual machine includes: detecting a frequency of the first virtual machine responding to the I / O request data in each of one or more time periods, a data processing amount in response to the I / O request data, and data delay information in response to the I / O request data; when the first virtual machine responds to the I / O request data in each of the time periods, detecting a data transmission rate and a bandwidth utilization rate of the first virtual machine to obtain a network bandwidth for data transmission by the first virtual machine in response to the I / O request data; and determining the data operation parameters based on the frequency of responding to the I / O request data, the data processing amount in response to the I / O request data, the data delay information in response to the I / O request data, the data transmission rate and, and the network bandwidth for data transmission by the first virtual machine in response to the I / O request data.
[0051] Optionally, to detect the data operation parameters of the first virtual machine, one of the following methods may be used:
[0052] Check using virtual machine management software: If you are using virtual machine management software (for example, VMware, VirtualBox, etc.), you can find detailed information about the first virtual machine, including its operating parameters, in the software interface.
[0053] Command line check: The operation parameters of the first virtual machine can be checked by entering a corresponding command in the command line. For example, for a VMware virtual machine, the vmware-cmd command can be used to obtain the configuration information of the virtual machine.
[0054] Internal inspection of the virtual machine: If you have permission to access the first virtual machine, you can view its operating parameters inside the first virtual machine. You can view the configuration file of the virtual machine or use corresponding commands to obtain detailed information of the virtual machine.
[0055] This embodiment can accurately and comprehensively obtain data operation parameters by obtaining the frequency of the first virtual machine responding to I / O request data, the data processing volume in response to the I / O request data, the data delay information in response to the I / O request data, the data transmission rate, and the network bandwidth for data transmission by the first virtual machine in response to the I / O request data.
[0056] In an exemplary embodiment, before backing up the target data blocks in the first virtual machine disk to the first storage device according to the data operation parameters, the method also includes: determining a first storage space of the first virtual machine disk, wherein the first storage space is the storage capacity allocated when the first virtual disk is initialized in the first host system; determining the first storage device according to the first storage space, wherein the storage space of the first storage device is greater than or equal to the first storage space; and establishing a connection between the first storage device and the first virtual machine disk.
[0057] Optionally, the first storage space is the initial storage space size set when creating the virtual disk, and can be adjusted as needed. The first storage space is used to store the operating system, application programs and data of the virtual machine. Once initialized, the size of the storage space can be adjusted according to actual needs to meet changing storage needs.
[0058] This embodiment can accurately determine the first storage device that meets the backup requirement by determining the first storage space.
[0059] In an exemplary embodiment, backing up the target data blocks in the first virtual machine disk to the first storage device according to the data operation parameters includes: determining that the first virtual disk is a disk to be subjected to data migration; judging whether the network bandwidth of the first virtual machine satisfies the I / O request data; and triggering a backup operation to back up the target data blocks in the first virtual machine disk to the first storage device when the network bandwidth of the first virtual machine cannot satisfy the I / O request data.
[0060] Optionally, determining that the first virtual disk is a disk to be migrated includes one of the following: detecting the remaining storage space of the first virtual machine disk, and determining that the first virtual disk is a disk to be migrated when the remaining storage space is less than a preset storage space; receiving a backup instruction sent by the first host system to indicate that the first virtual disk is a disk to be migrated; detecting the operation of the first virtual machine disk, and determining that the first virtual disk is a disk to be migrated when an abnormality occurs in the operation of the first virtual machine disk; detecting the performance of the first virtual machine disk in response to the I / O request data, and determining that the first virtual disk is a disk to be migrated when the performance is less than a preset performance; determining that the first virtual disk is a disk to be migrated when a version upgrade instruction is obtained. In this embodiment, determining that the first virtual disk is a disk to be migrated also requires confirming the name and location of the first virtual disk. Checking the usage of the first virtual disk, confirming the migration target (determining to which location or disk the data needs to be migrated to prepare for migration). Through the above steps, it is possible to accurately determine that the first virtual disk is a disk to be migrated, and perform a data migration operation.
[0061] Optionally, judging whether the network bandwidth of the first virtual machine meets the I / O request data includes: obtaining first response data of the first virtual machine in response to an I / O read request, wherein the first response data includes: a first response time and a data volume of the I / O read request; obtaining second response data of the first virtual machine in response to an I / O write request, wherein the second response data includes: a second response time and a data volume of the I / O write request; and judging whether the network bandwidth of the first virtual machine meets the I / O request data by using the first response data and the second response data. In this embodiment, the network bandwidth of the first virtual machine can be determined from the response time of the first virtual machine in response to the I / O request. A relatively long response time indicates that there are relatively many I / O requests and the network bandwidth is insufficient. A relatively large data volume of the I / O request means that there are relatively many I / O requests, which will also affect the network bandwidth. In this embodiment, the network bandwidth of the first virtual machine can be accurately judged whether the network bandwidth of the first virtual machine meets the I / O request data through the first response data and the second response data. When the I / O request data is not met, data migration is not performed. When the I / O request data is met and it is relatively idle, data migration can be performed.
[0062] Optionally, when the network bandwidth of the first virtual machine cannot meet the I / O request data, a backup operation is triggered to back up the target data block in the first virtual machine disk to the first storage device, including: when the network bandwidth of the first virtual machine cannot meet the I / O request data, determining the full data block in the first virtual machine disk, wherein the full data block includes all data stored in the first virtual machine disk before a first time point, and the first time point is the time point when the backup operation is triggered; determining the first incremental data block and the second incremental data block in the first virtual machine disk to obtain the incremental data block; and backing up the full data block and the incremental data block to the first storage device respectively.
[0063] In this embodiment, the full data block refers to a block containing all data stored in the disk of the first virtual machine. These data blocks may include operating systems, applications, files, and other information. In a virtualized environment, a disk is usually divided into multiple data blocks to store different information, and a full data block refers to all data in the entire disk. These data blocks can be read and written by the virtual machine to access and store applications and files.
[0064] Optionally, determining the first incremental data block and the second incremental data block in the first virtual machine disk to obtain the incremental data block includes: after the first time point and in the process of backing up the full data block to the first storage device, obtaining the data generated by the first virtual machine in response to the I / O request data to obtain the first incremental data block, wherein the first incremental data block includes one or more and the first incremental data block is smaller than a preset byte; in the process of triggering the operation of migrating the full data block and the first incremental data to the second virtual machine disk, obtaining the data generated by the first virtual machine in response to the I / O request data to obtain the second incremental data block, wherein the second incremental data block includes one or more and the second incremental data block is smaller than the preset byte.
[0065] In this embodiment, by obtaining the data generated by the first virtual machine in response to the I / O request data in the process of backing up the full data block to the first storage device, and obtaining the data generated by the first virtual machine in response to the I / O request data in the process of triggering the operation of migrating the full data block and the first incremental data to the second virtual machine disk, it is possible to avoid missing the data in the first virtual machine and ensure the integrity of the migrated data.
[0066] Optionally, the full data blocks and the incremental data blocks are respectively backed up to the first storage device, comprising: determining a target backup tool, wherein the target backup tool is a tool with changed block tracking and the target backup tool is set in the first host system; backing up the full data blocks to the first storage device through the target backup tool; storing the incremental data blocks in the first storage device through the target backup tool when the incremental data blocks are included in the first virtual machine disk, wherein the incremental data blocks and the full data blocks are respectively stored in different storage spaces in the first storage device.
[0067] Optionally, the target backup tool includes but is not limited to a tool based on Changed Block Tracking (CBT). CBT is a technology used to track changes in data blocks on storage devices. CBT technology is applied to virtualization environments and storage systems. By recording change information of data blocks, it can effectively reduce the time and resource consumption of data backup and recovery operations. CBT technology can track the addition, modification and deletion of data blocks, thereby providing real-time and accurate change information for data management tools to help users quickly locate and restore required data. The implementation of CBT technology usually relies on the support of storage devices and operating systems. For example, virtualization platforms such as VMware and Hyper-V provide CBT API interfaces, and storage device manufacturers also provide corresponding CBT functions. At the same time, CBT technology also requires data management tools to reasonably utilize and integrate it to achieve high efficiency and reliability of data backup and recovery operations.
[0068] For example, you can back up VM disk data to a local storage pool and perform CBT backup by following these steps:
[0069] 1. Ensure that sufficient space has been created in the local storage pool to store the VM disk data backup.
[0070] 2. Log in to the management interface of the virtualization management platform (for example, VMware vSphere).
[0071] 3. Select the virtual machine to be backed up in the virtualization management platform and find its disk data storage location.
[0072] 4. Use the backup function provided by the virtualization management platform to back up the virtual machine disk data to the local storage pool.
[0073] 5. During the backup process, make sure to select the Enable CBT backup option. CBT can only back up the changed data blocks in the virtual machine disk, thereby improving backup efficiency and reducing backup time.
[0074] 6. Wait for the backup process to complete and verify that the backup data is successfully stored in the local storage pool.
[0075] Through the above steps, you can back up the virtual machine disk data to the local storage pool and perform CBT backup, ensuring data security and backup efficiency.
[0076] In an exemplary embodiment, the target data block backed up in the first storage device is migrated to the second virtual machine disk based on the network bandwidth of the first host system, including: after determining that the full data block is backed up to the first storage device, detecting the pressure state of the network bandwidth of the first host system; migrating the full data block to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system; and when it is determined that the full data block has been migrated to the second virtual machine disk, migrating the incremental data block to the second virtual machine disk.
[0077] Optionally, after determining that the full data block is backed up to the first storage device, detecting the pressure state of the network bandwidth of the first host system, including: detecting the bandwidth utilization rate, network traffic and network delay of the first host system through a network performance detection tool, wherein the network performance detection tool is set in the first host system; determining the pressure state of the network bandwidth of the first host system based on the bandwidth utilization rate, the network traffic and the network delay of the first host system, wherein the pressure state includes an idle state and a load state.
[0078] Optionally, network performance detection tools are software or devices used to evaluate performance indicators such as network speed, delay, packet loss rate, etc. These tools can evaluate the performance of the network and promptly discover and solve network problems to ensure efficient and stable operation of the network. For example, network performance detection tools include but are not limited to:
[0079] 1. Speedtest: This is a widely used online network performance testing tool that users can use to test the speed of their network through a speed test website or mobile app to evaluate the download speed, upload speed, and latency of their network.
[0080] 2. PingPlotter: This is a tool for network troubleshooting and performance analysis that helps users identify latency and packet loss issues in the network and provides visual network performance data.
[0081] 3. Wireshark: This is an open source network protocol analysis tool that can capture and analyze network packets to help users identify network traffic, protocol, and performance issues.
[0082] 4. Iperf: This is a tool for testing network bandwidth. It can evaluate the actual bandwidth and throughput of the network by transferring data between two computers.
[0083] 5. NetCrunch: This is a network monitoring and performance management tool that monitors network devices and traffic in real time and provides detailed performance reports and analysis.
[0084] Optionally, migrating the full data block to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system includes: when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at the second time point, statically migrating the full data block to the second virtual machine disk according to a first preset migration rate; wherein the static migration is used to indicate that the full data block is a non-real-time data block, and the first preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system. For example, in the evening time period, when the network bandwidth of the first host system is in an idle state, the data block can be migrated. Static migration refers to the process of migrating data from one location or system to another location or system without changing the data content. This migration does not involve real-time data flow or synchronization, but moves data from one place to another by copying and pasting. Static migration is usually used for backing up, archiving or migrating old data to a new system. Static migration can adjust the migration rate and migration time at any time. Thereby, it does not affect the normal data processing of the first host system.
[0085] Optionally, when it is determined that the full data block has been migrated to the second virtual machine disk, the incremental data block is migrated to the second virtual machine disk, including: when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point, statically migrating the first incremental data block among the incremental data blocks to the second virtual machine disk at a second preset migration rate, wherein the static migration is used to indicate that the first incremental data block is a non-real-time data block, and the second preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system; when it is determined that the first incremental data block has been migrated to the second virtual machine disk, dynamically migrating the second incremental data block among the incremental data blocks to the second virtual machine disk according to the disk bitmap information of the first virtual machine, wherein the dynamic migration is used to indicate that the second incremental data block is a data block generated in real time by the first virtual machine, and during the process of dynamically migrating the second incremental data block, the first virtual machine is in a stopped state, and the disk bitmap information is used to record the data state of the data block in the first virtual machine, and when the data block changes, the change of the data block is marked with a preset value.
[0086] In this embodiment, static migration is the same as described above and will not be repeated here. Dynamic migration refers to the process of migrating a running program or data from one system to another. Dynamic migration can be achieved through virtualization technology, containerization technology, distributed systems, etc., which provides important support for the flexibility and reliability of the system and improves the utilization and performance of the host system.
[0087] Optionally, when it is determined that the first incremental data block has been migrated to the second virtual machine disk, the second incremental data block in the incremental data block is dynamically migrated to the second virtual machine disk according to the disk bitmap information of the first virtual machine, including: when it is determined that the first incremental data block has been migrated to the second virtual machine disk, obtaining the disk bitmap information from the virtual machine memory of the first virtual machine; comparing the bitmap information of the first incremental data block with the disk bitmap information to determine the second incremental data block, wherein the second incremental data block is a data block generated in real time by the first virtual machine during the process of migrating the first incremental data block; and dynamically migrating the second incremental data block to the second virtual machine disk.
[0088] In this embodiment, the disk bitmap information records and registers the change information of each data block of the first virtual machine with 0 and 1 of 1 bit size, 0 indicates no change, 1 indicates change, and each time there is an IO read and write operation on the disk of the first virtual machine, the bitmap information is updated and set to record the disk data status of the current virtual machine. In the process of comparison in this embodiment, it is first necessary to read the bitmap information of the first incremental data block, which records the position and status of the first incremental data block. Then, it is necessary to read the bitmap information of the disk, which records the position and status of all data blocks on the entire disk. By comparing these two bitmap information, the position and status of the second incremental data block can be determined. If a data block is marked as used in the bitmap information of the first incremental data block, and the data block is marked as free in the bitmap information of the disk, it can be determined that the data block is the position of the second incremental data block; if a data block is marked as used in the bitmap information of the first incremental data block, and the data block is also marked as used in the bitmap information of the disk, it can be determined that the data block is the position of the first incremental data block. By comparing the bitmap information, the position and status of the second incremental data block can be accurately determined, so that corresponding processing and management can be performed.
[0089] In an exemplary embodiment, before detecting the data operation parameters of the first virtual machine, the method also includes: when the first virtual machine is turned on, loading the disk bitmap information of the first virtual machine into the virtual machine memory of the first virtual machine; wherein the disk bitmap information is used to record the data status of the data block in the first virtual machine, and when the data block changes, marking the change of the data block with a preset value.
[0090] In this embodiment, when the first virtual machine is turned on, the disk bitmap information of the first virtual machine is loaded into the virtual machine memory of the first virtual machine, which can ensure that the first virtual machine can correctly identify and access the data on its disk when it is started. The process of loading the disk bitmap information into the virtual machine memory is usually automatically completed by the management software of the first virtual machine without user intervention. After loading, the first virtual machine can locate and access the data blocks on the disk according to the bitmap information, and implement read and write operations on the first virtual disk. This step is a key link in the startup process of the first virtual machine, ensuring that the first virtual machine can operate normally and access the data stored on the disk.
[0091] In an exemplary embodiment, after migrating the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, the method further includes: sending an operation instruction to the second virtual machine to trigger the second virtual machine to perform an I / O operation on the target data block in the second virtual machine disk.
[0092] Optionally, you can send an operation instruction to the second VM in the following ways:
[0093] 1. Using the console or command line interface of the virtualization management software (such as VMware, VirtualBox, etc.), find the name or ID of the second virtual machine and select the option to send the command.
[0094] 2. Enter the corresponding command in the console or command line interface, such as sending operation instructions through VMware's vmrun command.
[0095] 3. Ensure that the sent instruction contains specific instructions for performing I / O operations on the target data block in the second virtual machine disk so as to trigger the corresponding operation.
[0096] Before sending operation instructions, you need to ensure that you have sufficient permissions and access rights to perform these operations, and back up related data to prevent accidents.
[0097] This embodiment can quickly trigger the second virtual machine to perform an I / O operation on the target data block in the second virtual machine disk by sending an operation instruction to the second virtual machine.
[0098] The present application is described below in conjunction with specific embodiments:
[0099] In order to solve the problem that the hot migration task of the virtual machine disk cannot be completed under the condition of large I / O pressure, resulting in large bandwidth occupation and affecting other virtual machine services, this specific embodiment of the invention proposes a storage hot migration solution, such as Figure 3 As shown, it is a schematic diagram of the interaction of each device in this specific embodiment. First, evaluate the size of the virtual machine's internal business I / O pressure and the migration bandwidth to decide whether to perform data migration immediately. If the I / O pressure is large and the network bandwidth is insufficient, first perform CBT backup of the data in the disk of the virtual machine to be migrated (corresponding to the first virtual disk mentioned above) in the local backup storage pool. Perform a full backup first, and then perform incremental backup according to the disk bitmap information corresponding to the data block. The frequency of backup is positively correlated with the internal I / O pressure of the virtual machine, that is, the greater the pressure, the higher the frequency of incremental backup, thereby transferring the bandwidth pressure caused by the migration to the space pressure of the local backup pool. After that, according to the network bandwidth of the first host system, the backup data of the virtual machine is statically migrated from the local backup storage pool (corresponding to the first storage device mentioned above) in batches. Since the backup data is distinguished by incremental backup, the static migration can be terminated or resumed at any time according to the network bandwidth pressure. After all incremental backups are statically migrated to the destination storage pool, the bitmap of the last backup is compared with the data block bitmap information in the memory of the current virtual machine and then migrated. At this time, the logic is similar to that of drive-mirror, and the data is migrated iteratively in a loop. Since the disk IO pressure is not large at this time, the drive-mirror process can be completed quickly, and finally the entire storage migration is completed.
[0100] This specific embodiment specifically includes the following steps:
[0101] S301, when the first virtual machine in the first host system is powered on, the disk bitmap information of the first virtual machine is loaded into the virtual machine memory of the first virtual machine. At this time, the mark bits of all data blocks in the disk bitmap information are 0. Only when the corresponding data block changes during operation, the corresponding CBT information is set and saved;
[0102] S302: If the first virtual machine performs storage migration, it starts to query the I / O pressure of the internal business at this time through monitoring, and evaluates whether there is a situation where the task cannot be completed for a long time due to insufficient network bandwidth.
[0103] S303, if the network bandwidth does not meet the migration conditions, start CBT backup of the first virtual machine. At this time, a local backup storage pool (i.e., the first storage device) is required to save the backup data, and the local storage pool does not occupy the network bandwidth and does not affect the occupation of network bandwidth by other services.
[0104] S304, the first backup is a backup of the full data blocks, which saves all the data in the first virtual machine disk before the backup time point, and then starts to back up the incremental data blocks, and tries to ensure that each incremental data block is kept within a certain size range. The size range is determined by the network bandwidth of the first host system to facilitate the management of subsequent static migration. The way to control the size of the incremental data blocks is to monitor the storage I / O rate and the frequency of creating incremental data blocks. Therefore, based on the fixed-size incremental data blocks, the faster the backup frequency, the greater the I / O pressure inside the virtual machine; the size of the incremental data blocks can also be manually configured for human intervention.
[0105] S305, within the range allowed by the network bandwidth of the first host system, migrate the data blocks of the backup storage pool to the destination storage pool (the storage pool where the second virtual disk is located) one by one. Since it is a static migration, the migration rate can be controlled at any time, and after the migration of the full data blocks is completed, the subsequent incremental data blocks can control the stop and continue of their static migration at any time.
[0106] S306, after all incremental data blocks are migrated, and there are no ongoing incremental data block tasks, it indicates that the network bandwidth of the first host system can now meet the internal I / O incremental data of the virtual machine, and dynamic migration can begin; at this time, all backup data are restored to a virtual disk on the destination host, and then the bitmap information and CBT file information corresponding to the last incremental backup are compared with the disk bitmap information saved in S301 of the first virtual machine, and the newly added incremental data blocks are dynamically migrated to finally complete the entire storage migration.
[0107] 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 this 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 described in each embodiment of the present application.
[0108] In this embodiment, a migration device for virtual machine data is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0109] Figure 4 is a structural block diagram of a virtual machine data migration device according to an embodiment of the present application, such as Figure 4 As shown, the device comprises:
[0110] A first detection module 42 is used to detect data operation parameters of a first virtual machine, wherein the data operation parameters include input / output I / O request data received by the first virtual machine and a network bandwidth for data transmission by the first virtual machine in response to the I / O request data, and the first virtual machine is a virtual machine among multiple virtual machines included in the first host system;
[0111] A first backup module 44 is used to back up the target data blocks in the first virtual machine disk to the first storage device according to the data operation parameters, wherein the first virtual machine disk is a disk to be deployed in the first storage pool of the first virtual machine for data migration, the target data blocks include full data blocks and incremental data blocks, and the first storage device is a device deployed in the first host system and connected to the first virtual machine disk;
[0112] The first migration module 46 is used to migrate the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, wherein the second virtual machine disk is a disk deployed in the second storage pool of the second virtual machine, and the second virtual machine is a virtual machine among the multiple virtual machines included in the second host system.
[0113] In an exemplary embodiment, the first detection module 42 includes: a first detection unit, which is used to detect the frequency of the first virtual machine responding to the I / O request data in each time period in one or more time periods, the data processing volume in response to the I / O request data, and the data delay information in response to the I / O request data; a second detection unit, which is used to detect the data transmission rate and bandwidth utilization of the first virtual machine when the first virtual machine responds to the I / O request data in each of the time periods, and obtain the network bandwidth of the first virtual machine for data transmission in response to the I / O request data; a first determination unit, which is used to determine the data operation parameters based on the frequency of responding to the I / O request data, the data processing volume in response to the I / O request data, the data delay information in response to the I / O request data, the data transmission rate, and the network bandwidth of the first virtual machine for data transmission in response to the I / O request data.
[0114] In an exemplary embodiment, the above-mentioned device also includes: a first determination module, used to determine the first storage space of the first virtual machine disk before backing up the target data block in the first virtual machine disk to the first storage device according to the data operation parameters, wherein the first storage space is the storage capacity allocated when the first virtual disk is initialized in the first host system; a second determination module, used to determine the first storage device according to the first storage space, wherein the storage space of the first storage device is greater than or equal to the first storage space; a first establishment module, used to establish a connection between the first storage device and the first virtual machine disk.
[0115] In an exemplary embodiment, the above-mentioned first backup module includes: a second determination unit, used to determine that the first virtual disk is a disk to be subjected to data migration; a first judgment unit, used to determine whether the network bandwidth of the first virtual machine meets the I / O request data; and a first backup unit, used to trigger a backup operation when the network bandwidth of the first virtual machine cannot meet the I / O request data, so as to back up the target data block in the first virtual machine disk to the first storage device.
[0116] In an exemplary embodiment, the above-mentioned second determination unit includes one of the following: a first detection subunit, used to detect the remaining storage space of the first virtual machine disk, and when the remaining storage space is less than the preset storage space, determine that the first virtual disk is the disk to be migrated for data; a first receiving subunit, used to receive a backup instruction sent by the first host system to indicate that the first virtual disk is the disk to be migrated for data; a second detection subunit, used to detect the operation of the first virtual machine disk, and when an abnormality occurs in the operation of the first virtual machine disk, determine that the first virtual disk is the disk to be migrated for data; a third detection subunit, used to detect the performance of the first virtual machine disk in response to the I / O request data, and when the performance is less than the preset performance, determine that the first virtual disk is the disk to be migrated for data; the first determination subunit, used to determine that the first virtual disk is the disk to be migrated for data when a version upgrade instruction is obtained.
[0117] In an exemplary embodiment, the above-mentioned first judgment unit includes: a first acquisition subunit, used to obtain first response data of the first virtual machine in response to an I / O read request, wherein the first response data includes: a first response time, and the data volume of the I / O read request; a second acquisition subunit, used to obtain second response data of the first virtual machine in response to an I / O write request, wherein the second response data includes: a second response time, and the data volume of the I / O write request; the first judgment subunit is used to use the first response data and the second response data to determine whether the network bandwidth of the first virtual machine meets the I / O request data.
[0118] In an exemplary embodiment, the above-mentioned first backup unit includes: a second determination sub-unit, used to determine the full data block in the first virtual machine disk when the network bandwidth of the first virtual machine cannot meet the I / O request data, wherein the full data block includes all data stored in the first virtual machine disk before a first time point, and the first time point is the time point that triggers the backup operation; a third determination sub-unit, used to determine the first incremental data block and the second incremental data block in the first virtual machine disk to obtain the incremental data block; a first backup sub-unit, used to back up the full data block and the incremental data block to the first storage device respectively.
[0119] In an exemplary embodiment, the above-mentioned third determination sub-unit includes: a first acquisition sub-module, used to obtain the data generated by the first virtual machine in response to the I / O request data after the first time point and in the process of backing up the full data block to the first storage device, and obtain the first incremental data block, wherein the first incremental data block includes one or more, and the first incremental data block is smaller than the preset bytes; a second acquisition sub-module, used to obtain the data generated by the first virtual machine in response to the I / O request data in the process of triggering the operation of migrating the full data block and the first incremental data to the second virtual machine disk, and obtain the second incremental data block, wherein the second incremental data block includes one or more, and the second incremental data block is smaller than the preset bytes.
[0120] In an exemplary embodiment, the above-mentioned first backup sub-unit includes: a first determination sub-module, used to determine a target backup tool, wherein the target backup tool is a tool with change block tracking, and the target backup tool is set in the first host system; a first backup sub-module, used to back up the full data blocks to the first storage device through the target backup tool; a first storage sub-module, used to store the incremental data blocks in the first storage device through the target backup tool when the incremental data blocks are included in the first virtual machine disk, wherein the incremental data blocks and the full data blocks are respectively stored in different storage spaces in the first storage device.
[0121] In an exemplary embodiment, the above-mentioned first migration module includes: a third detection unit, used to detect the pressure status of the network bandwidth of the first host system after determining that the full data block is backed up to the first storage device; a first migration unit, used to migrate the full data block to the second virtual machine disk based on the pressure status of the network bandwidth of the first host system; and a second migration unit, used to migrate the incremental data block to the second virtual machine disk when it is determined that the full data block has been migrated to the second virtual machine disk.
[0122] In an exemplary embodiment, the above-mentioned third detection unit includes: a fourth detection subunit, used to detect the bandwidth utilization rate, network traffic and network delay of the first host system through a network performance detection tool, wherein the network performance detection tool is set in the first host system; a fourth determination subunit, used to determine the pressure state of the network bandwidth of the first host system based on the bandwidth utilization rate, the network traffic and the network delay of the first host system, wherein the pressure state includes an idle state and a load state.
[0123] In an exemplary embodiment, the above-mentioned first migration unit includes: a first migration sub-unit, which is used to statically migrate the full data block to the second virtual machine disk according to a first preset migration rate when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point; wherein the static migration is used to indicate that the full data block is a non-real-time data block, and the first preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system.
[0124] In an exemplary embodiment, the second migration unit includes: a second migration subunit, which is used to statically migrate the first incremental data block in the incremental data blocks to the second virtual machine disk according to a second preset migration rate when it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point, wherein the static migration is used to indicate that the first incremental data block is a non-real-time data block, and the second preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system; a third migration subunit, which is used to dynamically migrate the second incremental data block in the incremental data blocks to the second virtual machine disk according to the disk bitmap information of the first virtual machine when it is determined that the first incremental data block has been migrated to the second virtual machine disk, wherein the dynamic migration is used to indicate that the second incremental data block is a data block generated in real time by the first virtual machine, and during the process of dynamically migrating the second incremental data block, the first virtual machine is in a stopped state, and the disk bitmap information is used to record the data status of the data block in the first virtual machine, and when the data block changes, the change of the data block is marked with a preset value.
[0125] In an exemplary embodiment, the third migration sub-unit includes: a first acquisition sub-module, used to obtain the disk bitmap information from the virtual machine memory of the first virtual machine when it is determined that the first incremental data block has been migrated to the second virtual machine disk; a first comparison sub-module, used to compare the bitmap information of the first incremental data block with the disk bitmap information to determine the second incremental data block, wherein the second incremental data block is a data block generated in real time by the first virtual machine during the process of migrating the first incremental data block; and a first migration sub-module, used to dynamically migrate the second incremental data block to the second virtual machine disk.
[0126] In an exemplary embodiment, the above-mentioned device also includes: a first loading module, which is used to load the disk bitmap information of the first virtual machine into the virtual machine memory of the first virtual machine when the first virtual machine is turned on before detecting the data operation parameters of the first virtual machine; wherein the disk bitmap information is used to record the data status of the data block in the first virtual machine, and when the data block changes, the change of the data block is marked with a preset value.
[0127] In an exemplary embodiment, the above-mentioned device also includes: a sending module, which is used to send an operation instruction to the second virtual machine after migrating the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, so as to trigger the second virtual machine to perform I / O operations on the target data block in the second virtual machine disk.
[0128] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0129] The embodiment of the present application also provides a virtual machine data migration system, such as Figure 5 As shown, a processor is included, and the processor is used to implement the steps of the method described above.
[0130] The embodiment of the present application also provides a server, such as Figure 6 As shown, it includes a first host system, a first virtual machine, a second host system, a second virtual machine, a first storage device, and the virtual machine data migration system as described above.
[0131] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0132] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0133] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.
[0134] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0135] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0136] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0137] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0138] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0139] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0140] The above description is only the preferred 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 modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for migrating virtual machine data, characterized in that: include: Detecting data operation parameters of a first virtual machine, wherein the data operation parameters include input / output I / O request data received by the first virtual machine and a network bandwidth for data transmission by the first virtual machine in response to the I / O request data, and the first virtual machine is a virtual machine among multiple virtual machines included in the first host system; Backing up the target data blocks in the first virtual machine disk to the first storage device according to the data operation parameters, wherein the first virtual machine disk is a disk to be migrated and deployed in the first storage pool of the first virtual machine, the target data blocks include full data blocks and incremental data blocks, and the first storage device is a device deployed in the first host system and connected to the first virtual machine disk; Migrating the target data block backed up in the first storage device to a second virtual machine disk based on the network bandwidth of the first host system, wherein the second virtual machine disk is a disk deployed in a second storage pool of a second virtual machine, and the second virtual machine is a virtual machine among a plurality of virtual machines included in the second host system; Among them, backing up the target data blocks in the first virtual machine disk to the first storage device according to the data operation parameters includes: determining that the first virtual machine disk is a disk to be subjected to data migration; judging whether the network bandwidth of the first virtual machine meets the I / O request data; and triggering a backup operation to back up the target data blocks in the first virtual machine disk to the first storage device when the network bandwidth of the first virtual machine cannot meet the I / O request data.
2. The method according to claim 1, characterized in that Detecting data operation parameters of the first virtual machine includes: Detecting a frequency of the first virtual machine responding to the I / O request data, a data processing amount in response to the I / O request data, and data delay information in response to the I / O request data in each time period in one or more time periods; When the first virtual machine responds to the I / O request data in each of the time periods, detecting a data transmission rate and a bandwidth utilization rate of the first virtual machine to obtain a network bandwidth for data transmission by the first virtual machine in response to the I / O request data; The data operation parameters are determined based on the frequency of responding to the I / O request data, the data processing volume in response to the I / O request data, the data delay information in response to the I / O request data, the data transmission rate, and the network bandwidth for data transmission by the first virtual machine in response to the I / O request data.
3. The method according to claim 1, characterized in that Before backing up the target data block in the first virtual machine disk to the first storage device according to the data operation parameter, the method further includes: Determine a first storage space of the first virtual machine disk, wherein the first storage space is a storage capacity allocated when the first virtual machine disk is initialized in the first host system; Determine the first storage device according to the first storage space, wherein the storage space of the first storage device is greater than or equal to the first storage space; A connection is established between the first storage device and the first virtual machine disk.
4. The method according to claim 1, characterized in that: Determining that the first virtual machine disk is a disk to be subjected to data migration includes one of the following: Detecting the remaining storage space of the first virtual machine disk, and determining that the first virtual machine disk is a disk to be subjected to data migration when the remaining storage space is less than a preset storage space; Receiving a backup instruction sent by the first host system to indicate that the first virtual machine disk is a disk to be subjected to data migration; Detecting the operation of the first virtual machine disk, and when an abnormality occurs in the operation of the first virtual machine disk, determining that the first virtual machine disk is a disk to be subjected to data migration; Detecting the performance of the first virtual machine disk in response to the I / O request data, and determining that the first virtual machine disk is a disk to be subjected to data migration when the performance is less than a preset performance; When the version upgrade instruction is obtained, it is determined that the first virtual machine disk is a disk to be subjected to data migration.
5. The method according to claim 1, characterized in that: Determining whether the network bandwidth of the first virtual machine meets the I / O request data includes: Obtaining first response data of the first virtual machine in response to the I / O read request, wherein the first response data includes: a first response time and a data volume of the I / O read request; Obtaining second response data of the first virtual machine in response to the I / O write request, wherein the second response data includes: a second response time and a data volume of the I / O write request; The first response data and the second response data are used to determine whether the network bandwidth of the first virtual machine meets the I / O request data.
6. The method according to claim 1, characterized in that In the case where the network bandwidth of the first virtual machine cannot meet the I / O request data, triggering a backup operation to back up the target data block in the first virtual machine disk to the first storage device, including: In a case where the network bandwidth of the first virtual machine cannot meet the I / O request data, determining the full data block in the first virtual machine disk, wherein the full data block includes all data stored in the first virtual machine disk before a first time point, and the first time point is a time point when the backup operation is triggered; Determine a first incremental data block and a second incremental data block in the first virtual machine disk to obtain the incremental data blocks; The full data block and the incremental data block are backed up to the first storage device respectively.
7. The method according to claim 6, characterized in that Determining a first incremental data block and a second incremental data block in the first virtual machine disk to obtain the incremental data blocks includes: After the first time point and in the process of backing up the full data block to the first storage device, obtaining data generated by the first virtual machine in response to the I / O request data to obtain the first incremental data block, wherein the first incremental data block includes one or more, and the first incremental data block is smaller than a preset byte; In the process of triggering the operation of migrating the full data block and the first incremental data to the second virtual machine disk, the data generated by the first virtual machine in response to the I / O request data is obtained to obtain the second incremental data block, wherein the second incremental data block includes one or more, and the second incremental data block is smaller than the preset bytes.
8. The method according to claim 6, characterized in that Backing up the full data block and the incremental data block to the first storage device respectively includes: Determine a target backup tool, wherein the target backup tool is a tool with changed block tracking, and the target backup tool is set in the first host system; Backing up the full amount of data blocks to the first storage device through the target backup tool; By using the target backup tool, when the first virtual machine disk includes the incremental data blocks, the incremental data blocks are stored in the first storage device, wherein the incremental data blocks and the full data blocks are respectively stored in different storage spaces in the first storage device.
9. The method according to claim 1, characterized in that: Migrating the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system includes: After determining that the full amount of data blocks are backed up to the first storage device, detecting a pressure state of a network bandwidth of the first host system; Migrating the full data block to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system; When it is determined that the full data block has been migrated to the second virtual machine disk, the incremental data block is migrated to the second virtual machine disk.
10. The method according to claim 9, characterized in that After determining that the full data block is backed up to the first storage device, detecting a pressure state of the network bandwidth of the first host system includes: Detecting the bandwidth usage, network traffic and network delay of the first host system by using a network performance detection tool, wherein the network performance detection tool is set in the first host system; The stress state of the network bandwidth of the first host system is determined based on the bandwidth usage rate of the first host system, the network traffic, and the network delay, wherein the stress state includes an idle state and a load state.
11. The method according to claim 9, characterized in that Migrating the full data block to the second virtual machine disk based on the pressure state of the network bandwidth of the first host system includes: When it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point, statically migrating the full data block to the second virtual machine disk at a first preset migration rate; The static migration is used to indicate that the full data block is a non-real-time data block, and the first preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system.
12. The method according to claim 9, characterized in that When it is determined that the full data block has been migrated to the second virtual machine disk, migrating the incremental data block to the second virtual machine disk includes: When it is determined from the pressure state of the network bandwidth of the first host system that the network bandwidth of the first host system is in an idle state at a second time point, statically migrating a first incremental data block among the incremental data blocks to the second virtual machine disk at a second preset migration rate, wherein the static migration is used to indicate that the first incremental data block is a non-real-time data block, and the second preset migration rate allows real-time adjustment based on the pressure state of the network bandwidth of the first host system; When it is determined that the first incremental data block has been migrated to the second virtual machine disk, the second incremental data block in the incremental data blocks is dynamically migrated to the second virtual machine disk according to the disk bitmap information of the first virtual machine, wherein the dynamic migration is used to indicate that the second incremental data block is a data block generated in real time by the first virtual machine, and during the process of dynamically migrating the second incremental data block, the first virtual machine is in a stopped state, and the disk bitmap information is used to record the data status of the data block in the first virtual machine, and when the data block changes, the change of the data block is marked with a preset value.
13. The method according to claim 12, characterized in that In the case where it is determined that the first incremental data block has been migrated to the second virtual machine disk, dynamically migrating a second incremental data block in the incremental data blocks to the second virtual machine disk according to the disk bitmap information of the first virtual machine includes: When it is determined that the first incremental data block has been migrated to the second virtual machine disk, obtaining the disk bitmap information from the virtual machine memory of the first virtual machine; Comparing the bitmap information of the first incremental data block with the disk bitmap information to determine the second incremental data block, wherein the second incremental data block is a data block generated in real time by the first virtual machine during the process of migrating the first incremental data block; Dynamically migrate the second incremental data block to the second virtual machine disk.
14. The method according to claim 1, characterized in that Before detecting the data operation parameters of the first virtual machine, the method further includes: When the first virtual machine is powered on, loading the disk bitmap information of the first virtual machine into the virtual machine memory of the first virtual machine; The disk bitmap information is used to record the data status of the data block in the first virtual machine, and when the data block changes, the change of the data block is marked with a preset value.
15. The method according to claim 1, characterized in that After migrating the target data block backed up in the first storage device to the second virtual machine disk based on the network bandwidth of the first host system, the method further includes: An operation instruction is sent to the second virtual machine to trigger the second virtual machine to perform an I / O operation on the target data block in the second virtual machine disk.
16. A device for migrating virtual machine data, characterized in that: include: a first detection module, configured to detect data operation parameters of a first virtual machine, wherein the data operation parameters include input / output I / O request data received by the first virtual machine and a network bandwidth for data transmission by the first virtual machine in response to the I / O request data, and the first virtual machine is a virtual machine among multiple virtual machines included in a first host system; A first backup module, configured to back up a target data block in a first virtual machine disk to a first storage device according to the data operation parameter, wherein the first virtual machine disk is a disk to be migrated and deployed in a first storage pool of the first virtual machine, the target data block includes a full data block and an incremental data block, and the first storage device is a device deployed in the first host system and connected to the first virtual machine disk; a first migration module, configured to migrate the target data block backed up in the first storage device to a second virtual machine disk based on the network bandwidth of the first host system, wherein the second virtual machine disk is a disk deployed in a second storage pool of a second virtual machine, and the second virtual machine is a virtual machine among a plurality of virtual machines included in the second host system; Among them, the first backup module is also used to determine that the first virtual machine disk is the disk to be migrated; judge whether the network bandwidth of the first virtual machine meets the I / O request data; when the network bandwidth of the first virtual machine cannot meet the I / O request data, trigger a backup operation to back up the target data block in the first virtual machine disk to the first storage device.
17. A virtual machine data migration system, characterized in that: The method comprises a processor configured to implement the steps of the method as claimed in any one of claims 1 to 15.
18. A server, characterized in that: The system comprises a first host system, a first virtual machine, a second host system, a second virtual machine, a first storage device, and a virtual machine data migration system as described in claim 17 above.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 15 are implemented.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 15 when executed by a processor.
21. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 15 are implemented.
Citation Information
Patent Citations
Cross-cluster virtual machine migration method, device and equipment and storage medium
CN115344355A