A method and device for online migration of virtual resources

By enabling the IO redirection channel during the virtual machine migration process, data is transmitted from the source physical server to the target physical server, the problem of LUN corresponding virtual machines cannot be migrated in virtual machine migration, and the online migration of virtual resources and linear expansion of storage services is realized.

CN113986467BActive Publication Date: 2025-04-04BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111282164.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-01
Publication Date
2025-04-04
Estimated Expiration
2041-11-01

AI Technical Summary

Technical Problem

In the prior art During the virtual machine migration process, the virtual machine corresponding to the logical unit number LUN cannot be migrated, resulting in poor linear expansion capabilities of storage services.

Method used

By controlling the virtual machine to be migrated from the source physical server to the target physical server, and opening the IO redirection channel in the source physical server, data is transmitted to the second visitor object in the target physical server through this channel, and the virtual resource migration is completed.

Benefits of technology

It realizes online migration of virtual resources, ensures data integrity and no data omissions, and thus improves the linear expansion capabilities of storage services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113986467B_ABST
    Figure CN113986467B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for online migration of virtual resources, the method comprising controlling a virtual machine to be migrated to migrate from a source physical server to a target physical server, wherein the migrated virtual machine interacts with a distributed storage system through a first visitor object in the source physical server, and different virtual machines have different corresponding visitor objects in the physical server; controlling the first visitor object to open an IO redirection channel so that the first visitor object transmits received data to a second visitor object created in the target physical server through the IO redirection channel; controlling the migrated virtual machine to transmit data to the second visitor object, and cutting off data transmission between the migrated virtual machine and the first visitor object; and controlling the first visitor object to close the IO redirection channel after the data received by the first visitor object is transmitted, thereby completing the migration of virtual resources and realizing linear expansion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of virtual resource migration, and in particular to an online migration method and device for virtual resources. Background Art

[0002] Internet Small Computer System Interface (iSCSI), also known as Internet Protocol-Storage Area 15 Network (IP-SAN), is a storage technology based on the Internet Transmission Control Protocol (TCP / IP) and SCSI-3 protocol. It was proposed by the Internet Engineering Task Force and became a formal standard.

[0003] All physical disks on the physical server are uniformly managed and abstracted into a storage resource pool by the distributed storage system. Each physical server enables an iSCSI Target process as the access service of the distributed storage system. The virtual disks used by the virtual machines are connected to the logical unit number LUN on the iSCSI Target through the iSCSI protocol, and the LUNs connected to different virtual machines are combined in the physical server to create the iSCSI Target process.

[0004] In the above situation, when a new physical server needs to be added and a virtual machine is migrated to the new server, the virtual machine corresponding to the logical unit number LUN can be migrated to the new server. However, since the LUNs connected to different virtual machines are combined in the process of creating iSCSI Target on the physical server, the logical unit number LUN corresponding to the virtual machine migrated to the new server cannot be migrated away, resulting in poor linear scalability of the designed storage service. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a method and device for online migration of virtual resources to solve the above-mentioned problems.

[0006] In a first aspect, the present invention provides an online migration method for virtual resources, the method comprising: controlling a virtual machine to be migrated to migrate from a source physical server to a target physical server, wherein the migrated virtual machine interacts with a distributed storage system through a first visitor object in the source physical server, and different virtual machines have different corresponding visitor objects in the physical server; controlling the first visitor object to open an IO redirection channel so that the first visitor object transmits received data to a second visitor object created in a target physical server through the IO redirection channel; controlling the migrated virtual machine to transmit data to the second visitor object, and cutting off data transmission between the migrated virtual machine and the first visitor object; after the data transmission received by the first visitor object is completed, controlling the first visitor object to close the IO redirection channel, thereby completing the migration of virtual resources.

[0007] In the online migration method of virtual resources designed above, this scheme first migrates the virtual machine from the source physical server to the target physical server, and then controls the first visitor object in the source physical server to open the IO redirection channel, so that the data sent by the migrated virtual machine to the first visitor object is transmitted to the second visitor object in the target physical server through the IO redirection channel, and then controls the migrated virtual machine to transmit data to the second visitor object, and cuts off the data transmission between the migrated virtual machine and the first visitor object, so that the migrated virtual machine interacts with the distributed storage system through the second visitor object in the target physical server; and after the data transmission received by the first visitor object is completed, controls the first visitor object to close the IO redirection channel, so that before the data transmission between the migrated virtual machine and the first visitor object is cut off, the data obtained by the first visitor object can be fully transmitted to the second visitor object for processing, so as to prevent data omission, and thus realize the online migration of virtual resources after the first visitor object closes the IO redirection channel, so that the designed storage service can achieve linear expansion.

[0008] In an optional implementation of the first aspect, the accessor object includes an iSCSI target process, a circular queue and a scheduler process, wherein the iSCSI target process is used to parse the iSCSI data packets sent by the virtual machine into SCSI commands and store the SCSI commands in the circular queue, wherein the SCSI commands are commands for operating the logical block device of the target logical unit number; the scheduler process is used to read and process the SCSI commands from the circular queue, obtain the SCSI processing commands, and send the SCSI processing commands to the distributed storage system so that the distributed storage system returns the operation results corresponding to the SCSI processing commands.

[0009] In an optional implementation of the first aspect, controlling the first visitor object to open an IO redirection channel includes: controlling the scheduler process in the first visitor object to open an IO redirection channel to transmit the commands stored in the ring queue of the first visitor object and the processing commands returned by the distributed storage system to the scheduler process in the second visitor object.

[0010] In an optional implementation of the first aspect, the controlling the scheduler process in the first visitor object to open an IO redirection channel includes: sending a handover notification to the first visitor object, the handover notification including the address information of the scheduler process of the second visitor object; controlling the target address of the IO redirection of the scheduler process of the first visitor object to be the address of the scheduler process of the second visitor object, so as to transmit the commands stored in the circular queue of the first visitor object and the processing commands returned by the distributed storage system to the scheduler process in the second visitor object.

[0011] In an optional implementation of the first aspect, controlling the migrated virtual machine to transmit data to the second visitor object and cutting off data transmission between the migrated virtual machine and the first visitor object includes: controlling the migrated virtual machine to transmit data to the iSCSI target process in the second visitor object; cutting off data transmission between the migrated virtual machine and the iSCSI target process in the first visitor object.

[0012] In an optional implementation of the first aspect, before controlling the first visitor object to open an IO redirection channel, the method further includes: controlling the target physical server to create the visitor object pool, and obtaining the second visitor object in the created visitor object pool.

[0013] In an optional implementation manner of the first aspect, controlling the virtual machine to be migrated to migrate from the source physical server to the target physical server includes: controlling the virtual machine to be migrated to migrate from the source physical server to the target physical server by hot migration.

[0014] In a second aspect, the present invention provides an online migration device for virtual resources, the device comprising: a migration control module, used to control the migration of a virtual machine to be migrated from a source physical server to a target physical server, wherein the migrated virtual machine interacts with a distributed storage system through a first visitor object in the source physical server, and different virtual machines have different corresponding visitor objects in the physical server; and, controlling the first visitor object to open an IO redirection channel so that the first visitor object transmits the received data to a second visitor object created in the target physical server through the IO redirection channel; and, controlling the migrated virtual machine to transmit data to the second visitor object, and cutting off the data transmission between the migrated virtual machine and the first visitor object; and, after the data transmission received by the first visitor object is completed, controlling the first visitor object to close the IO redirection channel, thereby completing the migration of virtual resources.

[0015] In the online migration device of virtual resources designed above, this scheme first migrates the virtual machine from the source physical server to the target physical server, and then controls the first visitor object in the source physical server to open the IO redirection channel, so that the data sent by the migrated virtual machine to the first visitor object is transmitted to the second visitor object in the target physical server through the IO redirection channel, and then controls the migrated virtual machine to transmit data to the second visitor object, and cuts off the data transmission between the migrated virtual machine and the first visitor object, so that the migrated virtual machine can interact with the distributed storage system through the second visitor object in the target physical server; and after the data transmission received by the first visitor object is completed, the first visitor object is controlled to close the IO redirection channel, so that before the data transmission between the migrated virtual machine and the first visitor object is disconnected, the data obtained by the first visitor object can be fully transmitted to the second visitor object for processing, so as to prevent data omission, and thus after the first visitor object closes the IO redirection channel, the online migration of virtual resources is realized, so that the designed storage service can achieve linear expansion.

[0016] In an optional implementation of the second aspect, the migration control module is specifically used to control the scheduler process in the first visitor object to open an IO redirection channel to transmit the commands stored in the ring queue of the first visitor object and the processing commands returned by the distributed storage system to the scheduler process in the second visitor object.

[0017] In an optional implementation of the second aspect, the migration control module includes a sending submodule, which is used to send a handover notification to the first visitor object, and the handover notification includes address information of the scheduler process of the second visitor object; the migration control module is also specifically used to control the target address of IO redirection of the scheduler process of the first visitor object to be the address of the scheduler process of the second visitor object, so as to transmit the commands stored in the ring queue of the first visitor object and the processing commands returned by the distributed storage system to the scheduler process in the second visitor object.

[0018] In an optional implementation of the second aspect, the migration control module is further specifically used to control the migrated virtual machine to transmit data to the iSCSI target process in the second visitor object; and to cut off data transmission between the migrated virtual machine and the iSCSI target process in the first visitor object.

[0019] In an optional implementation of the second aspect, the migration control module is further specifically used to control the target physical server to create the visitor object pool, and obtain the second visitor object in the created visitor object pool.

[0020] In an optional implementation of the second aspect, the migration control module is further specifically configured to control the migration of the virtual machine to be migrated from the source physical server to the target physical server by hot migration.

[0021] In a third aspect, the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method in the first aspect or any optional implementation of the first aspect is executed.

[0022] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method in the first aspect or any optional implementation of the first aspect is performed.

[0023] In a fifth aspect, the present application provides a computer program product, which, when running on a computer, enables the computer to execute the method in the first aspect or any optional implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 A schematic diagram of the structure of a hyper-convergence system provided in an embodiment of the present application;

[0026] Figure 2 A schematic diagram of the structure of online migration provided in an embodiment of the present application;

[0027] Figure 3 A flowchart of a method for online migration of virtual resources provided in an embodiment of the present application;

[0028] Figure 4 A schematic diagram of the structure of an online migration device for virtual resources provided in an embodiment of the present application;

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

[0030] Icons: 1-physical server; 10-source physical server; 20-distributed storage system; 30-target physical server; 400-migration control module; 410-sending submodule; 5-electronic device; 501-processor; 502-memory; 503-communication bus. DETAILED DESCRIPTION

[0031] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0032] Before introducing the distributed storage method provided in the embodiment of the present application, some concepts involved in the embodiment of the present application are first introduced:

[0033] Hyper-Converged Infrastructure (HCI) is an information infrastructure framework that integrates storage devices and virtual computing. In such an architecture environment, hardware units such as servers and storage from the same manufacturer are integrated into a chassis with virtualization software.

[0034] A hyper-converged system refers to the use of a hyper-converged infrastructure (HCI) to manage storage-related software and hardware. The hyper-converged system uses a virtual machine (VM)-centric strategy to integrate storage management, data protection, and networking into one box, thereby providing users with virtual machine-related services.

[0035] Logical Unit Number (LUN) refers to the device identification number of a logical storage device, that is, the storage device identification number used according to logical space requirements. It can refer to a storage space resource divided from a distributed storage system. LUN can usually be divided according to capacity space.

[0036] See also Figure 1 The first structural diagram of the hyper-converged system provided by the embodiment of the present application is shown. Based on the hyper-converged system shown in the structural diagram, the present solution realizes the online migration of virtual resources, thereby realizing the linear expansion of the storage service of the hyper-converged system. The hyper-converged system may include multiple physical servers and multiple virtual machines. Multiple virtual machines can be applied on one physical server, such as Figure 1 As shown, two virtual machines: virtual machine A and virtual machine B can be applied to a physical server 1, on which multiple accessor objects (Accessor) are running, each accessor object (Accessor) includes an iSCSI target process (Target Process), a ring queue (Ring Queue) and a dispatcher (Dispatcher) process, wherein the iSCSI target process (Target Process) includes a logical block device LUN of a target logical unit number, and each virtual machine communicates with a distributed storage system 20 in a hyper-converged system through a accessor object.

[0037] When the virtual machine uses the visitor object to communicate with the distributed storage system 20, the virtual machine can send an iSCSI data packet to the iSCSI target process in the corresponding visitor object, and the iSCSI target process parses the received iSCSI data packet into a SCSI command, wherein the SCSI command is a command for operating the logical block device LUN of the target logical unit, and then the iSCSI target process stores the parsed SCSI command in the circular queue of the visitor object, and then reads the SCSI command stored in the circular queue through the scheduler process, thereby sending the read SCSI command to the distributed storage system 20, thereby realizing communication with the distributed storage system 20. Among them, after obtaining the SCSI command, the distributed storage system 20 can return the operation result to the scheduler process, and then return it to the virtual machine through the scheduler process, the circular queue, and the iSCSI target process.

[0038] Based on the hyper-converged system designed above, the present application scheme designs an online migration method for virtual resources, which can migrate the virtual machines and corresponding visitor objects on a physical server to another newly added physical server online without perception, thereby realizing the linear expansion of the hyper-converged system. The online migration method for virtual resources can be applied to the virtual machine migration module of the hyper-converged system, such as Figure 2 As shown in the hyper-converged system structure diagram, when a target physical server 30 is added to the hyper-converged system, it is necessary to migrate the virtual machine B in the source physical server 10 to the target physical server 30, which can be achieved by Figure 3 The method shown here is to implement online migration, including:

[0039] Step S300: Control the migration of the virtual machine to be migrated from the source physical server to the target physical server.

[0040] Step S310: Control the first visitor object to open the IO redirection channel, so that the first visitor object transmits the received data to the second visitor object created in the target physical server through the IO redirection channel.

[0041] Step S320: controlling the migrated virtual machine to transmit data to the second visitor object, and cutting off data transmission between the migrated virtual machine and the first visitor object.

[0042] Step S330: After the data received by the first visitor object is transmitted, the first visitor object is controlled to close the IO redirection channel, thereby completing the migration of the virtual resources.

[0043] In step S300, the present solution migrates the virtual machine to be migrated from the source physical server to the target physical server, for example, Figure 2 As shown, the virtual machine B is migrated from the source physical server 10 to the target physical server 30. Specifically, this solution can migrate the virtual machine B from the source physical server 10 to the target physical server 30 by using the currently commonly used hot migration method.

[0044] Assuming that the virtual machine to be migrated interacts with the distributed storage system through the first visitor object in the source physical server, after the virtual machine to be migrated is migrated from the source physical server to the target physical server, the migrated virtual machine still interacts with the distributed storage system through the first visitor object in the source physical server; Figure 2As shown, virtual machine B interacts with the distributed storage system 20 through the first visitor object Accessor1 in the source physical server 10. After virtual machine B is migrated to the target physical server 30, virtual machine B still interacts with the distributed storage system 20 through the first visitor object Accessor1 in the source physical server 10.

[0045] As a possible implementation method, the migrated virtual machine can perform data transmission with the visitor object in the source physical server via the Internet.

[0046] In order to realize the migration of the entire virtual resources of the virtual machine and the corresponding visitor object, after the migration of the virtual machine is completed, this scheme executes step S310 to control the first visitor object to open the IO redirection channel, so that the first visitor object transmits the received data to the second visitor object created in the target physical server through the IO redirection channel.

[0047] As a possible implementation method, based on the visitor object having the aforementioned structure, this scheme can control the scheduler process in the first visitor object to open an IO redirection channel, so that the SCSI commands stored in the circular queue of the first visitor object and the processing commands returned by the distributed storage system are transmitted to the scheduler process of the second visitor object created in the target physical server.

[0048] As a specific implementation method, this scheme can send a handover notification to the first visitor object, which handover notification includes the address information of the scheduler process of the second visitor object created in the target physical server, so that the IO redirection channel opened by the scheduler process of the first visitor object is directed to the address information of the scheduler process of the second visitor object.

[0049] Since the IO redirection channel opened by the scheduler process of the first visitor object is directed to the address information of the scheduler process of the second visitor object, after the iSCSI data packet sent by the migrated virtual machine to the first visitor object is processed by the iSCSI target process of the first visitor object to form a SCSI command stored in the circular queue, the SCSI command stored in the circular queue will be redirected to the scheduler process of the second visitor object for processing, and the processing command returned by the distributed storage system will also be redirected to the scheduler process of the second visitor object for processing.

[0050] As a possible implementation method, before opening the IO redirection channel, this solution can control the target physical server to create a visitor object pool, and obtain the second visitor object in the visitor object pool, thereby obtaining the second visitor object in the target physical server, wherein the visitor object pool includes a series of visitor objects, and when a new visitor object is needed, it can be called from the visitor object pool.

[0051] After directing the IO redirection channel opened by the scheduler process of the first visitor object to the address information of the scheduler process of the second visitor object, this solution executes step S120 to control the migrated virtual machine to transmit data to the second visitor object, and cuts off the data transmission between the migrated virtual machine and the first visitor object.

[0052] As a possible implementation, this solution can control the migrated virtual machine to transmit data to the iSCSI target process in the second visitor object, and cut off the data transmission between the migrated virtual machine and the iSCSI target process in the first visitor object.

[0053] In the above steps, this solution changes the data transmission path of the virtual machine so that it transmits data to the second visitor object in the migrated target physical server and cuts off the data transmission with the first visitor object, thereby realizing the data path migration of the virtual machine and the visitor object.

[0054] After executing the above steps, the migrated virtual machine can interact with the distributed storage system through the second visitor object. Before the data transmission with the first visitor object is cut off, the migrated virtual machine is still sending data to the first visitor object, and it takes some time for this part of data to be processed by the iSCSI target process and the circular queue of the first visitor object. This part of data also needs to be processed through the IO redirection channel opened in step S110 to ensure data integrity.

[0055] Therefore, this scheme executes step S130, and after the data received by the first visitor object is transmitted, the first visitor object is controlled to close the IO redirection channel, that is, after the migrated virtual machine cuts off the data transmission with the first visitor object, the iSCSI target process in the first visitor object stores all processed iSCSI commands in the circular queue of the first visitor object, and after all iSCSI commands stored in the circular queue of the first visitor object are transmitted to the scheduler process of the second visitor object through the IO redirection channel, the first visitor object is controlled to close the IO redirection channel, thereby realizing the online migration of the virtual machine and the corresponding visitor object.

[0056] In the online migration method of virtual resources designed above, this scheme first migrates the virtual machine from the source physical server to the target physical server, and then controls the first visitor object in the source physical server to open the IO redirection channel, so that the data sent by the migrated virtual machine to the first visitor object is transmitted to the second visitor object in the target physical server through the IO redirection channel, and then controls the migrated virtual machine to transmit data to the second visitor object, and cuts off the data transmission between the migrated virtual machine and the first visitor object, so that the migrated virtual machine interacts with the distributed storage system through the second visitor object in the target physical server; and after the data transmission received by the first visitor object is completed, controls the first visitor object to close the IO redirection channel, so that before the data transmission between the migrated virtual machine and the first visitor object is disconnected, the data obtained by the first visitor object can be fully transmitted to the second visitor object for processing, so as to prevent data omission, and then after the first visitor object closes the IO redirection channel, the online migration of virtual resources is realized, so that the designed hyper-converged system and storage service can achieve linear expansion.

[0057] In an optional implementation of this embodiment, after controlling the first visitor object to close the IO redirection channel, the first visitor object is essentially in an idle state. In this case, the first visitor object can be returned to the visitor object pool of the source physical server, waiting to be used again when needed.

[0058] Figure 4 A schematic structural block diagram of an online migration device for virtual resources provided by the present application is shown. It should be understood that the device and Figure 3The method embodiment executed in corresponds to the embodiment of the method, and the steps involved in the aforementioned method can be executed. The specific functions of the device can refer to the description above. To avoid repetition, detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in a memory or solidified in the operating system (OS) of the device in the form of software or firmware. Specifically, the device includes: a migration control module 400, which is used to control the virtual machine to be migrated from the source physical server to the target physical server, wherein the migrated virtual machine interacts with the distributed storage system through the first visitor object in the source physical server, and different virtual machines have different corresponding visitor objects in the physical server; and, control the first visitor object to open the IO redirection channel so that the first visitor object transmits the received data to the second visitor object created in the target physical server through the IO redirection channel; and; control the migrated virtual machine to transmit data to the second visitor object, and cut off the data transmission between the migrated virtual machine and the first visitor object; and, after the data transmission received by the first visitor object is completed, control the first visitor object to close the IO redirection channel, thereby completing the migration of virtual resources.

[0059] In the online migration device of virtual resources designed above, this scheme first migrates the virtual machine from the source physical server to the target physical server, and then controls the first visitor object in the source physical server to open the IO redirection channel, so that the data sent by the migrated virtual machine to the first visitor object is transmitted to the second visitor object in the target physical server through the IO redirection channel, and then controls the migrated virtual machine to transmit data to the second visitor object, and cuts off the data transmission between the migrated virtual machine and the first visitor object, so that the migrated virtual machine can interact with the distributed storage system through the second visitor object in the target physical server; and after the data transmission received by the first visitor object is completed, the first visitor object is controlled to close the IO redirection channel, so that before the data transmission between the migrated virtual machine and the first visitor object is disconnected, the data obtained by the first visitor object can be fully transmitted to the second visitor object for processing, so as to prevent data omission, and thus after the first visitor object closes the IO redirection channel, the online migration of virtual resources is realized, so that the designed storage service can achieve linear expansion.

[0060] In an optional implementation of this embodiment, the migration control module 400 is specifically used to control the scheduler process in the first visitor object to open an IO redirection channel to transmit the commands stored in the circular queue of the first visitor object and the processing commands returned by the distributed storage system to the scheduler process in the second visitor object.

[0061] In an optional implementation of the present embodiment, the migration control module 400 includes a sending submodule 410, which is used to send a handover notification to the first visitor object, and the handover notification includes the address information of the scheduler process of the second visitor object; the migration control module 400 is also specifically used to control the target address of the IO redirection of the scheduler process of the first visitor object to be the address of the scheduler process of the second visitor object, so as to transmit the commands stored in the circular queue of the first visitor object and the processing commands returned by the distributed storage system to the scheduler process in the second visitor object.

[0062] In an optional implementation of this embodiment, the migration control module 400 is further specifically used to control the migrated virtual machine to transmit data to the iSCSI target process in the second visitor object; and to cut off data transmission between the migrated virtual machine and the iSCSI target process in the first visitor object.

[0063] In an optional implementation of this embodiment, the migration control module 400 is further specifically used to control the target physical server to create a visitor object pool, and obtain the second visitor object from the created visitor object pool.

[0064] In an optional implementation manner of this embodiment, the migration control module 400 is further specifically configured to control the migration of the virtual machine to be migrated from the source physical server to the target physical server by hot migration.

[0065] like Figure 5 As shown, the present application provides an electronic device 5, including: a processor 501 and a memory 502, the processor 501 and the memory 502 are interconnected and communicate with each other through a communication bus 503 and / or other forms of connection mechanisms (not marked), the memory 502 stores a computer program executable by the processor 501, and when the computing device is running, the processor 501 executes the computer program to execute the method in any optional implementation method, such as steps S300 to S330: controlling the virtual machine to be migrated to migrate from the source physical server to the target physical server; controlling the first visitor object to open an IO redirection channel so that the first visitor object transmits the received data to the second visitor object created in the target physical server through the IO redirection channel; controlling the migrated virtual machine to transmit data to the second visitor object, and cutting off the data transmission between the migrated virtual machine and the first visitor object; after the data transmission received by the first visitor object is completed, controlling the first visitor object to close the IO redirection channel, thereby completing the migration of virtual resources.

[0066] The present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method in any of the aforementioned optional implementations is executed.

[0067] Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.

[0068] The present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the method in any optional implementation manner.

[0069] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0070] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0071] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0072] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0073] The above description is only an embodiment of the present application and is not intended to limit the protection scope of 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 spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for online migration of virtual resources, characterized in that: The method comprises: Control the migration of the virtual machine to be migrated from the source physical server to the target physical server, wherein the migrated virtual machine interacts with the distributed storage system through the first visitor object in the source physical server, and different virtual machines have different corresponding visitor objects in the physical server; Controlling the first visitor object to open an IO redirection channel, so that the first visitor object transmits the received data to the second visitor object created in the target physical server through the IO redirection channel; Controlling the migrated virtual machine to transmit data to the second visitor object, and cutting off data transmission between the migrated virtual machine and the first visitor object; After the data received by the first visitor object is transmitted, controlling the first visitor object to close the IO redirection channel, thereby completing the migration of the virtual resources; The visitor object includes an iSCSI target process, a circular queue and a scheduler process, wherein the iSCSI target process is used to parse the iSCSI data packets sent by the virtual machine into SCSI commands and store the SCSI commands in the circular queue, wherein the SCSI commands are commands for operating the logical block device of the target logical unit number; The scheduler process is used to read and process the SCSI command from the circular queue, obtain a SCSI processing command, and send the SCSI processing command to the distributed storage system so that the distributed storage system returns an operation result corresponding to the SCSI processing command.

2. The method according to claim 1, characterized in that The controlling the first visitor object to open an IO redirection channel includes: The scheduler process in the first visitor object is controlled to open an IO redirection channel to transmit the commands stored in the circular queue of the first visitor object and the processing commands returned by the distributed storage system to the scheduler process in the second visitor object.

3. The method according to claim 2, characterized in that The controlling the scheduler process in the first visitor object to open the IO redirection channel includes: Sending a handover notification to the first visitor object, wherein the handover notification includes address information of the scheduler process of the second visitor object; The target address of IO redirection of the scheduler process controlling the first visitor object is the address of the scheduler process of the second visitor object, so as to transmit the commands stored in the circular queue of the first visitor object and the processing commands returned by the distributed storage system to the scheduler process in the second visitor object.

4. The method according to claim 1, characterized in that: The controlling the migrated virtual machine to transmit data to the second visitor object and cutting off the data transmission between the migrated virtual machine and the first visitor object includes: Controlling the migrated virtual machine to transmit data to the iSCSI target process in the second visitor object; The data transmission between the migrated virtual machine and the iSCSI target process in the first visitor object is cut off.

5. The method according to claim 1, characterized in that Before controlling the first visitor object to open the IO redirection channel, the method further includes: The target physical server is controlled to create a visitor object pool, and the second visitor object is obtained from the created visitor object pool.

6. The method according to claim 1, characterized in that The step of controlling the migration of the virtual machine to be migrated from the source physical server to the target physical server includes: The hot migration method is used to control the migration of the virtual machine from the source physical server to the target physical server.

7. An online migration device for virtual resources, characterized in that: The device comprises: A migration control module, used to control the migration of the virtual machine to be migrated from the source physical server to the target physical server, wherein the migrated virtual machine interacts with the distributed storage system through the first visitor object in the source physical server, and different virtual machines have different corresponding visitor objects in the physical server; and, controlling the first visitor object to open an IO redirection channel, so that the first visitor object transmits the received data to the second visitor object created in the target physical server through the IO redirection channel; and; Controlling the migrated virtual machine to transmit data to the second visitor object, and cutting off data transmission between the migrated virtual machine and the first visitor object; And, after the data received by the first visitor object is transmitted, the first visitor object is controlled to close the IO redirection channel, thereby completing the migration of the virtual resources; The visitor object includes an iSCSI target process, a circular queue and a scheduler process, wherein the iSCSI target process is used to parse the iSCSI data packets sent by the virtual machine into SCSI commands and store the SCSI commands in the circular queue, wherein the SCSI commands are commands for operating the logical block device of the target logical unit number; The scheduler process is used to read and process the SCSI command from the circular queue, obtain a SCSI processing command, and send the SCSI processing command to the distributed storage system so that the distributed storage system returns an operation result corresponding to the SCSI processing command.

8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Virtual machine entity thermal migration network smooth switching method and device

    CN106250228A

  • Method and system for the transparent migration of virtual machines storage

    US20080222375A1